{"id":189,"date":"2004-05-30T21:13:17","date_gmt":"2004-05-30T13:13:17","guid":{"rendered":"http:\/\/foxpro.ntsl119.com\/scr\/?p=189"},"modified":"2007-11-20T03:27:58","modified_gmt":"2007-11-19T19:27:58","slug":"workblogs-api-shutdown-and-maps-2","status":"publish","type":"post","link":"https:\/\/foxpro.ntsl119.com\/scr\/archives\/189","title":{"rendered":"workBLOGS . API shutdown and maps"},"content":{"rendered":"<p>This is the Windows <font face=\"Tahoma, Verdana\">98<\/font>SE-compatible snippet I use for shutting down the CPU.<\/p>\n<blockquote><p><font face=\"Tahoma, Verdana\"><b>procedure SYSTEMSHUTDOWN<\/b><\/p>\n<p>\t#define EWX_LOGOFF        0 <br \/>\n\t#define EWX_SHUTDOWN      1 <br \/>\n\t#define EWX_REBOOT        2 <br \/>\n\t#define EWX_FORCE         4 <br \/>\n\t#define EWX_POWEROFF      8 <br \/>\n\t#define EWX_FORCEIFHUNG  16 <br \/>\n\tdeclare integer ExitWindows IN user32; <br \/>\n\t\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdinteger dwReserved, integer uReturnCode <br \/>\n\tdeclare integer ExitWindowsEx IN user32; <br \/>\n\t\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdinteger uFlags, integer dwReserved <\/p>\n<p>\t&#8216; = ExitWindowsEx(EWX_LOGOFF, 0) <br \/>\n\t&#8216; = ExitWindowsEx(EWX_REBOOT, 0) <br \/>\n\t= ExitWindowsEX(EWX_SHUTDOWN, 0)<\/p>\n<p><b>EndProc<\/b><\/p>\n<p>Note: The html CGIs i&#8217;m using auto eliminates * so i&#8217;m replacing it with &#8216;.<\/font><\/p><\/blockquote>\n<p>There&#8217;s a better one which can shutdown Windows XP and Windows 2000 and do a lot more &#8216;cleaning up&#8217; procedures.  I&#8217;ll post that one later once I figure out to whom I can give credits for that code.  <\/p>\n<p>One of the issues yesterday involves this &#8216;automatic&#8217; 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 &#8216;there are n users connecting to this computer&#8230; shutting down will make them whine and howl&#8230;&#8217; type of error.  For a moment there which lasted for <font face=\"Tahoma, Verdana\">10<\/font> minutes or even more, I was formulating solutions and knocking once again on the doors of WinAPI, hoping that there&#8217;s a way I could somehow supress that confirmation.<\/p>\n<p>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.<\/p>\n<p>Yeah&#8230; sometimes the best solution to a problem are those little simple things we often overlook.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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; \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdinteger dwReserved, integer uReturnCode declare integer ExitWindowsEx IN user32; \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdinteger uFlags, integer dwReserved &#8216; = ExitWindowsEx(EWX_LOGOFF, 0) [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,10],"tags":[],"class_list":["post-189","post","type-post","status-publish","format-standard","hentry","category-visual-foxpro","category-workblog"],"_links":{"self":[{"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/posts\/189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/comments?post=189"}],"version-history":[{"count":0,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/posts\/189\/revisions"}],"wp:attachment":[{"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/media?parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/categories?post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/foxpro.ntsl119.com\/scr\/wp-json\/wp\/v2\/tags?post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}