Jump to content

How to check the system is Idle


 Share

Recommended Posts

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


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

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...