{"id":64,"date":"2007-05-11T21:21:22","date_gmt":"2007-05-11T19:21:22","guid":{"rendered":" http:\/\/www.nsonic.de\/blog\/2007\/05\/environment-setsystempowerstate\/"},"modified":"2007-05-11T21:21:23","modified_gmt":"2007-05-11T19:21:23","slug":"environment-setsystempowerstate","status":"publish","type":"post","link":"https:\/\/www.nsonic.de\/blog\/2007\/05\/environment-setsystempowerstate\/","title":{"rendered":"Environment: SetSystemPowerState"},"content":{"rendered":"<p><em>This isn&#8217;t a question, it&#8217;s a tip!!<br \/>\nI&#8217;ve recently discovered a fancy, but most of the time useless,<br \/>\nAPI-function called<br \/>\nSetSystemPowerState, wich can be used to bring the system into<br \/>\npowersave-mode<br \/>\n<\/em><br \/>\nUse it like this:<br \/>\n[code lang=&#8221;delphi&#8221;]SetSystemPowerState(False, True); \/\/Forces the system down<\/p>\n<p>\/\/or<\/p>\n<p>SetSystemPowerState(True, False); \/\/Makes a &#8220;soft&#8221; off<br \/>\n[\/code]<br \/>\nI didn&#8217;t really have any use of this, but it seems like many people asks<br \/>\nhow to shutdown the system, so this is maybe a function for them???<\/p>\n<p>I can think of another senario when this feature maybe useful:<br \/>\nA systemadministrator can make a program wich will be distubuted on all<br \/>\ncomputers in the system, and at the end of the day, lets say 8PM, every<br \/>\ncomputer goes into suspendmode and when the user comes back to work at<br \/>\n9AM all they have to do is to move the mouse and they can start working<br \/>\nwhere they left yesterday&#8230;<\/p>\n<p>Have fun <span class=\"wp-smiley emoji emoji-wink\" title=\";-)\">wink<\/span> <\/p>\n<p>&#8212;<br \/>\nDaniel Ivarsson<br \/>\nsol24@algonet.se<br \/>\nhttp:\/\/www.algonet.se\/~sol24\/Delphi\/<\/p>\n<p>[tags]Delphi, API[\/tags]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This isn&#8217;t a question, it&#8217;s a tip!! I&#8217;ve recently discovered a fancy, but most of the time useless, API-function called SetSystemPowerState, wich can&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[11],"tags":[84,75],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p71Tml-12","_links":{"self":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/64"}],"collection":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/comments?post=64"}],"version-history":[{"count":0,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/64\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/media?parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/categories?post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/tags?post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}