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中实现密码框“大写锁定打开”的提示

Delphi 获取指定当前目录下指定文件扩展名所有文件

Delphi 每年、月、周、日的开始与结束的时间

Delphi提取网页中的所有链接、点击第n个链接

Delphi版插apc杀进程驱动源码

Delphi indy 组件包里的 idhttp 组件使用 get 方法下载文件限速的方法

Delphi unigui执行程序部署有3种形式

Delphi tchart使用经验小结

Delphi 在tedit中显示水印提示

Delphi鼠标移过放大镜效果

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



打赏

取消

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

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

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

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

评论

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