Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
#definefunction GetKeyboardState(buf) sDLLName = StrCat(DirWindows(1), "user32.dll") DLLCall(sDLLName, long:"GetKeyboardState", lpbinary:buf) BinaryEodSet(buf, 256) return buf #endfunction #DefineFunction WaitForIdle(time) BoxOpen("Check if System is Idle","Initializing") While @True IntControl(80,0,0,0,0);wait til no keys are pressed statusflag = 0 ;Check mouse currcoordinates = MouseInfo(2) coordinates = currcoordinates ;Check keyboard currbuf = BinaryAlloc(256) newbuf = BinaryAlloc(256) currkbstate = GetKeyboardState(currbuf) kbstate = currkbstate count = 0 While coordinates == currcoordinates && BinaryCompare(currkbstate, 0, kbstate, 0, 256) count = count+1 BoxText(count) if count == time statusflag = 1 break endif timedelay(1); check every second currcoordinates = MouseInfo(2) kbstate = GetKeyboardState(newbuf) EndWhile BinaryFree(currbuf) BinaryFree(newbuf) if statusflag == 1 return 1 endif EndWhile #EndFunction time = 1800 ; 30 minutes WaitForIdle(time) Pause("Workstation",StrCat("Has been Idle for ",time," seconds"))
Article ID: W16234
File Created: 2004:03:30:15:43:32
Last Updated: 2004:03:30:15:43:32