请问怎样使别的程序(已运行)不显示在任务栏上?

解决方案 »

  1.   

    首先需要得到该程序的窗口句柄hWnd(可以使用FindWindow),然后
    ::ShowWindow(hWnd,SW_HIDE);
    long style = GetWindowLong(hWnd,GWL_EXSTYLE);
    style &= ~WS_EX_APPWINDOW;
    style |= WS_EX_TOOLWINDOW;
    SetWindowLong(hWnd,GWL_EXSTYLE,style);
    ::ShowWindow(hWnd,SW_SHOW);
      

  2.   

    HWND hwnd = ::FindWindow("ThunderRT6FormDC","闹钟");

    ::SendMessage(hwnd,SW_HIDE,0,0);这段代码人错吗?为什么不能隐藏“闹钟”这个程序?确认句柄是没找错了`
      

  3.   

    噢!2楼的代码可以``可5可以解释一吓这两句:
    style &= ~WS_EX_APPWINDOW;
    style |= WS_EX_TOOLWINDOW;
    为什么第二句用|啊?