|
楼主 |
发表于 2014-2-24 20:46
|
显示全部楼层
zhaogang1960 发表于 2014-2-24 19:35
请参考VBA帮助
Declare 语句 PtrSafe 关键字
带有 PtrSafe 关键字的 Declare 语句为建议的语法。要使包括 ... - If VBA7Then
- Public Declare PtrSafe Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongLong
- Public Declare PtrSafe Function ClientToScreen Lib "user32" (ByVal hWnd As LongLong, lpPoint As POINTAPI) As LongLong
- Public Popup_Menu As CommandBar '指定弹出式菜单
- Public LastSelect_Menu As MSForms.Image '最后选择的菜单
- Public MenuCount As Integer '子菜单数量
- Public hForm As Long '窗口句柄
- Public intLevel As Integer '级别标识,用于设置Radio菜单(游戏菜单中:初级,中级,高级)
- Public bAbortEnabled As Boolean '标识放弃菜单项是否可用
- Public bItemCheck As Boolean '标识音效菜单是否CheckOn
- Public bMenuSelected As Boolean '标识菜单是否点击
- Public pt As POINTAPI '定义点
- Public faceid As Integer '图标ID
- Public faceidselect As Integer '选择的图标
- Public fistid As Integer '第一个图标号
- Public lastid As Integer '最后一个图标号
- Public selectrow, selectcol As Integer
- Public Mcro(50) As String
- Public Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As LongLong, ByVal nIndex As LongLong) As LongLong
- Public Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As LongLong, ByVal nIndex As LongLong, ByVal dwNewLong As LongLong) As LongLong
- Public Const GWL_STYLE = (-16)
- Public Const WS_THICKFRAME As Long = &H40000 '(回復大小)
- Public Const WS_MINIMIZEBOX As Long = &H20000 '(最小化)
- Public Const WS_MAXIMIZEBOX As Long = &H10000 '(最大化)
- Else
- Public Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
- Public Declare Function ClientToScreen Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long
- Public Popup_Menu As CommandBar '指定弹出式菜单
- Public LastSelect_Menu As MSForms.Image '最后选择的菜单
- Public MenuCount As Integer '子菜单数量
- Public hForm As Long '窗口句柄
- Public intLevel As Integer '级别标识,用于设置Radio菜单(游戏菜单中:初级,中级,高级)
- Public bAbortEnabled As Boolean '标识放弃菜单项是否可用
- Public bItemCheck As Boolean '标识音效菜单是否CheckOn
- Public bMenuSelected As Boolean '标识菜单是否点击
- Public pt As POINTAPI '定义点
- Public faceid As Integer '图标ID
- Public faceidselect As Integer '选择的图标
- Public fistid As Integer '第一个图标号
- Public lastid As Integer '最后一个图标号
- Public selectrow, selectcol As Integer
- Public Mcro(50) As String
- Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
- Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
- Public Const GWL_STYLE = (-16)
- Public Const WS_THICKFRAME As Long = &H40000 '(回復大小)
- Public Const WS_MINIMIZEBOX As Long = &H20000 '(最小化)
- Public Const WS_MAXIMIZEBOX As Long = &H10000 '(最大化)
- End If
复制代码 VBA7为无效外部引用, win7 64位系统 |
|