怎样让自己的程序运行时,在任务栏上不可见!!!!!!!!!1

解决方案 »

  1.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        Button2: TButton;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;
    function RegisterServiceProcess (dwProcessID, dwType: DWord) : DWord; stdcall; external 'KERNEL32.DLL';
    implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    begin
     RegisterServiceProcess(GetCurrentProcessID,1);
    end;procedure TForm1.Button2Click(Sender: TObject);
    begin
     RegisterServiceProcess(GetCurrentProcessID,0);  //GetCurrentProcessID
    end;end.
      

  2.   

    Form1Create中写
    SetWindowsLong(Application.handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW)
      

  3.   

    procedure TForm1.FormShow(Sender:TObject);
    begin
      ShowWindow(Application.Handle,SW_HIDE);
    end;
      

  4.   

    SetWindowsLong(Application.handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW)
      

  5.   

    ShowWindow(Application.Handle,SW_HIDE);隐藏
    ShowWindow(Application.Handle,SW_SHOW);显示
      

  6.   

    Form1Create中写
    SetWindowsLong(Application.handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW)