run("calc.exe")
long ll_handle
string ls_Class,ls_winTitle
setNull(ls_Class)
ls_winTitle = "计算器"
ll_handle = FindWindowA(ls_Class,ls_winTitle)
//messagebox("",string(ll_handle))
string ls_title
ls_title="大家的计算器";
Constant long WM_SETTEXT = 12;
long t
t = long(ls_title);
SendMessage(ll_handle,WM_SETTEXT,ls_class,t);//修改标题
函数定义如下:
Function ulong FindWindowA (String lpClassName,String lpWindowName) Library "user32.dll"
FUNCTION ulong SendMessage(ulong hwnd,ulong wMsg,ulong wParam,ref ulong lParam) LIBRARY "user32.dll" ALIAS FOR "SendMessageA"
------解决方案--------------------
String ls_WindowsTitle
long ll_handle
string ls_Class,ls_winTitle
setNull(ls_Class)
ls_winTitle = "计算器"
ll_handle = FindWindowA(ls_Class,ls_winTitle)
ls_WindowsTitle = sle_1.Text
SendMessage(ll_handle, 12, 0, ls_WindowsTitle)