How to close (not kill) another application that does not have a visible window? (WITH#)

I have an installer in which I would like to make sure my application is currently not working. If so, I would like to close it (do not kill, since the application must save some data on exit). An additional problem is that my application window is hidden (tray icon is displayed), so Process.MainWindowHandle is always 0.

What can I do to apply for closing my application? Can I send a message directly to the application (and not to the window)?

Your help will be greatly appreciated. Gregor

+3
source share
4

- : .

+2

, APP1 , , . , APP2 APP1 .

- ( Windows - SQL Service Broker), APP ,

: http://msdn.microsoft.com/en-us/library/ms644950(VS.85).aspx

+1

, WINAPI ( ) . Windows , .

http://support.microsoft.com/kb/178893

+1
source

You can use the PostThreadMessage WinAPI function (via PInvoke).

0
source

Source: https://habr.com/ru/post/1766332/


All Articles