我已经使用FindWindow得到该窗口的HWND,这个窗口不是Dialog,如果将它的图标不显示在任务拦呢?

解决方案 »

  1.   

    查了资料,Dialog的话使用SetWindowLong(hWnd,GWL_EXSTYLE, WS_EX_TOOLWINDOW|WS_EX_STATICEDGE); 就可以搞定
      

  2.   

    去掉System Menu
    ModifyStyle(WS_SYSMENU, 0);
      

  3.   

    // MyTaskBarDeleteIcon - deletes an icon from the taskbar status area. 
    // Returns TRUE if successful, or FALSE otherwise. 
    // hwnd - handle to the window that added the icon. 
    // uID - identifier of the icon to delete. 
    BOOL MyTaskBarDeleteIcon(HWND hwnd, UINT uID) 

        BOOL res; 
        NOTIFYICONDATA tnid; 
     
        tnid.cbSize = sizeof(NOTIFYICONDATA); 
        tnid.hWnd = hwnd; 
        tnid.uID = uID; 
             
        res = Shell_NotifyIcon(NIM_DELETE, &tnid); 
        return res;