CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2007
    Location
    Denmark
    Posts
    623

    [RESOLVED] Problem with hidden app

    Hi guys,

    I recently made an application which is hidden most of the time, during which it is represented by a tray-icon (NotifyIcon).
    The app runs well and users are happy. Right up until it's time to shut down the computer. XP users complain that the app will make shutdown of their machine impossible until the process is killed.
    I think this is because I have handled the main form's FormClosing event to allow a "close-to-tray" function. In Vista, this isn't a problem, but XP doesn't seem to handle it very well.

    My question to you: is there a way I can check whether the computer is shutting down from my FormClosing eventhandler?
    It's not a bug, it's a feature!

  2. #2
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487

    Re: Problem with hidden app

    Code:
    private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
      if (e.CloseReason == CloseReason.WindowsSjutDown) {
      }
    }
    Busy

  3. #3
    Join Date
    May 2007
    Location
    Denmark
    Posts
    623

    Re: Problem with hidden app

    I just found that solution in another forum too
    Resolved, thanks!
    It's not a bug, it's a feature!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured