How to exit Window Service process in C #

I have two processes developed in C #.

One is a Windows service, the other is a regular Windows-based application.

What I intend to do is exit the application from the service,

I do not intend to kill him by force, which I can do. I want to get out of it gracefully.

Can I call the application_close function defined in my application through the service.

+3
source share
1 answer

Process.CloseMainWindow() - this is what you are looking for, I suppose.

http://msdn.microsoft.com/en-us/library/system.diagnostics.process.closemainwindow.aspx

. IPC, Windows, , , , , .

+3

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


All Articles