{"id":1368,"date":"2012-06-12T18:25:38","date_gmt":"2012-06-12T23:25:38","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=1368"},"modified":"2021-03-11T12:18:09","modified_gmt":"2021-03-11T17:18:09","slug":"powerbuilder-timing-out-a-windows-session","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-timing-out-a-windows-session\/","title":{"rendered":"PowerBuilder &#8211; Timing Out a Windows Session"},"content":{"rendered":"<p>There are a variety of techniques to locking or timing out an application after a certain amount of inactivity.  With earlier versions of Windows (XP and prior) a common approach was to invoke the screen saver via a Send command.<\/p>\n<pre name=\"code\" class=\"VB\">send(handle(This),274,61760,0)<\/pre>\n<p>This doesn&#8217;t work with Windows 7 (or Vista).  Try the following:<\/p>\n<pre name=\"code\" class=\"VB\">integer li_rc\nOleObject lole_wsh\n\nlole_wsh = CREATE OleObject\nli_rc = lole_wsh.ConnectToNewObject ( &quot;WScript.Shell&quot; )\nIF li_rc &gt; 0 THEN\n   lole_wsh.Run (&quot;rundll32.exe user32.dll,LockWorkStation&quot;)\n   lole_wsh.DisconnectObject()\nEND IF<\/pre>\n<p>This can be used in Windows XP as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are a variety of techniques to locking or timing out an application after a certain amount of inactivity. With earlier versions of Windows (XP and prior) a common approach was to invoke the screen saver via a Send command. send(handle(This),274,61760,0) This doesn&#8217;t work with Windows 7 (or Vista). Try the following: integer li_rc OleObject&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,10],"tags":[12,13,16],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1368"}],"collection":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/comments?post=1368"}],"version-history":[{"count":4,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1368\/revisions"}],"predecessor-version":[{"id":2036,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1368\/revisions\/2036"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=1368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=1368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=1368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}