Thursday, February 6, 2014

Spying Windows Messages During Application/Dialog Startup

The traditional way of spying Windows Messages is to use Spy++. There are some other third-party tools are also available like WinSpector. But neither these tools are useful if we want to monitor the messages during dialog startup. Do not worry, we have Visual studio. Just follow below steps to achieve it.
1. Implement WindowProc() for the window you want to monitor and  just invoke base class WindowPorc().
2. Put a break point inside WindowProc().
3. Right-Click on break point and select “Actions”.

4. Add {message,wm} to "Log a message to Output Window".
5. Press F5 to debug and the messages can be viewed in Output Window.

No comments:

Post a Comment

Keep an eye on your Native API prototype for interop calls

Few weeks back, we have observed "an unexpected process termination" crash in a WPF app. From the crash dump, provides below calls...