Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
What I'm trying to do is write a little applet that trys to track the time spent browsing the Internet by incrementing a timer while a browser is the active window and there is mouse activity within a certain time threshhold...and yet not needlessly effect overall system performance.
IntControl(54,"",1,0,0) timer = 0 BoxOpen("Internet Monitor",StrCat("Initializing....",@CRLF,@CRLF,"Hold the shift key down to exit")) while 1 ; timing loop (every 5 seconds) mouse=MouseInfo(2); Mouse coordinates, assuming a 1000x1000 virtual screen wnd=WinGetActive(); Gets the title of the active window. found = StrIndexNC (wnd, "Microsoft Internet Explorer", 1, @FWDSCAN) while found !=0; Detect loop if IsKeyDown(@SHIFT|@CTRL) then break ;Used to cancel script TimeDelay(1) ; Adjust resolution timer=timer+1 ; Adjust here also BoxTitle(StrCat("Internet Monitor: Timer = ",timer)) ;Add mouse checking here mousenew=MouseInfo(2); Mouse coordinates, assuming a 1000x1000 virtual screen if mousenew != mouse BoxText("Mouse has moved") TimeDelay(0.5) else BoxText("Mouse has not moved") TimeDelay(0.5) endif mouse = mousenew wnd=WinGetActive(); Gets the title of the active window. found = StrIndexNC (wnd, "Microsoft Internet Explorer", 1, @FWDSCAN) endwhile BoxText("Microsoft Internet Explorer not activated") TimeDelay(1) Endwhile
Article ID: W15988
File Created: 2004:03:30:15:42:06
Last Updated: 2004:03:30:15:42:06