delphi�⒆执�传入到Windows目前窗口Cursor所在位置


本文整理自网络,侵删。

  网络ID:wnhoo or sos_admin
网名:e梦缘
Mail:wnhoo@163.com
风花雪月 e梦情缘
如下:

function GetSysFocus : integer;
Var
hOtherWin,OtherThreadID,hFocusWin : integer;
Begin
hOtherWin := GetForegroundWindow;
OtherThreadID := GetWindowThreadProcessID( hOtherWin, nil);
If AttachThreadInput( GetCurrentThreadID, OtherThreadID, true ) Then
Begin
hFocusWin := GetFocus;
result := GetFocus;
AttachThreadInput( GetCurrentThreadID, OtherThreadID, False );
End
else
result := getFocus;
End;


procedure TForm1.Timer1Timer(Sender: TObject);
var
s:string;
begin
s:='test';
SendMessage(GetSysFocus, WM_SETTEXT,0,longint(PCHAR(S)));
end;

相关阅读 >>

Delphi 不用控件用函数实现发email

Delphi结构体的方法

Delphi 批量文件改名

Delphi datasnap 2009的简单使用

Delphi 替换系统文件实现绕过杀软启动

Delphi 字符串显示后5位

Delphi sql server备份脚本

Delphi控件升级

Delphi 取出鼠百标点击的 stringgrid 中某单度元格的值

Delphi dbgrid1查询只显示50条记录修改

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...