CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2002
    Location
    Columbus, Ohio
    Posts
    117

    prompt for exit program

    my program prompts the user " Do you want to exit program?", which works fine except that it prompts when windows is closing. how do i test for windows closing to allow my program to exit without prompting. ( use to do it in query unload )

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125
    Set a flag in the explicit window close. Check the flag in QueryUnload....
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Nov 2002
    Location
    Columbus, Ohio
    Posts
    117
    you're thinking of vb6. this is net. there is no query unload. thanks anyway.

  4. #4
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878
    "Closing" is the event which is running when form is closing.
    Using the event arg e you can set e.Cancel = True
    if you wish to cancel closing.
    Iouri Boutchkine
    [email protected]

  5. #5
    Join Date
    Nov 2002
    Location
    Columbus, Ohio
    Posts
    117

    thats not what i asked

    thats not what i asked, i know how to use the e.cancel, what i want to know is how to test to see if my program is closing because the operating system is closing.

  6. #6
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

  7. #7
    Join Date
    Nov 2002
    Location
    Columbus, Ohio
    Posts
    117

    THANKS

    that was exactly what i wanted. thanks.

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