将么向已知外部窗口句柄发送指令? ( 积分: 50 )

  • 主题发起人 主题发起人 轻工业部
  • 开始时间 开始时间

轻工业部

Unregistered / Unconfirmed
GUEST, unregistred user!
我已经查出外部窗体的句柄,想向这个窗体的文本框发送字符或回车符怎么做?<br> &nbsp;<br> &nbsp;回复人: BigBen(江南草) ( ) 信誉:98 &nbsp;2005-05-31 19:17:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; 还要找出那个EDIT窗口的句柄,SendMessage(hedit,WM_SetText,0,lpStr);<br> &nbsp;<br> <br>Top &nbsp;<br> <br> 回复人: lwx139(轻工业部) ( ) 信誉:100 &nbsp;2005-05-31 19:38:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; 怎样查找EDIT的句柄?<br> &nbsp;<br> <br>Top &nbsp;<br> <br> 回复人: BigBen(江南草) ( ) 信誉:98 &nbsp;2005-06-01 07:32:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; s:='test';<br><br>hdl:=FindWindow('TForm1','Form1);<br>hdl:=FindwindowEx(hdl,0,'TEdit','Edit1');<br>SendMessage(hdl,WM_SetText,0,longint(pchar(s)));<br> &nbsp;<br> <br>Top &nbsp;<br> <br> 回复人: lwx139(轻工业部) ( ) 信誉:100 &nbsp;2005-06-01 10:52:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; 回车符怎么发?<br><br>还有就是我想读文本框中光标的位置而不是鼠标位置怎么做?<br> &nbsp;<br> <br>Top &nbsp;<br> <br> 回复人: nice0934(nice0934) ( ) 信誉:94 &nbsp;2005-06-01 11:08:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; #13#10<br> &nbsp;<br> <br>Top &nbsp;<br> <br> 回复人: lwx139(轻工业部) ( ) 信誉:100 &nbsp;2005-06-01 12:41:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; SendMessage(hdl,WM_SetText,#13,longint(pchar(s)));吗?<br> &nbsp;<br> <br>Top &nbsp;<br> <br> 回复人: xiaoyaozgc() ( ) 信誉:100 &nbsp;2005-06-01 14:14:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; 学习<br> &nbsp;<br> <br>Top &nbsp;<br> <br> 回复人: lwx139(轻工业部) ( ) 信誉:100 &nbsp;2005-06-01 17:42:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; 我试了sendmessage(getsysfocus,WM_KEYDOWN,VK_RETURN,0);<br>和sendMessage(GetSysFocus,WM_SetText,0,13)<br>都不行。
 
我已经查出外部窗体的句柄,想向这个窗体的文本框发送字符或回车符怎么做?<br> &nbsp;<br> &nbsp;回复人: BigBen(江南草) ( ) 信誉:98 &nbsp;2005-05-31 19:17:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; 还要找出那个EDIT窗口的句柄,SendMessage(hedit,WM_SetText,0,lpStr);<br> &nbsp;<br> <br>Top &nbsp;<br> <br> 回复人: lwx139(轻工业部) ( ) 信誉:100 &nbsp;2005-05-31 19:38:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; 怎样查找EDIT的句柄?<br> &nbsp;<br> <br>Top &nbsp;<br> <br> 回复人: BigBen(江南草) ( ) 信誉:98 &nbsp;2005-06-01 07:32:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; s:='test';<br><br>hdl:=FindWindow('TForm1','Form1);<br>hdl:=FindwindowEx(hdl,0,'TEdit','Edit1');<br>SendMessage(hdl,WM_SetText,0,longint(pchar(s)));<br> &nbsp;<br> <br>Top &nbsp;<br> <br> 回复人: lwx139(轻工业部) ( ) 信誉:100 &nbsp;2005-06-01 10:52:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; 回车符怎么发?<br><br>还有就是我想读文本框中光标的位置而不是鼠标位置怎么做?<br> &nbsp;<br> <br>Top &nbsp;<br> <br> 回复人: nice0934(nice0934) ( ) 信誉:94 &nbsp;2005-06-01 11:08:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; #13#10<br> &nbsp;<br> <br>Top &nbsp;<br> <br> 回复人: lwx139(轻工业部) ( ) 信誉:100 &nbsp;2005-06-01 12:41:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; SendMessage(hdl,WM_SetText,#13,longint(pchar(s)));吗?<br> &nbsp;<br> <br>Top &nbsp;<br> <br> 回复人: xiaoyaozgc() ( ) 信誉:100 &nbsp;2005-06-01 14:14:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; 学习<br> &nbsp;<br> <br>Top &nbsp;<br> <br> 回复人: lwx139(轻工业部) ( ) 信誉:100 &nbsp;2005-06-01 17:42:00 &nbsp;得分: 0 &nbsp;<br> <br> <br> &nbsp; 我试了sendmessage(getsysfocus,WM_KEYDOWN,VK_RETURN,0);<br>和sendMessage(GetSysFocus,WM_SetText,0,13)<br>都不行。
 
没人看吗?是太难还是太容易?
 
后退
顶部