I am using a simple form generated by VS 2010 which contains 2 buttons, start and stop. Start starts WH_MOUSE_LL with SetWindowsHookEx and stops the stop. The hook works fine, and I'm trying to "replace" the middle mouse button with a double click, the only problem I have is to click the "Minimize" / "Maximize / Close" buttons of the form, it seems that there is some kind of "event race" between the hook and the events triggered by the buttons mentioned above. It reflects the fact that when you press one of these buttons, it continues to βpressβ for a while until it completes the action (for example, minimizes it). When I right-click on a form and select one of these actions, it will immediately respond when I stop the hook and press one of the buttons mentioned above. Has anyone encountered this behavior?
source share