🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Shutdown signal

#12587
From: eric67
Date: Fri, 28 Nov 2003 16:19
21 lines
1821 bytes
I've been working on shutdown (logoff) in the last few days.

Windows sends (SendMessage) a WM_QUERYENDSESSION to your application.

This message is handled by your main form window procedure (you don't
need to do anything: TForm (the ancestor) does the job).
If you created on OnCloseQuery event it's called:
1) if you set CanClose=false your app will stop the whole logoff,
reboot procedure
2) if you set CanClose=true your app will receive a WM_ENDSESSION
message: the message handler must do the cleanup: it will call your
OnClose. A few milliseconds (after handler return) the app will be
killed.

I suggest you should check this mainform's functions:
OnCloseQuery
OnClose
MainForm destructor

Be sure you didn't write an OnDestroy event for MainForm (it's only
for ObjectPascal; you must not use it in c++)
Technical Details
Message-ID: <3fc775cf$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3fc5aaf0$1@newsgroups.borland.com> <3fc5cfe5$1@newsgroups.borland.com> <3fc60aeb@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,126fc3ba03e9bc88
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-11-28 08:39:35 PST
From: "eric67" <myfantasy@libero.it>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3fc5aaf0$1@newsgroups.borland.com> <3fc5cfe5$1@newsgroups.borland.com> <3fc60aeb@newsgroups.borland.com>
Subject: Re: Shutdown signal
Date: Fri, 28 Nov 2003 17:19:59 +0100
Lines: 23
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: 217.56.76.254
Message-ID: <3fc775cf$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1070036431 217.56.76.254 (28 Nov 2003 08:20:31 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail