Home » Archives » February 2004 » workBLOGS . API shutdown and maps

[ Previous entry: workBLOGS . API shutdown and maps ]
[ Next entry: *Repaired* ]
02/18/2004:

workBLOGS . API shutdown and maps


This is the Windows 98SE-compatible snippet I use for shutting down the CPU.

procedure SYSTEMSHUTDOWN

#define EWX_LOGOFF 0
#define EWX_SHUTDOWN 1
#define EWX_REBOOT 2
#define EWX_FORCE 4
#define EWX_POWEROFF 8
#define EWX_FORCEIFHUNG 16
declare integer ExitWindows IN user32;
          integer dwReserved, integer uReturnCode
declare integer ExitWindowsEx IN user32;
          integer uFlags, integer dwReserved

' = ExitWindowsEx(EWX_LOGOFF, 0)
' = ExitWindowsEx(EWX_REBOOT, 0)
= ExitWindowsEX(EWX_SHUTDOWN, 0)

EndProc

Note: The html CGIs i'm using auto eliminates * so i'm replacing it with '.


There's a better one which can shutdown Windows XP and Windows 2000 and do a lot more 'cleaning up' procedures. I'll post that one later once I figure out to whom I can give credits for that code.

One of the issues yesterday involves this 'automatic' shutting down of computers at a given time. There were no problems in the client computers but in the server module, which uses a mapped/shared virtually-created-drive approach, it shows this 'there are n users connecting to this computer... shutting down will make them whine and howl...' type of error. For a moment there which lasted for 10 minutes or even more, I was formulating solutions and knocking once again on the doors of WinAPI, hoping that there's a way I could somehow supress that confirmation.

Only to realize that I can make things easier if I set a different shutdown time for the server and make it do the shutdown process after all the client PCs are knocked out.

Yeah... sometimes the best solution to a problem are those little simple things we often overlook.


Disclaimers are for castrated EARTHLINGS.
Powered: GREYMatter | GM-RSS

 

 
 
 
 

 

foxpro.main
foxpro.archives
richardbase.home

articles
downloads
snippets
utilities
knowledgebase.links
website.links

outpost.forum
the.site
the.catalyst
pixelcatalyst.lair

rss.feeds

February 2004
SMTWTFS
1234567
891011121314
15161718192021
22232425262728
29      
September 2007
March 2007
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
February 2004
May 2004
April 2004
June 2004
April 2004
March 2004
February 2004





Darn aliens. THEY kept on rebooting this site's counter.