我在单文档工程里的OnCreate函数里面用了ModifyStyle(WS_SYSMENU, 0);这样可以去掉Titlebar, 可是任务条上的图标也没有了,怎样把它加上去呢?

解决方案 »

  1.   

    SendMessage(m_hWnd,WM_SETICON,0,(LONG)hIcon);
      

  2.   

    http://www.codeproject.com/shell/trayicons.asp
      

  3.   

    我先用GetIcon得到,再SetIcon,可是不行估计是GetIcon得不到图标,怎样把一个图标自己Load进来呢?
      

  4.   

    HANDLE LoadImage(
      HINSTANCE hinst,   // handle to instance
      LPCTSTR lpszName,  // image to load
      UINT uType,        // image type
      int cxDesired,     // desired width
      int cyDesired,     // desired height
      UINT fuLoad        // load options
    );易水的不错。
      

  5.   

    cWnd->ModifyStyle(WS_SYSMENU, 0);
    HICON hIcon;
    hIcon = (HICON)LoadImage(NULL,
    "d:\\test.ico",
    IMAGE_ICON,
    0, 0, 
    LR_LOADFROMFILE);
    SendMessage(cWnd->m_hWnd, WM_SETICON ,0 , (LONG)hIcon);大家来看看,这是在OnCreate里面做的,为什么不行呢?