🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Running app on another desktop

#7148
From: Daniel
Date: Tue, 08 Mar 2005 04:15
43 lines
2423 bytes
> Try having the spawned process call  SetConsoleCtrlHandler() to receive
> CTRL_LOGOFF_EVENT and CTRL_SHUTDOWN_EVENT notifications.
>
>
> Gambit
>
Thank you for your reply.

I understand that I can trap the CTRL_LOGOFF_EVENT and/or the  
CTRL_SHUTDOWN_EVENT, but is it possible at this stage to stop the log off  
and/or the shutdown from taking place? as I may have misunderstood the  
HandlerRoutine I read at  
http://msdn.microsoft.com/library/en-us/dllproc/base/handlerroutine.asp,  
as it appears that all you can do is clean up prior to the event taking  
place, that is the log off or shutdown.

They say:

"The CTRL_LOGOFF_EVENT, and CTRL_SHUTDOWN_EVENT signals give the process  
an opportunity to clean up before termination. A HandlerRoutine can  
perform any necessary cleanup, then take one of the following actions:

(1) Call the ExitProcess function to terminate the process.
(2) Return FALSE. If none of the registered handler functions returns  
TRUE, the default handler terminates the process.

Once more thank you for the help

danieL.
Technical Details
Message-ID: <opsnawsj0royenhq@development-ws2.comvision.intranet>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!38.144.126.100.MISMATCH!feed5.newsreader.com!newsreader.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <opsm8p981moyenhq@development-ws2.comvision.intranet> <opsm8qztq7oyenhq@development-ws2.comvision.intranet> <422bf3a4$3@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a1b849e29d6cf9bc
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 08 Mar 2005 15:15:45 +1100
Subject: Re: Running app on another desktop
Newsgroups: borland.public.cppbuilder.nativeapi
Reply-To: d.jimenez@comvision.net.au
References: <opsm8p981moyenhq@development-ws2.comvision.intranet> <opsm8qztq7oyenhq@development-ws2.comvision.intranet> <422bf3a4$3@newsgroups.borland.com>
From: Daniel <d.jimenez@comvision.net.au>
Organization: Comvision Pty Ltd
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
MIME-Version: 1.0
Content-Transfer-Encoding: Quoted-Printable
Message-ID: <opsnawsj0royenhq@development-ws2.comvision.intranet>
User-Agent: Opera M2/7.54 (Win32, build 3929)
NNTP-Posting-Host: 60.229.104.14
X-Trace: newsgroups.borland.com 1110255386 60.229.104.14 (7 Mar 2005 20:16:26 -0800)
Lines: 43
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!38.144.126.100.MISMATCH!feed5.newsreader.com!newsreader.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail