Is such a DX object possible

I run Folding@Home Link on my laptop using unused cpu cycles.

Is it possible to create a DX object that can display the name of any given process together with its cpu usage ?

Basically to mirror these 2 pieces of information that are presently most readily available through Task Manager.

As the name of the process used in Folding at home changes with each new core/work unit it must be able to call on any process name, it can't be written for a specific process only.

TVM for reading.


1,743 views 5 replies
Reply #1 Top
Please, I'm wanting to know just is it possible. I'm not asking for a free handout, just a clue.

Here Brazen Weep did all the processes and usages Link

TVM
Reply #2 Top
Not sure... Perhaps the WDM offer some information...
Reply #3 Top
thomassen


Thanks for clue - not sure where it's pointing.

Is a link possible to best WDM site ? Thanks.
Reply #4 Top
I think it should be fairly simple to bind to the F@H process and retrieve its properties. If I'm not mistaken, the process that does all the work is named something like "FahCore_???.exe" The ???s are wildcards. If you're using the Google F@H client, it may be called "GoogleFahCore_???.exe"

The example I'm showing here uses vb.net, though you may be able to do something similar in vbscript.

Since you don't know the exact name of the process at runtime, you'll need to load all running processes into memory and find the right one

==========================================================

imports system
imports system.diagnostics

Class myProcessClass

    Public Shared Sub Main()

Dim myProcesses() as Process 'array of processes
Dim myProcess As Process
Dim fahProcess As Process
'populate your array with the current running processes
myProcesses = Process.GetProcesses()
'loop through the array to find the f@h process
for each myProcess in myProcesses
'find the string "fahcore" within the process name
if instr(myProcess.ProcessName, "fahcore") > 0 then
fahProcess = myProcess
end if
next
console.writeline("Total Processor Time = " & fahProcess.TotalProcessorTime.ToString)
end sub
end class



As written above, this will only display the processor usage once before exiting. For the purposes of a widget, you'll want to periodically check the processor usage. How you want to handle that is up to you, but I would suggest looking at other widget scripts which show total CPU usage, etc.

There is no error checking in the above 'script', and it sure isn't pretty. My intention was just to provide you with a quick idea of how to bind to a particular process and display information about it.
Reply #5 Top
@
Citizen WeeScunner


Wow, you guys are certainly coming through for me.