🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #5801

Re: Detecting windows shudtown.

#5801
From: qyte
Date: Sun, 03 Jul 2005 11:12
46 lines
2147 bytes
Remy Lebeau (TeamB) wrote:
> "qyte" <gyte@vivodinet.gr> wrote in message
> news:42c5edce$1@newsgroups.borland.com...
> 
> 
>>I have intercepted it using the WndProc of the main form
>>but nothing happens. is there something wrong with that?
> 
> 
> Please be more specific.  What does the code actually look like?  What do
> you mean by "nothing happens" exactly?
> 
> 
> Gambit
> 
> 

for example (i have tried both).
void __fastcall TForm1::WndProc(TMessage &Message)
{
	if(Message.Msg==WM_QUERYENDSESSION)
	{
		Application->Terminate();
		Message.Result=true;
	}
	else
		TForm::WndProc(Message);
}


void __fastcall TForm1::AppOnMessage(TMsg &Msg, bool &Handled)
{
	if(Msg.Message==WM_QUERYENDSESSION)
	{
		Application->Terminate();
		Handled=true;
	}
	else
		Handled=false;
}

When i try to shutdown my computer it doesn't shut down
untill after i have closed my application mannually.
At the moment i have removed the two functions above.
The thing is the in OnClose event of Form1 i minimize it to tray.
What do you think maybe the problem?
Technical Details
Message-ID: <42c7c82b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <42c4f6c9$1@newsgroups.borland.com> <42c50d9b$2@newsgroups.borland.com> <42c5edce$1@newsgroups.borland.com> <42c77b3f$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6f249ce41ad1dc44
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Sun, 03 Jul 2005 14:12:40 +0300
From: qyte <gyte@vivodinet.gr>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Detecting windows shudtown.
References: <42c4f6c9$1@newsgroups.borland.com> <42c50d9b$2@newsgroups.borland.com> <42c5edce$1@newsgroups.borland.com> <42c77b3f$1@newsgroups.borland.com>
In-Reply-To: <42c77b3f$1@newsgroups.borland.com>
Content-Type: text/plain; charset=windows-1253; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 83.171.210.195
Message-ID: <42c7c82b@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1120389163 83.171.210.195 (3 Jul 2005 04:12:43 -0700)
Lines: 46
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail