Je suis en train de coder une application comme Notepad dans Win32 C++. Mais quand je change szClassName dans createWindow(), le menu ne peut pas fonctionner bien qu'il montre encore quand je lanceWin 32 API C++ Bloc-notes Le menu ne fonctionne pas
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
hInst = hInstance; // Store instance handle in our global variable
hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDC_NOTEPAD));
hWnd = CreateWindow(L"EDIT", szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, hMenu, hInstance, NULL);
//SetWindowLong(hWnd, GWL_WNDPROC, (LONG)WndProc);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
Vous voulez que votre fenêtre principale soit une commande d'édition ou quoi? Cela ne marchera pas. –
Oui. Je commence à apprendre l'API Win32 et je ne sais pas comment faire une application comme Notepad – AdamTruong
[Procédure pas à pas: création d'applications de bureau Windows (C++)] (https://msdn.microsoft.com/fr-fr/library/ bb384843.aspx) – IInspectable