http://www.chinaithero.com/一步一步教你怎么做:)
解决方案 »
- idftp如何判断ftp服务器上指定目录里的一个文件是否存在?
- [DCC Error] Unit1.pas(40): E2015 Operator not applicable to this operand type
- 两个小问题...
- 理不清思路了,delphi调用winapi 用一段时间后就不能用了~~~
- 如何通过COM在服务/客户中传递图片
- 要从oracle9中导数据到access,有谁用过batchmove控件来控制嘛?
- 如何打印TImage中的图片?
- 做一个C/S的桌面程序能放在桌面右下角,隔一段时间检测一次数据库,发现有新数据是将其用打印机打印出来
- 究竟如何才能真正地利用DELPHI做一些东西呢? 有大侠愿意收徒弟么?
- 请问哪有《Object Pascal Language Guide》中文版,供下载?
- To Kingron:针对刚才的问题?
- delphi编程问题
下面是一个ontimer事件,可以把鼠标慢慢移动到当前窗口的右上角的“关闭”按钮,然后模拟鼠标单击来关掉窗口,
procedure TForm1.Timer1Timer(Sender: TObject);
Var
h1,h:Hwnd;
r:Trect;
j,i:integer;
begin
Sleep(500);
h1:=GetDesktopWindow();
h:=GetForegroundWindow();
if h1=h then
begin
h:=GetNextWindow(h1,GW_HWNDPREV);
SetForegroundWindow(h);
GetWindowRect(h,r);
setcursorpos(r.Left+20,r.Bottom);
For i:=r.Bottom downto (r.Top+10) do
begin
setcursorpos(r.Left+20,i);
Sleep(6);
end;
For j:=(r.Left+20) to (r.Right-13) do
begin
Setcursorpos(j,r.Top+10);
Sleep(6);
end;
Sleep(10);
Mouse_Event(MOUSEEVENTF_LEFTDOWN,j,i+145,0,0);
Mouse_Event(MOUSEEVENTF_LEFTUP,j,j,0,0);
Sleep(15);
end
else
begin
SetForegroundWindow(h);
GetWindowRect(h,r);
setcursorpos(r.Left+20,r.Bottom);
For i:=r.Bottom downto (r.Top+10) do
begin
setcursorpos(r.Left+20,i);
Sleep(6);
end;
For j:=(r.Left+20) to (r.Right-13) do
begin
Setcursorpos(j,r.Top+10);
Sleep(6);
end;
Sleep(10);
Mouse_Event(MOUSEEVENTF_LEFTDOWN,j,i+145,0,0);//模拟鼠标按下
Mouse_Event(MOUSEEVENTF_LEFTUP,j,j,0,0);
Sleep(15);
end;end;