Sign in to follow this  
Followers 0
alexischeng

How to check the system is Idle

4 posts in this topic

I know if yu open task manager and check the status bar, yu can get the cpu %. Is there an example to doing that? Is there any other method rather than using task manager?

Share this post


Link to post
Share on other sites



I know if yu open task manager and check the status bar, yu can get the cpu %. Is there an example to doing that? Is there any other method rather than using task manager?

<{POST_SNAPBACK}>

Here is an example I found in an earlier post

run("taskmgr.exe","",@SW_HIDE)
Sleep(1000)
while 1
$rc = StatusBarGetText("Windows Task Manager","",2)
Tooltip($rc,0,0)
sleep(10)
wend


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

You can use GetMousePos() and then save the value. Then later check that against a new GetMousePos() value.

That's how I did it, anyways.


Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite

Share this post


Link to post
Share on other sites

You can use GetMousePos() and then save the value.  Then later check that against a new GetMousePos() value.

That's how I did it, anyways.

<{POST_SNAPBACK}>

I was thinking the same thing, Josh, but then I remembered that some people don't use the mouse very often. I personally only use the mouse when it's less convenient than the keyboard. I have learned shortcuts for almost everything you can do in Windows and all the apps I use.

So I would suggest watching the mouse, but also maybe check a list of windows to see if any have changed state (minimized, maximized, restored) since the last check. I'm sure there's a DLL that could be tapped to hook the keyboard queue in peek mode to see if any keystrokes or mouse movements have occurred. Search the forum for _IsPressed and dig into the DLL that it's using.


My UDFs: ExitCodes

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0