Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 11-21-2002, 07:47 PM   #1
Member (10 bit)
 
Join Date: Jul 2002
Location: University of California, Santa Barbara
Posts: 800
Shutdown windows

Is there an API call I can use from c++ or another laguage to shut down windows?
mattg2k4 is offline   Reply With Quote
Old 11-21-2002, 08:57 PM   #2
Member (12 bit)
 
Paul Victorey's Avatar
 
Join Date: Mar 1999
Location: MN or WI
Posts: 3,017
Yeah, just call the API function ExitWindowsEx(UINT uFlags, DWORD dwReserved);

I assume you have win32.hlp (WinAPI programmer's reference) if you're asking about API calls, that has more detailed info on ExitWindowsEx.

In a NT/2K/XP version, you probably need to grant your process the ability to shut the computer down.

Last edited by Paul Victorey; 11-21-2002 at 08:59 PM.
Paul Victorey is offline   Reply With Quote
Old 11-21-2002, 10:00 PM   #3
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
See this article for using the ExitWindowsEx API with Windows NT/2K/XP.
doctorgonzo is offline   Reply With Quote
Old 11-21-2002, 10:54 PM   #4
Member (10 bit)
 
Join Date: Jul 2002
Location: University of California, Santa Barbara
Posts: 800
Thanks for the info guys.

This "win32.hlp," I'm not sure if I have it. Where would it be if I had it? Where can I get it if I don't?
mattg2k4 is offline   Reply With Quote
Old 11-21-2002, 11:07 PM   #5
Member (12 bit)
 
Paul Victorey's Avatar
 
Join Date: Mar 1999
Location: MN or WI
Posts: 3,017
Any compiler capable of making Windows code should include it, MS has it hidden on their site somewhere, too. It's free, about 12 MB in size. Do a file search on your harddrive for win32.hlp.

If you want me to email it (keeping in mind it's 12 MB) I can. Or if you have an FTP or such that you want me to upload it to, I will.

Edit: I think MS includes it with their platform SDK: http://www.microsoft.com/msdownload/...sdk/sdkupdate/ But that's probably much larger than 12 MB. If size is a problem, I can give you the 12 MB version. If it's for a short time, I should have enough webspace on an account of mine.

Last edited by Paul Victorey; 11-21-2002 at 11:17 PM.
Paul Victorey is offline   Reply With Quote
Old 11-22-2002, 06:07 PM   #6
Member (10 bit)
 
Join Date: Jul 2002
Location: University of California, Santa Barbara
Posts: 800
Thanks Paul, I've got Visual c++, but after a recent windows reinstall, I haven't put the c++ back on it yet.

I'll install it now, and see if it has it.
mattg2k4 is offline   Reply With Quote
Old 11-22-2002, 08:48 PM   #7
Member (10 bit)
 
Join Date: Jul 2002
Location: University of California, Santa Barbara
Posts: 800
My visual c++ doesn't have win32.hlp, its just the student edition.

My yahoo mail has a 6mb limit, and I'm currently having trouble getting my mail server to work (it sends, but doesn't recieve), so that wouldn't work out.

I could put an ftp server program on my server easily enough, maybe even by tonight. I'll get cracking on that.

Edit: I set up an ftp account for you on my server that you can upload to. I'll pm you the domain name, user name, and password Paul. Thanks!

Last edited by mattg2k4; 11-22-2002 at 10:05 PM.
mattg2k4 is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:26 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2