Article View: borland.public.cppbuilder.nativeapi
Article #10354Re: Custom Shutdown
From: Malcolm Smith
Date: Tue, 20 Apr 2004 05:47
Date: Tue, 20 Apr 2004 05:47
81 lines
3091 bytes
3091 bytes
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 "Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote in message news:4084916b$1@newsgroups.borland.com... > > "Malcolm Smith" <m.smith@comvision.net.au> wrote in message > news:4084732e@newsgroups.borland.com... > > > how do I tell it which entry from the registry I want logged > > in the event viewer. > > By passing the actual custom codes as the reason when calling > ExitWindowsEx(), ie: > ... > ... > ... > As for the Registry, the only purpose of the Registry values is to set up > dialog flags and title/description information for the event loggers. When > you specify a reason code, ExitWindowsEx() decyphers what the specified > major and minor codes are and then looks up their cooresponding values in > the Registry for display/logging. > > > Gambit > >
Technical Details
Message-ID:
<4084b480$2@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4084732e@newsgroups.borland.com> <4084916b$1@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:39: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> Subject: Re: Custom Shutdown Date: Tue, 20 Apr 2004 15:47:34 +1000 Lines: 83 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: <4084b480$2@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1082438784 144.137.108.190 (19 Apr 2004 22:26:24 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail