自已写一个不太麻烦,以下程序可以定时移动光标并循环打开几个网页:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls,ShellApi, TimerLst;
type
TForm1 = class(TForm)
Button1: TButton;
Timer1: TTimer;
Timer2: TTimer;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
const
URLList: Array[0..3] of String =('http://www.obsof.com',
'http://bbs.nease.net',
'http://www.gm-software.de/',
'http://delphidao.finalfiler.com/');
var
hIE: THandle;
i: Integer;
procedure TForm1.Button1Click(Sender: TObject);
begin
hIE :=FindWindow('IEFrame',nil);
if hIE > 0 then
begin
SetForeGroundWindow(hIE);
Timer1.Enabled := True;
Timer2.Enabled := True;
end
else
showMessage('请先启动IE');
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
curPos: TPoint;
begin
GetCursorpos(curPos);
if curPos.x > (Screen.DesktopWidth - 100) then
SetCursorpos(Screen.DesktopLeft +10,curPos.y);
Mouse_Event(MOUSEEVENTF_MOVE,10,0,0,0);
end;
procedure TForm1.Timer2Timer(Sender: TObject);
begin
i := (i + 1) mod 4;
if hIE > 0 then
ShellExecute(hIE,nil,PChar(URLList),nil,nil,0);
end;
end.