diff --git a/src/Draw/MAINWINDOW.h b/src/Draw/MAINWINDOW.h index c894bd48f0..db092a750c 100644 --- a/src/Draw/MAINWINDOW.h +++ b/src/Draw/MAINWINDOW.h @@ -31,7 +31,7 @@ LRESULT APIENTRY WndProc(HWND, UINT, WPARAM, LPARAM); BOOL CreateProc(HWND); VOID DestroyProc(HWND); -BOOL CommandProc(HWND, WPARAM, LPARAM); +LRESULT APIENTRY CmdProc(HWND, UINT, WPARAM, LPARAM); #endif diff --git a/src/Draw/MainWindow.cxx b/src/Draw/MainWindow.cxx index b188bbbfa4..ccbc4611ac 100644 --- a/src/Draw/MainWindow.cxx +++ b/src/Draw/MainWindow.cxx @@ -49,7 +49,7 @@ LRESULT APIENTRY WndProc(HWND hWndFrame, UINT wMsg, WPARAM wParam, LPARAM lParam break; case WM_COMMAND : - CommandProc(hWndFrame, wParam, lParam); + CmdProc(hWndFrame, LOWORD(wParam), wParam, lParam); break; case WM_DESTROY : @@ -85,13 +85,14 @@ BOOL CreateProc(HWND hWndFrame) /*--------------------------------------------------------------------------*\ | COMMAND PROCEDURE | Handler for message WM_COMMAND -| +| It is used when Draw_IsConsoleSubsystem = Standard_False +| i.e. in non-console mode (see _main_() in Draw_Main.cxx). \*--------------------------------------------------------------------------*/ -BOOL CommandProc(HWND hWndFrame, WPARAM wParam, LPARAM /*lParam*/) +LRESULT APIENTRY CmdProc(HWND hWndFrame, UINT wMsg, WPARAM /*wParam*/, LPARAM /*lParam*/) { // Handle on window MDI HWND hWndClient = (HWND)GetWindowLongPtr (hWndFrame, CLIENTWND); - switch (LOWORD(wParam)) + switch (wMsg) { case IDM_WINDOW_NEXT : if(hWndClient) @@ -122,8 +123,8 @@ BOOL CommandProc(HWND hWndFrame, WPARAM wParam, LPARAM /*lParam*/) DestroyProc(hWndFrame); break; - } - return(TRUE); + } + return(0l); } diff --git a/src/Draw/init.cxx b/src/Draw/init.cxx index aea8e87d9d..b61919814b 100644 --- a/src/Draw/init.cxx +++ b/src/Draw/init.cxx @@ -76,8 +76,7 @@ BOOL RegisterAppClass(HINSTANCE hInstance) // Enregistrement de la fenetre CommandWindow //------ - wndClass.lpfnWndProc = (WNDPROC)CommandProc((HWND)WndProc,(WPARAM)342,(LPARAM)443); - //wndClass.lpfnWndProc = (WNDPROC)CommandProc; + wndClass.lpfnWndProc = (WNDPROC)CmdProc; wndClass.hIcon = 0; wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wndClass.lpszMenuName = NULL;