Your first post asked how to "detect Windows shutdown". My response answered
that. I just tried it out, and it worked (although I used session ending
vice session ended). I run my program, I try to shut down windows, and the
event fires. Your second post asks about minimizing. For that, you should
handle the form's resize event and check the form property WindowState. If
it is FormWindowState.Minimized, then the window is minimized.
Windows shutdown and minimizing a window are different things. What exactly
are you trying to detect?
"Adnan Hebibovic" wrote:
When the form is minimized to systray there is no Win32.SessionEnded event
....
Thanks
"AMercer" <AM*****@discussions.microsoft.com> wrote in message
news:AF**********************************@microsof t.com... Try handling the Microsoft.Win32.SessionEnded event.
"Adnan Hebibovic" wrote:
Hello developers
How can I detect Windows shutdown from .NET and I mean clean .NET not
catching the events with Win32 API ...
Thanks