將字串传入到Windows目前窗口Cursor所在位置
敬业的IT人
互联网
佚名
2008-1-4 16:51:50
网络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;
- 最新文章
- Format的用法[01-04]
- 数字随机排序[01-04]
- Delphi控制Excel的重要属性和方法[01-04]
- 用DELPHI实现文件加密压缩[01-04]
- VCL中网格控件原理分析[01-04]
- delphi中command/action的疑惑[01-04]
- 相关文章
- Format的用法[01-04]
- 改变Windows的缺省打印机[01-04]
- 序列化FastReport[01-04]
- 调用DLL文件中的FORM[01-04]
- 在Delphi中如何把数据库中的记录引到word中[01-04]
- 利用Delphi消息处理建立类似Windows开始菜单[01-04]
