Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding missing mouse clicks

I am working with a C# WinForms application which I'm not very familiar with. The control is intended to be draggable, and indeed it is draggable if the user starts the drag in parts of the control, but not in others.

The control contains several child controls, and it's my belief that some of these child controls are capturing the mouse clicks before the parent control sees them, hence the failure in certain areas. I have confirmed in the debugger that the mouse-down handler for the parent is only invoked when the user clicks on particular child controls.

Given I know the clicks are being captured/suppressed before they get to my handler, is there a way in the debugger (or otherwise) to determine where the clicks ARE going? Staring at the code has not been successful because I don't know where to start.

like image 891
Stefan Avatar asked Sep 16 '26 02:09

Stefan


1 Answers

Bundled with Visual Studio comes a niftly little program called Spy++. It allows you to log all messages being sent to windows, and shows you the 'real' structure of Win32 controls within your window (many controls are not actually controls but just custom painted screen areas). You should be able, with some inspection, to find the culprit with the message log.

like image 78
Niels Keurentjes Avatar answered Sep 18 '26 17:09

Niels Keurentjes