Win32 question and answer menu

zhaozj2021-02-08  207

Xiaohui Forum Essence

I have edited a menu name "GSF" but not displayed in the program.

I am defined in the program: WNDCLASS.LPSZMENUNAME = "GSF" is there any statement that is not defined? ? ? Annex: original program #include LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) {static TCHAR szAppName [] = TEXT ( " HelloWin "); HWND hwnd; mSG msg; WNDCLASS wndclass; wndclass.style = CS_HREDRAW | CS_VREDRAW; wndclass.lpfnWndProc = WndProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = hInstance; wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION); wndclass.hCursor = LoadCursor (NULL, IDC_ARROW); wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); wndclass.lpszMenuName = "GSF"; wndclass.lpszClassName = szAppName; if (RegisterClass (& wndclass)! ) {MessageBox (NULL, TEXT ( "This program requires Windows NT!"), szAppName, MB_ICONERROR); return 0;} hwnd = CreateWindow (szAppName, // window class name "The Hello Program", // window captionWS_OVERLAPPEDWINDOW, / / window stylefault, // initial x positioncw_usedefault, // initial y positioncw_usedefault, // in itial x sizeCW_USEDEFAULT, // initial y sizeNULL, // parent window handleNULL, // window menu handlehInstance, // program instance handleNULL); // creation parametersShowWindow (hwnd, iCmdShow); UpdateWindow (hwnd); while (GetMessage (& msg, NULL, 0, 0)) {TranslateMessage (& msg); DispatchMessage (& msg);} return msg.wParam;} LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {HDC hdc; PAINTSTRUCT ps; RECT rect Switch (Message) {Case WM_Paint: HDC = BeginPaint (HWND, & PS); GetClientRect (hwnd, &)

转载请注明原文地址:https://www.9cbs.com/read-3190.html

New Post(0)