I think what's happening is you might be moving the mouse and clicking at the same time (unbeknownst to you). According to MOUSE_EVENT_RECORD, a MOUSE_MOVED (0x0001) + DOUBLE_CLICK (0x0002) = 0x0003, so it adds up the event codes into pme->dwEventFlags and never goes into your switch case. My suggestion would be to remove your switch and keep just the if ( pme->dwButtonState & FROM_LEFT_1ST_BUTTON_PRESSED ) check.