Close form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Phlics

    Close form

    Hi all,

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

    Thanks,



  • Dmitriy Lapshin [C# / .NET MVP]

    #2
    Re: Close form

    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_QUERYENDSES SION if my memory serves me well).

    --
    Dmitriy Lapshin [C# / .NET MVP]
    X-Unity Test Studio

    Bring the power of unit testing to VS .NET IDE

    "Phlics" <phlics@hotmail .com> wrote in message
    news:uHEvNLCqDH A.3616@tk2msftn gp13.phx.gbl...[color=blue]
    > Hi all,
    >
    > How to know whether the operation system close my form(ALT-F4, system
    > shutdown) .
    >
    > Thanks,
    >
    >
    >[/color]

    Comment

    • Michael Giagnocavo [MVP]

      #3
      Re: Close form

      I think the Microsoft.Win32 has some managed wrappers for the Session
      ending.
      -mike
      MVP

      "Dmitriy Lapshin [C# / .NET MVP]" <x-code@no-spam-please.hotpop.c om> wrote
      in message news:eIWxLoEqDH A.1960@TK2MSFTN GP12.phx.gbl...[color=blue]
      > Hi,
      >
      > There's a Closing event on the Form class, as well as a Closed event, as[/color]
      far[color=blue]
      > as I remember. System shutdown can also be handled by tapping into the
      > WndProc and handling the appropriate Windows notification
      > (WM_QUERYENDSES SION 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" <phlics@hotmail .com> wrote in message
      > news:uHEvNLCqDH A.3616@tk2msftn gp13.phx.gbl...[color=green]
      > > Hi all,
      > >
      > > How to know whether the operation system close my form(ALT-F4, system
      > > shutdown) .
      > >
      > > Thanks,
      > >
      > >
      > >[/color]
      >[/color]


      Comment

      Working...