Is such a DX object possible

Monday, October 10, 2005 by Shadows Edge | Discussion: DesktopX

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.


Shadows Edge
Reply #1 Tuesday, October 11, 2005 9:39 AM
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
thomassen
Reply #2 Tuesday, October 11, 2005 10:26 AM
Not sure... Perhaps the WDM offer some information...
Shadows Edge
Reply #3 Wednesday, October 12, 2005 7:49 AM
thomassen


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

Is a link possible to best WDM site ? Thanks.
WeeScunner
Reply #4 Wednesday, October 12, 2005 10:50 AM
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.
Shadows Edge
Reply #5 Wednesday, October 12, 2005 12:36 PM
@
Citizen WeeScunner


Wow, you guys are certainly coming through for me.

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01