当前位置: 代码迷 >> PB >> SendMessage 改窗口标,sendMessage 参数总不对,请教如何改
  详细解决方案

SendMessage 改窗口标,sendMessage 参数总不对,请教如何改

热度:284   发布时间:2016-04-29 09:31:23.0
SendMessage 改窗口标,sendMessage 参数总不对,请问怎么改
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)