Close form

  • Thread starter Thread starter Phlics
  • Start date Start date
P

Phlics

Hi all,

How to know whether the operation system close my form(ALT-F4, system
shutdown) .

Thanks,
 
Hi,

There's a Closing event on the Form class, as well as a Closed event, as far
as I remember. System shutdown can also be handled by tapping into the
WndProc and handling the appropriate Windows notification
(WM_QUERYENDSESSION if my memory serves me well).
 
I think the Microsoft.Win32 has some managed wrappers for the Session
ending.
-mike
MVP

Dmitriy Lapshin said:
Hi,

There's a Closing event on the Form class, as well as a Closed event, as far
as I remember. System shutdown can also be handled by tapping into the
WndProc and handling the appropriate Windows notification
(WM_QUERYENDSESSION if my memory serves me well).

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Phlics said:
Hi all,

How to know whether the operation system close my form(ALT-F4, system
shutdown) .

Thanks,
 
Back
Top