我想把应用程序在任务栏的抽屉(开始菜单右边的那个按钮)隐藏起来,像QQ一样,请问该怎么做?

解决方案 »

  1.   

    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {
    if( !CFrameWnd::PreCreateWindow(cs) )
    return FALSE;
    // TODO: Modify the Window class or styles here by modifying
    //  the CREATESTRUCT cs cs.dwExStyle |= WS_EX_TOOLWINDOW;
    return TRUE;
    }对话框应用程序,直接可以设置dialog的style为Tool window
      

  2.   

    完全同意楼上的,解释一下:
    WS_EX_TOOLWINDOW   Creates a tool window, which is a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the task bar or in the window that appears when the user presses ALT+TAB. 
      

  3.   

    Alternative Way(I have tested)
    --------------------------------->>
    //在任务条上不显示图标
    先从CWinApp继承类中建立一个不显示的顶级窗口. CFrameWnd *abc=new CFrameWnd();
    abc->Create(0,0,WS_OVERLAPPEDWINDOW);
    CNoTaskBarIconDlg dlg(abc);
    m_pMainWnd = &dlg;
    int nResponse = dlg.DoModal();
    if (nResponse == IDOK)
    {
    }
    else if (nResponse == IDCANCEL)
    {
    }
    delete abc;在 OnInitDialog中修改显示风格 WS_EX_APPWINDOW.BOOL CNoTaskBarIconDlg::OnInitDialog()
    {
        CDialog::OnInitDialog();
        ModifyStyleEx(WS_EX_APPWINDOW,0);    SetIcon(m_hIcon, TRUE);  // Set big icon
        SetIcon(m_hIcon, FALSE); // Set small icon
        
        // TODO: Add extra initialization here
        
        return TRUE;  // return TRUE  unless you set the focus to a control
      

  4.   

    改写App的InitInstance()中的一条语句.BOOL CXXXApp::InitInstance()
    {
          .................
    //m_pMainWnd->ShowWindow(SW_SHOW);   //原来的语句
              m_pMainWnd->ShowWindow(SW_HIDE);   //修改后的语句      ................      
      
    }
      

  5.   

    我试过诸位的方法,把窗体设成ToolWindow风格只是把窗体的标题栏中的图标隐去了,我说的是任务栏——“开始”菜单所在的那个那一条条,每个程序启动后,都会有个所谓的“抽屉”,在那里,我想不显示那个抽屉
      

  6.   

    dialog中的extended style里设置tool window,然后在::OnInitDialog()里加上ModifyStyleEx(WS_EX_APPWINDOW,0);就可以了
    BOOL CAaaDlg::OnInitDialog()
    {
    CDialog::OnInitDialog();
    ModifyStyleEx(WS_EX_APPWINDOW,0);
             return TRUE;
    }
      

  7.   

    看看吧
    http://www.csdn.net/develop/Read_Article.asp?Id=17482
      

  8.   

    http://www.vckbase.com/code/listcode.asp?mclsid=5&sclsid=501