为什么我的 HMENU hmenu=GetSystemMenu(hwnd,FALSE);无法显示系统菜单呢.
会不会是我的WNDCLASS结构变量在风格有问题? 可是后来我又去找了一道例题,仍然不显示.
我的WNDCLASS变量的设置是这样的:
        WNDCLASS wndclass;
wndclass.style=CS_HREDRAW|CS_VREDRAW;//为了简单,仅采用了滚动条.
.....
         
         HMENU hmenu=GetSystemMenu(hwnd,FALSE);//显示未果,但hmenu并不为空.

解决方案 »

  1.   

    显示系统菜单?可是你这句只是获得系统菜单的句柄啊。是不是要在窗口上加系统菜单?那就在创建窗口的时候加上WS_SYSMENU样式,同时必须有WS_CAPTION样式。
      

  2.   

    是我搞错了,其实不用WS_SYSMENU和WS_CAPTION样式也可以,这时的菜单点击窗口的图标可以看到.
    怎么为窗口创建菜单栏呢.
      

  3.   

    还有,点右键时,CreatePopupMenu创建的弹出菜单要怎么才能显示?
      

  4.   

    lpszMenuName
    Pointer to a null-terminated character string that specifies the resource name of the class menu, as the name appears in the resource file. If you use an integer to identify the menu, use the MAKEINTRESOURCE macro. If this member is NULL, windows belonging to this class have no default 
    The application can add the new menu to an existing menu, or it can display a shortcut menu by calling the TrackPopupMenuEx or TrackPopupMenu functions. 太晚了,睡觉去了。
      

  5.   

    Got it,I`ll try it,thanks!