09-04-2006, 06:26 AM
Use GetLastInputInfo.
Example. Function ResumeWhenIdle:
Example. Function ResumeWhenIdle:
;/
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