Righteous Wrath Online Community

General => Tech Chat => Topic started by: Thorin on October 25, 2010, 02:03:18 PM

Title: Send Windows Messages to Your App
Post by: Thorin on October 25, 2010, 02:03:18 PM
If you develop applications to run on Windows, you hopefully know that Windows is really just a giant looping message pump.  So how do you send Windows messages (WM_CLICK, WM_ENDSESSION, WM_LOSEFOCUS, etc) to your app to be able to test your code?

The developer of TortoiseSVN has made a tool called SendMessage that allows you to do exactly that:

http://tools.tortoisesvn.net/SendMessage

I especially like the example of WM_ENDSESSION, because this is supposed to cause your app to shut down properly but you wouldn't be able to debug it because Visual Studio (or whatever you use) would also be getting shut down.