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

我自己学着写的一个程序,为了是把按键发到游戏程序,但是运行以后发现程序的标题被修改了,但是里面的文本框没收到,麻烦高手给看看
展开
 我来答
偬妒潦野潦颖d0
2008-10-20 · TA获得超过570个赞
知道小有建树答主
回答量:365
采纳率:0%
帮助的人:237万
展开全部
参数问题,取值不同发送的消息含义也不同,第二个参数,你去网上查下这个函数的参数的取值意义吧
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式