🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
4 messages
4 total messages Started by Renan Fri, 21 Jul 2006 11:52
shutdown computer
#3322
Author: Renan
Date: Fri, 21 Jul 2006 11:52
5 lines
835 bytes
How do I shutdown the computer? (Don't know if it is the right place to post it)

Windows 95 and 98
Renan
Re: shutdown computer
#3323
Author: SF
Date: Fri, 21 Jul 2006 12:04
8 lines
1041 bytes
> How do I shutdown the computer? (Don't know if it is the right 
> place to post it)
>
> Windows 95 and 98

Have a look at ExitWindowsEx.

Stefano. 
Re: shutdown computer
#3324
Author: Mike Collins
Date: Fri, 21 Jul 2006 12:08
34 lines
2155 bytes
It's an API question so, yes - right newsgroup.

Generally for shutting down or restarting a Windows machine you would use 
InitiateSystemShutdown / Ex although i don't think it is compatible with Win 
95 / 98 - MSDN only references Windows 2000 and above.

There is an older api, ExitWindowsEx that should work with 95 / 98.  It 
receives a flag to indicate what 'shutdown' action you want and a reason 
code to indicate why you are shutting down.

bool ExitWindowsEx(UINT uFlag, DWORD dwReason);

the flags for shutting down would be either EWX_SHUTDOWN or EWX_POWEROFF. 
If your code is going to be run on Win2k+ machines as well then you may need 
to adjust the privileges as well.  This is try of InitiateSystemShutdown / 
Ex so i assume it must be true with this api.

See 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shutdown/base/how_to_shut_down_the_system.asp 
for more info...

HTH

Mike C


"Renan" <gulbrrs@gmail.com> wrote in message 
news:44c0bfe7$1@newsgroups.borland.com...
>
> How do I shutdown the computer? (Don't know if it is the right place to 
> post it)
>
> Windows 95 and 98
> Renan 
Re: shutdown computer
#3325
Author: Renan
Date: Fri, 21 Jul 2006 12:57
21 lines
1436 bytes
That should do the job. I will try it. 

Thanks

Renan

>bool ExitWindowsEx(UINT uFlag, DWORD dwReason);
>
>the flags for shutting down would be either EWX_SHUTDOWN or EWX_POWEROFF. 
>If your code is going to be run on Win2k+ machines as well then you may need 
>to adjust the privileges as well.  This is try of InitiateSystemShutdown / 
>Ex so i assume it must be true with this api.
>
>See 
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shutdown/base/how_to_shut_down_the_system.asp 
>for more info...
>
>HTH
>
>Mike C
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads