vb用sendmessage发送按键怎么发到标题上去了 5
OptionExplicitPrivateConstWM_SETTEXT=&HCPrivateDeclareFunctionSendMessageLib"user32"A...
Option Explicit
Private Const WM_SETTEXT = &HC
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
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetDlgItem Lib "user32" (ByVal hDlg As Long, ByVal nIDDlgItem As Long) As Long
Private Sub Command1_Click()
Dim s As String
Dim FT_hWnd As Long
Dim FT_hWnd1 As Long
Dim ID_Control_hWnd As Long
Dim ID_Control_hWnd1 As Long
s = "test"
FT_hWnd = FindWindow(vbNullString, "Element Client")
If FT_hWnd = 0 Then
MsgBox "False", vbInformation, "Title"
End
End If
SendMessage FT_hWnd, WM_SETTEXT, 0, ByVal s
End Sub
我自己学着写的一个程序,为了是把按键发到游戏程序,但是运行以后发现程序的标题被修改了,但是里面的文本框没收到,麻烦高手给看看 展开
Private Const WM_SETTEXT = &HC
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
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetDlgItem Lib "user32" (ByVal hDlg As Long, ByVal nIDDlgItem As Long) As Long
Private Sub Command1_Click()
Dim s As String
Dim FT_hWnd As Long
Dim FT_hWnd1 As Long
Dim ID_Control_hWnd As Long
Dim ID_Control_hWnd1 As Long
s = "test"
FT_hWnd = FindWindow(vbNullString, "Element Client")
If FT_hWnd = 0 Then
MsgBox "False", vbInformation, "Title"
End
End If
SendMessage FT_hWnd, WM_SETTEXT, 0, ByVal s
End Sub
我自己学着写的一个程序,为了是把按键发到游戏程序,但是运行以后发现程序的标题被修改了,但是里面的文本框没收到,麻烦高手给看看 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询