Windows Message Source Help
This page describes how to use the Windows Message Source Spy. The executable can be found on the software page.
This program inserts hooks into your program to monitor the functions that send and post messages to the Windows message queue.
To use the program, you need to link MessageSourceDLL.DLL to your program and call two functions in the DLL. The first function initialises the DLL for use, the second function closes the DLL.
When the DLL is initialised, the DLL displays a window that indicates which function has been called, what the arguments to the function were, and what the callstack was for the function call. If your application's message queue is being flooded, you should be able to identify the sending function that is causing the message queue flood. For WM_PAINT messages, you will not see any callstacks (see MSDN for the reason).
If you wish to disable or enable some hooks, you can use the hooks dialog. By default, all hooks are enabled.
Suitable places for adding the DLL initialisation/shutdown calls are in InitInstance() and ExitInstance() of your application. As shown below.
#include "messageSourceDLL.h"
...
BOOL CMessageSourceExampleApp::InitInstance()
{
...
initMessageSourceDLL();
return TRUE;
}
int CMessageSourceExampleApp::ExitInstance()
{
shutdownMessageSourceDLL();
return CWinApp::ExitInstance();
}
An example program that uses the DLL can be found is message source exmaple. You will also need to download the DLL and LIB file.
Download the DLL and LIB file.
Object Media will not be held responsible for any loss incurred by using this program. You use this program at your own risk.
Last Updated 7 February, 2008.

