| Author | Message |
|---|---|
| np_123 |
Post Posted: Sat Jan 27, 2018 6:44 pm Post subject: Wait for mouse button press (outside of callback)
|
| I create a window and the below code is the callback for it.
What I'm looking for is a way to wait for those events to happen, using the callback essentially as a trigger. But doing something like toggling a boolean variable and having a loop waiting for it would cause the UI to hang as it's event-driven. Any suggestions? C: LRESULT CALLBACK WndProc( HWND hWnd, // Handle For This Window UINT uMsg, // Message For This Window WPARAM wParam, // Additional Message Information LPARAM lParam) // Additional Message Information { switch (uMsg) { case (WM_LBUTTONDOWN | WM_RBUTTONDOWN): // | WM_LBUTTONUP | WM_RBUTTONUP): Cursor.X = GET_X_LPARAM(lParam); Cursor.Y = GET_Y_LPARAM(lParam); Cursor.buttonmask = wParam; break; case WM_MOUSEMOVE: Cursor.X = GET_X_LPARAM(lParam); Cursor.Y = GET_Y_LPARAM(lParam); break; case WM_CLOSE: MIOGLGraph_CloseWin(); stGLWinClosed = TRUE; return 0; } // Pass All Unhandled Messages To DefWindowProc return DefWindowProc(hWnd,uMsg,wParam,lParam); } |
|