Guest Skleroz Posted October 27, 2004 Share Posted October 27, 2004 Hi, All ! Can anybody help me to find out, how I can check if conputer is locked or unlocked? I do need to pause some app while computer is locked, and let it go when unlocked. Thanks in advance, Dmitry Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted October 27, 2004 Share Posted October 27, 2004 You can check if the unlock windows is active using WinWatActive. Pausing the application is going to be the hard part of that script. *** Matt @ MPCS Link to comment Share on other sites More sharing options...
Guest Skleroz Posted October 27, 2004 Share Posted October 27, 2004 I can't find out this window attributes, because computer is locked. Visible window title does not work in my tryouts Link to comment Share on other sites More sharing options...
sPeziFisH Posted October 27, 2004 Share Posted October 27, 2004 (edited) So when the app is running while the computer is locked, try WinGetTitle("") to get the title of the current active window, write each different WinGetTitle("") to a file. Here's some code I made just to check out some things : expandcollapse popupOpt("TrayIconHide", 0) Opt("WinWaitDelay", 1) $folder = @ScriptDir&"\log\" $folder = StringReplace ($folder, "\\", "\" ) $filename = $folder &"\"& @MDAY &"_"& @MON &"_"& @YEAR &" session " $filename = StringReplace ($filename, "\\", "\" ) $i = 1 While FileExists($filename&$i&".txt") $i = $i + 1 WEnd $filename = $filename&$i&".txt" $here = FileOpen($filename, 1) $dayname = _DateDayOfWeek(@WDAY,0) $header = "File creation started on "& $dayname &", "& @MDAY &"."& @MON &"."& @YEAR &" at "& @HOUR &":"& @MIN &":"& @SEC &@CRLF&@CRLF FileWrite($here,$header) Sleep(2000) $j = 1 $a = 1 $b = 20 While 1 $title = WinGetTitle("") WinWaitNotActive ($title) If ($title="") Then ContinueLoop FileWrite($here,$title & @CRLF) Sleep(500) If (($j/$b) == $a) Then FileWrite($here,@CRLF & $a*$b &" entries reached -------------------------------------------"&@CRLF&@CRLF) FileClose($here) $here = FileOpen($filename, 1) $a = $a + 1 EndIf $j= $j + 1 WEnd Edited October 27, 2004 by sPeziFisH Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now