I have a question about WM_COMMAND.
Is it possible to change a variable xin case branches for WM_COMMANDto get this new value in case branches for WM_LBUTTONDOWN? I always get 0into branches WM_LBUTTONDOWNand 1into branches WM_COMMAND.
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int x = 0;
switch (message)
{
case WM_CREATE:
break;
case WM_COMMAND:
x = 1;
cout << x;
break;
case WM_LBUTTONDOWN:
cout << x;
break;
case WM_DESTROY:
PostQuitMessage (0);
break;
default:
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
Sekru source
share