Article View: borland.public.cppbuilder.nativeapi
Article #10633Re: WM_QUERYENDSESSION problems
From: Remy Lebeau (TeamB)
Date: Tue, 06 Apr 2004 02:29
Date: Tue, 06 Apr 2004 02:29
32 lines
2499 bytes
2499 bytes
"Brad" <bradhar@nospam.optusnet.com.au> wrote in message news:40720c60$1@newsgroups.borland.com... > This momentarily stops Windows from shutting down. EndSession > is a global bool. What I'm trying to do in WindowClose() is - after > having executing the code I wanted - see if EndSession = true, and > then call ExitWindows (or whatever) from there and then Windows > will continue to shutdown: Why do you need to delay shutdown? What are you doing that you can't perform at shutdown immediately? Besides, your code is not actually delaying shutdown very well anyway. The OnClose event is triggered from inside Close() directly, thus you are performing your shutdown code and exiting windows before even returning the 'false' reply to the original request. So you may as well just perform your shutdown code inside your message handler directly and not try to synchronize multple event handlers together. You are not gaining anything by doing so. > The problem is, EndSession is still false, even though I've tested that > it has been set to true in NewWindowWP() above (and WindowClose() > is called from there). The only way that can happen is if you did not update the correct variable to begin with. Given the code you have shown so far, you did not indicate whether EndSession is a true global standalone variable, or whether it is a member of the form class, or whether you may have other variables by the same name elsewhere. Please always post minimal code that actually compiles so that it can be tested if needed. Gambit
Technical Details
Message-ID:
<40721607$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsrout1.ntli.net!news.ntli.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40720c60$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,3d57c832ecbfbde9 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-04-05 19:39:30 PST From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <40720c60$1@newsgroups.borland.com> Subject: Re: WM_QUERYENDSESSION problems Date: Mon, 5 Apr 2004 19:29:36 -0700 Lines: 34 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 67.22.138.253 Message-ID: <40721607$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1081218567 67.22.138.253 (5 Apr 2004 19:29:27 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsrout1.ntli.net!news.ntli.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail