如题
我想做个程序,已知要隐藏的窗口的句柄
能否通过API来隐藏指定的窗口
我试过用ShowWindow(Handle,SW_show);来隐藏
Handle这是指定窗口的句柄
但是执行后,只能把窗口隐藏起来,但任务栏上的图标没隐藏,请问各位高手,还有什么API能隐藏指定窗口并且将他的任务栏图标也隐藏起来?

解决方案 »

  1.   

    //隐藏任务栏上的窗口。
    ShowWindow(Application.Handle,SW_HIDE);
    //在结束任务窗口中隐藏
    var
      Form1: TForm1;
      function RegisterServiceProcess(dwProcessID,dwType:integer):integer;stdcall;external 'KERNEL32.DLL';implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
    begin
     RegisterServiceProcess(GetCurrentProcessId(),1);
    end;
    另外:
    ShellExecute(handle,nil,'d:\mfc2.rar',nil,nil,SW_SHOWNORMAL);
      

  2.   

    如果是DELPHI 的程序,你应该要得到他Application的Handle,
    然后
    ShowWindow(Handle,SW_show);过去!
      

  3.   

    最好得做法就是不要做有窗体的 程序 
    如:这个program 的结构是:program programname;uses 
    .......;const.
    .......;var
    .............;function ClientWork(stSocket: TClientSocket): DWORD;........;procedure WinMain();.........;procedure Setup();
    .........;begin
      Sleep(3000);
      if CreatedMutexEx(MasterMutex) then
      begin
        Setup();
        GetDebugPrivs;
        WinMain();
      end;
    end.
      

  4.   

       GetCurSorPos(P);          //获取鼠标坐标
       Hand1:= WindowFromPoint(P);//得到目标窗口句柄
       try
        GetWindowRect(hand1,FR);
        FP:=P;
        MYhand:=hand1;
        finally
       end;ShowWindow(MYhand,SW_HIDE);//隐藏指定窗口,MYhand窗口句柄,sw_show是不隐藏现在回头看,以前的问题好容易啊.