AutoHotkey中的参数顺序如下:
SendMessage, Msg [, wParam, lParam, Control, WinTitle, WinText, ExcludeTitle, ExcludeText, Timeout]
SendMessage,Msg , wParam, lParam,控件标识可以空, 窗口标识
AutoHotkey调用方式:
; 例子: ahk中的函数 "SendMessage" 来改记事本窗口标题。
#z::
Run Notepad
WinWait 无标题 - 记事本
SendMessage,0xC,, "哥要你改标题",,A ; 0XC 为 WM_SETTEXT
;SendMessage, 0xC, 0, "New Notepad Title"
MsgBox 点击确定将关闭记事本
WM_CLOSE=0x10
WM_QUIT=0x12
SendMessage,WM_CLOSE, 0, 0,,哥要你改标题
c#语言:
[DllImport("user32.dll", EntryPoint="SendMessage")]
public static extern int SendMessage (int hwnd,int wMsg,string wParam,string lParam);
SendMessage的用法
SendMessage(句柄,消息的标识符,"取决于消息","取决于消息");
从CSDN中可以查到消息 WM_SETTEXT =0x000C
那么可得
SendMessage(handelA, 0x000C, "", "哥要你改标题");