|
改为以下格式
#If VBA7 And Win64 Then
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongLong
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As LongLong, ByVal nIndex As LongLong) As LongLong
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As LongLong, ByVal nIndex As LongLong, ByVal dwNewLong As LongLong) As LongLong
Private Declare Function SetLayeredWindowAttributes Lib "user32" _
(ByVal hWnd As LongLong, ByVal crKey As LongLong, ByVal bAlpha As Byte, ByVal dwFlags As LongLong) As LongLong
Private Const WS_EX_LAYERED = &H80000
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_ALPHA = &H2 '表示把窗体设置为半透明样式
Private Const LWA_COLORKEY = &H1 '表示不显示窗体中的透明色
Dim hWndForm As Long
Dim hWndXls As Long
Dim iStyle As Long
#Else
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" _
(ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Const WS_EX_LAYERED = &H80000
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_ALPHA = &H2 '表示把窗体设置为半透明样式
Private Const LWA_COLORKEY = &H1 '表示不显示窗体中的透明色
Dim hWndForm As Long
Dim hWndXls As Long
Dim iStyle As Long
#End If |
|