2

当我尝试部署代码(win32 智能手机项目)时,会弹出注册失败错误并且应用程序退出。但是,如果我将 wc.lpszMenuName 的右侧更改为 NULL,则没有菜单一切正常。win mobile 6不支持这个功能吗?

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPTSTR lpCmdLine, int nCmdShow)
{

    WNDCLASS wc;
    HWND hwnd;
    MSG Msg;



    wc.style         = 0;
    wc.lpfnWndProc   = WndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = hInstance;
    wc.hIcon         = NULL;
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU1);
    wc.lpszClassName = g_szClassName;


    if(!RegisterClass(&wc))
    {
        MessageBox(NULL, L"Window Registration Failed!", L"Error!",
            MB_ICONEXCLAMATION | MB_OK);
        return 0;
    }
    // ...
}
4

1 回答 1

1

Have you looked at the WNDCLASS documentation for WinMo? Under the Remarks section, it specifically states:

lpszMenuName is not supported and must be NULL.

I believe that what you're actually needing is a MenuBar control.

于 2013-04-16T14:37:41.723 回答