mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2025-05-10 00:29:22 +08:00
36 lines
897 B
C
36 lines
897 B
C
|
|
/*
|
|
* This example trys to handle the event when the user presses
|
|
* left button and right button of the mouse at the same time.
|
|
*/
|
|
LRESULT MyWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|
{
|
|
switch (message) {
|
|
case MSG_LBUTTONDOWN:
|
|
if (wParam & KS_RIGHTBUTTON) {
|
|
// Left button and right button both are pressed.
|
|
break;
|
|
}
|
|
break;
|
|
|
|
case MSG_RBUTTONDOWN:
|
|
if (wParam & KS_LEFTBUTTON) {
|
|
// Left button and right button both are pressed.
|
|
break;
|
|
}
|
|
break;
|
|
|
|
case MSG_MOUSEMOVE:
|
|
if (wParam & KS_CTRL) {
|
|
// User moves the mouse as the <Ctrl> key is down.
|
|
break;
|
|
}
|
|
break;
|
|
|
|
...
|
|
}
|
|
|
|
return DefaultMainWinProc (hWnd, message, wParam, lParam);
|
|
}
|
|
|