🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Custom Shutdown

#10355
From: Malcolm Smith
Date: Tue, 20 Apr 2004 06:08
75 lines
3049 bytes
I just realized the text was truncated on my print out - from MSDN it has
this:

You can also define your own shutdown reasons and add them to the registry.
Each reason code should be stored as a registry value in the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability\Use
rDefined\<default_system_language_ID>

I'll retry with <default_system_language_ID> added to my key.

-- 
Malcolm Smith
MJ Freelancing
http://www.mjfreelancing.com



"Malcolm Smith" <m.smith@comvision.net.au> wrote in message
news:4084b480$2@newsgroups.borland.com...
> This still isn't working:
>
> Just for the benefit of others, the windows defines are already <<24 so
> this:
>
> >     #define MAKE_REASON_FLAGS(flags) \
> >         (((DWORD)((BYTE)(flags))) << 24)
> >
>
> is not required and this is corrected:
>
> >
> >     #define MAKE_REASON_CODE(flags, major, minor)    \
> >         (flags | \
> >         MAKE_REASON_MAJOR(major) | \
> >         MAKE_REASON_MINOR(minor))
>
> Now, I've traced my code and have captured these values being sent to
> ExitWindowsEx(Flags, Reason) where:
>
> Flags = 2 (Reboot)
> Reason = 3225419776 (C040000000)
>
>
> Where C0 = a combination of the values:
>
>   #define SHTDN_REASON_FLAG_USER_DEFINED  0x40000000
>   #define SHTDN_REASON_FLAG_PLANNED            0x80000000
>
> and 4000000 = 64 for the major ID and 0 for the minor ID
>
> The event log shows a reboot with minor ID 0x00 but I didn't get the
dialog
> showing as expected.
>
> I've checked my registry and I definitely have this defined:
>
> PCS;64;0
>
> The only other thing is whether the registry location is correct.  I'm
> using:
>
>
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability\Use
> rDefined
>
>
> Is the locale information required ?
>
> Any other ideas ?
>
> -- 
> Malcolm Smith
> MJ Freelancing
> http://www.mjfreelancing.com
>
Technical Details
Message-ID: <4084b95d@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!border1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4084732e@newsgroups.borland.com> <4084916b$1@newsgroups.borland.com> <4084b480$2@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,362cd189c238eed0
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-04-19 22:54:27 PST
Reply-To: "Malcolm Smith" <m.smith@comvision.net.au>
From: "Malcolm Smith" <m.smith@comvision.net.au>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4084732e@newsgroups.borland.com> <4084916b$1@newsgroups.borland.com> <4084b480$2@newsgroups.borland.com>
Subject: Re: Custom Shutdown
Date: Tue, 20 Apr 2004 16:08:18 +1000
Lines: 77
Organization: Comvision Pty Ltd
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 144.137.108.190
Message-ID: <4084b95d@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1082440029 144.137.108.190 (19 Apr 2004 22:47:09 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!border1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail