Article View: borland.public.cppbuilder.nativeapi
Article #15288Re: Rebooting the Machine, part 2
From: Hugo Oliveira Dias
Date: Tue, 15 Jul 2003 16:29
Date: Tue, 15 Jul 2003 16:29
49 lines
2240 bytes
2240 bytes
On Windows NT based systems (NT4,W2K,Windows XP) you must
enable the SE_SHUTDOWN_NAME previlege for the process.
Look for "Shutting Down" in Win32 Programming Reference Index.
There you have the code for setting the previlege.
At the end where you have :
if (!ExitWindowsEx(EWX_SHUTDOWN | EWX_FORCE, 0))
error("ExitWindowsEx");
just replace for :
if (!ExitWindowsEx(EWX_REBOOT | EWX_FORCE, 0))
error("ExitWindowsEx");
if you can find it, post a message, i'll give you the code
Regards,
Hugo Oliveira Dias
"James A Beggs" <jbeggs@aqha.org> wrote:
>I'm trying to reboot the machine, where it powers down and back up,
>completely from scratch.
>
>I've been using ExitWindowsEx(EWX_REBOOT | EXWFORCE, 0);
>
>However, I noticed that, at least on my laptop, this did nothing. So, I
>rewrote it as:
>
>if (!ExitWindowsEx(EWX_REBOOT | EXWFORCE, 0))
> ExitWindowsEx(EWX_REBOOT & EWXFORCE, 0);
>
>The & worked, sort of, on my laptop. It logged me out of windows. And
>exiting windows is fine, I guess, but I actually need a full reboot. How
>would I do that instead?
>
>
>Thanks!
>
>--
>James A Beggs
>Manager of Product Development
>American Quarter Horse Association
>
>
Technical Details
Message-ID:
<3f142be4$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-05!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f142280$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,27d0bd8ec98fa3f5 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-15 09:44:03 PST From: "Hugo Oliveira Dias" <hugo.dias@no-spam.pluricanal.net> Sender: "Hugo Oliveira Dias" <hugo.dias@no-spam.pluricanal.net> Reply-To: "Hugo Oliveira Dias" <hugo.dias@no-spam.pluricanal.net> Subject: Re: Rebooting the Machine, part 2 Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 213.58.167.9 213.58.167.9 References: <3f142280$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.65 Message-ID: <3f142be4$1@newsgroups.borland.com> Date: 15 Jul 2003 09:29:24 -0700 X-Trace: newsgroups.borland.com 1058286564 207.105.83.65 (15 Jul 2003 09:29:24 -0700) Lines: 50 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-05!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail