Skip to content
⌘ NSIS Forum Archive

sending messages to other windows

7 posts

phealy#

sending messages to other windows

I need to be able to send another app a message to make it quit, but all my efforts with FindWindow and SendMessage have failed. I'm including WinMessages.nsh, and it does find the handle, and it returns from that call, but the other app doesn't seem to receive the message.

Thanks.
kichik#



Every application handles messages in his own way. If you have tried the basic WM_CLOSE and WM_DESTROY and they both didn't work you will have to ask the application author how to close it using messages. WM_CLOSE and WM_DESTROY are a guess in this case, there is no safe generic way to make an application quit (you can always use TerminateProcess but that's very unsafe).
phealy#
sorry, didn't make myself clear. I'm not sure on the syntax for FindWindow and SendMessage. If you could do me a favor and gimme an example, i'd greatly appreciate it.

thanks.
kichik#
There is a good example in here:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
virtlink#
KiCHiK, that piece of code you pointed to is not yet in the archive. Someone should add it since I'm sure that someone needs this code in the future again.
Sunjammer#
VirtLink, you could add such a page to the archive yourself, save KiCHiK having to do everything 🙂