🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

How to Ignore WM_QUERYENDSESSION

#961
From: Paul
Date: Thu, 22 Nov 2007 06:04
50 lines
2539 bytes
Hi 

I am trying to use the SRVANY utility provided by Microsoft. The
documentation states the following

<quote>
This file describes the SRVANY.EXE utility. This utility allows running
Windows NT� applications as services. The benefits include:
- allow apps to survive logoff/logon sequences, hence saving the
overhead of re-starting them for each new user
- allow server apps to come-up and service requests even when no user
is logged-on
- allow apps to run and perform a task in a specific logon account,
different from the currently logged-on user

NOTICES:
1. Some applications may terminate upon logoff, even though they were
started as a service, if they don't ignore the WM_ENDSESSION message
(or CTRL_LOGOFF_EVENT). See "Programming Considerations" below for more
details.
</quote>

and the Programming Considerations section says
<quote>
For WIN32 graphical applications: when the currently logged-in user is
logging-off, all WIN32 top-level windows receive WM_QUERYENDSESSION and
WM_ENDSESSION messages. Some WIN32 applications choose to terminate
upon receipt of such messages. In order for your WIN32 application to
survive logoff, it must not do that: instead, your windows procedure
should call the default windows procedure on these messages.
</quote>

I have tried using the BEGIN_MESSAGE_MAP and overing the WndProc
approach. Unless Message.Result is set to true when handling the
WM_QUERYENDSESSION message the session log off is terminated as
expected from the MS Documentation.

What I am missing is how to **ignore** this message and **call the
default windows procedure on these messages**

Any advice appreciated

thanks
paul





-- 
Technical Details
Message-ID: <474529f6@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,82d0c9e28c8f059,start
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII
From: "Paul" <paulm@xacom.com.au>
Subject: How to Ignore WM_QUERYENDSESSION
Newsgroups: borland.public.cppbuilder.nativeapi
User-Agent: XanaNews/1.18.1.6
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 203.5.1.209
Message-ID: <474529f6@newsgroups.borland.com>
Date: 21 Nov 2007 23:04:22 -0700
X-Trace: newsgroups.borland.com 1195715062 203.5.1.209 (21 Nov 2007 23:04:22 -0700)
Lines: 51
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail