vb 查找外部软件的文本框句柄
将剪贴板板中的内容粘贴到后台登陆界面中的文本框中不知道怎么搞的,su的值总是0,求高手帮忙,我是初学者,多谢指教PrivateDeclareFunctionFindWin...
将剪贴板板中的内容粘贴到 后台登陆 界面中的文本框中
不知道怎么搞的,su的值总是0,求高手帮忙,我是初学者,多谢指教
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As
String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As
Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long,
ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const WM_PASTE = &H302
Private Sub Command1_Click()
Dim winhand As Long
Dim su As Long
winhand = FindWindow(vbNullString, "后台登陆")
su = FindWindowEx(winhand, 0, "EDIT", vbNullString)
Call SendMessage(su, WM_PASTE, 0, 0&)
End Sub 展开
不知道怎么搞的,su的值总是0,求高手帮忙,我是初学者,多谢指教
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As
String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As
Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long,
ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const WM_PASTE = &H302
Private Sub Command1_Click()
Dim winhand As Long
Dim su As Long
winhand = FindWindow(vbNullString, "后台登陆")
su = FindWindowEx(winhand, 0, "EDIT", vbNullString)
Call SendMessage(su, WM_PASTE, 0, 0&)
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询