ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

use AHK to determine CPU usgae of any given process?

(1/4) > >>

AEN007:
22Feb2011
Greetings.
I've just discovered dc.com.
I also do lots of AHK scripting ... love AHK...
I have LOTS of AHK scripts - a few are memory-resident/permanent.
I also do some CPU usage monitoring and (attempted) control.
One of my permanent scripts uses the following

--- Code: Autohotkey ---SBWErr := 0If WinExist("Windows Task ahk_class #32770") and (SlWS2w = 0) {  If (RuWTMin = 1)   {    RuWTMin := 0    RunWait, aWTMrepo.exe, %IU%   }  SlWS2w := SlWS2/1000  ErrorLevel := 0  StatusBarWait, 100, %SlWS2w%, 2, Windows Task ahk_class #32770  If (ErrorLevel = 0)   If (ExEx = 1)    SBWErr := 1 }else If (SlWS2w = 0) SLEEP, %SlWS2%which checks if CPU usage at the given moment is 100%.
I have three XP laptops - one auf Deutsch,
so I have to accomodate differing window titles sometimes.

Anyway, I have no idea how to determine the CPU usage of any given process
but would REALLY like to know ...

AHK/NP++ users might want to check out the following»
NP++AHK

Any helpful replies/insights appreciated.
Thank you.
Regards,
AEN
Æ

skwire:
Anyway, I have no idea how to determine the CPU usage of any given process
but would REALLY like to know ...-AEN007 (February 22, 2011, 08:35 AM)
--- End quote ---

http://www.autohotkey.com/forum/topic18913.html

AEN007:
7November2011

Greetings.
Many thanks for the reply (and everything else ...).
I looked at that thread/link you posted above earlier this year but
have not yet been able to script what I want.
I would like one of my Persistent ahk scripts to determine
the CPU usage of the active window, so the script could
then do varoius things depending on the CPU usage of the active window.
Determining the active window is obviously no problem.
The CPUtimes script works as written, but
how could I modify it to do what I want?

Any helpful replies/insights appreciated ...

Maybe it would be interest to you to hear that
I have noticed that the CPU usage Trout reports for Trout.exe
does not agree with the CPU usage XP WTM reports for Trout.exe ..

skwire:
You can use SetTimer to constantly poll which window is active, get its CPU usage, and then act upon that value.  Alternately, you could use a ShellHook to watch which window is active.  There are pros and cons to both methods.

I have noticed that the CPU usage Trout reports for Trout.exe
does not agree with the CPU usage XP WTM reports for Trout.exe ..-AEN007 (November 07, 2011, 10:26 AM)
--- End quote ---

Correct.  Trout reports what the BASS library is using.

AEN007:
8November2011

Greetings.
Thanks for the reply ...

I want to determine the active window CPU usage
when, for example, the IdleTimePhysical is > 5min,
so SetTimer is not an option ...

In any case, the CPUtimes script reports the CPU usage to a TrayTip - not a variable.
I'm hoping to see a script example of how to have the CPU usage
of the active window reported to a variable ...

Any helpful replies/insights appreciated ...

Navigation

[0] Message Index

[#] Next page

Go to full version