3 回答

TA貢獻(xiàn)1911條經(jīng)驗(yàn) 獲得超7個(gè)贊
代碼貼出來吧 API不需要引用什么 直接寫聲明 然后調(diào)用即可
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 后面的函數(shù)名有大小寫區(qū)別

TA貢獻(xiàn)1853條經(jīng)驗(yàn) 獲得超18個(gè)贊
估計(jì)是你復(fù)制的時(shí)候聲明里面包含了非法字符或某些地方?jīng)]有空格,我以前經(jīng)常遇到這種情況
建議用vb自帶的工具 “API 文本瀏覽器”來查找并復(fù)制API函數(shù)
****************************
復(fù)制了你代碼,在我這邊我刪除了其中的下劃線,使一個(gè)聲明占一行
運(yùn)行測(cè)試沒問題!
- 3 回答
- 0 關(guān)注
- 2053 瀏覽
添加回答
舉報(bào)