M
mazunini
Unregistered / Unconfirmed
GUEST, unregistred user!
vb中有一个调用API函数的module,代码如下:
Declare Function GetWindow Lib "user32"(ByVal hwnd As Long, ByVal wCmd As Long)As Long
'该句抱错 Declare Function GetWindowText Lib "user32" Aias"GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String,ByVal cch As Long)As Long
'该句抱错 Declare Function GetWindowText Length Lib "user32" Aias"GetWindowTextLengthA" (ByVal hwnd As Long)As Long
Public Const GW_HWNDLAST = 0
Public Const GW_HWNDLAST = 1
Public Const GW_HWNDNEXT = 2
Public Const GW_HWNDPREV = 3
Public Const GW_OWNER = 4
但该语句有错误,不知aias“getwindowstextA" 、length lib是干什么用的,老是抱错,请问该如何修改??
另外还有一个函数:
Sub FindTitle()
Dim currwnd As Integer
Combo1.Clear
currwnd = GetWindow(hwnd, GW_HWNDFIRST)
While currwnd <> 0
Length = GetWindow TextLength(currwnd)‘该句抱错
listitem$=Space $(length +1) ‘该句抱错
length= GetWindow Text (currwnd,listitem$,length+1) ‘该句抱错
If Length > 0 then
Combo1.Addltem listitem $ ‘该句抱错
End If
currwnd = GetWindow(currwnd, GW - HWNDNEXT)
If Combl1.ListCount > 0 then
Combo1.Text = Combol.List(0)
Combo1.ListIndex = 0
else
MsgBox "没有发现可活动的窗口", 16, "活动"
End If
Wend
End Sub
请问这句语句有什么问题!!该如何修改??请指教!
Declare Function GetWindow Lib "user32"(ByVal hwnd As Long, ByVal wCmd As Long)As Long
'该句抱错 Declare Function GetWindowText Lib "user32" Aias"GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String,ByVal cch As Long)As Long
'该句抱错 Declare Function GetWindowText Length Lib "user32" Aias"GetWindowTextLengthA" (ByVal hwnd As Long)As Long
Public Const GW_HWNDLAST = 0
Public Const GW_HWNDLAST = 1
Public Const GW_HWNDNEXT = 2
Public Const GW_HWNDPREV = 3
Public Const GW_OWNER = 4
但该语句有错误,不知aias“getwindowstextA" 、length lib是干什么用的,老是抱错,请问该如何修改??
另外还有一个函数:
Sub FindTitle()
Dim currwnd As Integer
Combo1.Clear
currwnd = GetWindow(hwnd, GW_HWNDFIRST)
While currwnd <> 0
Length = GetWindow TextLength(currwnd)‘该句抱错
listitem$=Space $(length +1) ‘该句抱错
length= GetWindow Text (currwnd,listitem$,length+1) ‘该句抱错
If Length > 0 then
Combo1.Addltem listitem $ ‘该句抱错
End If
currwnd = GetWindow(currwnd, GW - HWNDNEXT)
If Combl1.ListCount > 0 then
Combo1.Text = Combol.List(0)
Combo1.ListIndex = 0
else
MsgBox "没有发现可活动的窗口", 16, "活动"
End If
Wend
End Sub
请问这句语句有什么问题!!该如何修改??请指教!