Archive: sending messages to other windows


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.



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).


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.


There is a good example in here:
http://forums.winamp.com/showthread....ow+SendMessage


thanks, this worked perfectly. :D
I was able to put them in with no problem.


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.


VirtLink, you could add such a page to the archive yourself, save KiCHiK having to do everything :)