System.Diagnostics.Process.CloseMainWindow(), WM_CLOSE, SC_CLOSE

T

temp20080330

My application runs minimized from a system tray and when
CloseMainWindow() is invoked the application does not get the close
request. When the applications displays a dialog box then
CloseMainWindow() works fine. In general this is not good since I can
not predict/force the application out of the system tray.

System.Diagnostics.Process.CloseMainWindow() is essentially a Native
Win32 SendMessage/PostMessage with WM_CLOSE

On the other hand if I use unmanaged code to call SendMessage with
SC_CLOSE, my application running minimized in the system tray gets the
request and closes gracefully.


My question what piece of the .NET framework will send SC_CLOSE?

TIA,

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top