Use an extra bit in the button status byte to flag whether the DefButtonWndProc should process the WM_LBUTTONUP message.