VBA中引用API函数提示“提示子过程或函数未定义”,是否需要勾选工具->引用当中某个选项?或有其他方法?
3 回答
Smart猫小萌
TA贡献1911条经验 获得超7个赞
代码贴出来吧 API不需要引用什么 直接写声明 然后调用即可
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 findwindow Lib "user32" Alias "FindWindowA" (ByVal lpclassname As String, ByVal lpwindowname As String) As Long
Alias 后面的函数名有大小写区别
- 3 回答
- 0 关注
- 1976 浏览
添加回答
举报
0/150
提交
取消