Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Idle time
#2
Use GetLastInputInfo.

Example. Function ResumeWhenIdle:
Code:
Copy      Help
;/
function [idletime] [flags] ;;flags: 1 remember active window

;This function pauses the macro

if(_winnt<5) ret

type LASTINPUTINFO cbSize dwTime
dll- user32 #GetLastInputInfo LASTINPUTINFO*plii

if(!idletime) idletime=10
idletime*1000

if(flags&1)
,int hfore=win

LASTINPUTINFO lii.cbSize=sizeof(LASTINPUTINFO)
int pause
rep
,GetLastInputInfo &lii
,int t=GetTickCount-lii.dwTime
,if(t>idletime) break
,pause=1
,1

if(pause and flags&1) spe 100; act hfore; err end _error


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)