4,561 Software Downloads

SendMessage 1.1.4 (32-bit)

SendMessage is a tool for sending Windows messages to any window. It's oriented very much at developers, but has applications for regular PC users, too (so if that's you, skip the next paragraph).

If you're a developer, then the program makes it easy to test how your application responds to a particular message - WM_ENDSESSION, say - without affecting anything else. There's a list of common messages built in, or you can specify another; you can enter WPARAM or LPARAM values; then choose your target window from a list, click "SendMessage" and watch the results.

What you can also do, though, is automate the process by passing parameters from the command line, and that has all kinds of possibilities. It can crash your system if you send the wrong message, so save your work first, but then try this example.

SendMessage.exe /message:16 /processname:cmd.exe

Message 16 is "WM_CLOSE", and so this one command will close every open command window on your system. Replace "cmd.exe" with some other executable name and it'll close that, instead.

You can also close windows by their title, like so:

SendMessage.exe /message:16 /windowtitle:"Untitled - Notepad"

That command will close every open Notepad window where you haven't opened or saved a file. (Or it'll try, anyway - if there's unsaved text then you'll be warned, first.)

If you just want to shut down programs from a shortcut then there are easier ways to do it, of course - the Windows TaskKill command in particular. But the whole point of SendMessage is it can handle any Windows message, which gives it all kinds of possibilities.

To minimize a window, say, try this.

SendMessage.exe /message:274 /windowtitle:"Untitled - Notepad" /wparam:61472

To maximize it, use this.

SendMessage.exe /message:274 /windowtitle:"Untitled - Notepad" /wparam:61488

You can even simulate clicks in an application. The following will click the Play/ Pause button in Windows Media Player.

SendMessage.exe /message:273 /windowtitle:"Windows Media Player" /wparam:32808 /lparam:0

Okay, that might not be something you want to automate right now, but it is a good example of the possibilities.

If you want to know more, then the documentation for scripting tools like AutoHotKey can provide some clues.

Be very careful, though. Sending the wrong messages could make an application behave oddly, or perhaps crash your system. Don't experiment while you've unsaved work.
 

Platforms: Windows 7 (32 bit), Windows 8, Windows Vista (32 bit), Windows XP
Version: 1.1.4
Licence: Open Source
Manufacturer: Stefan Kueng
Date Added: {ts '2013-09-10 13:53:00'}

Send to a friend

Email this article to a friend or colleague:


PLEASE NOTE: Your name is used only to let the recipient know who sent the story. Both your name and the recipient's name and address will not be used for any other purpose.


IDG UK Sites

Nexus 4 selling out and Nexus 5 spotted in bar

IDG UK Sites

15 October Apple event: iPad 5, iPad mini 2, Haswell-powered iMac, Mac mini, MacBook Pro coming?

IDG UK Sites

Windows 8 smartwatch: what you need to know about the Surface smartwatc

IDG UK Sites

Reasons to be Creative organiser reflects on why the best talks are about passion

* *