Show Total bytes received in DesktopX
Monday, February 9, 2004 by belsidaam | Discussion: Stardock Software
I'm using DekstopX and its awesome. Now I have Inbound and outbound traffic speed on my desktop, but can I also get the total amount downloaded?
Thanxs
Reply #2 Tuesday, February 10, 2004 7:01 AM
Why do they give the possibility to check the RAS bytes received but not the one for the regular internet or network traffic? I mean I can easily read it in the systemtray with one click. But that's one click too much.
I think I have to take out my C++ for dummies book out after all.
Reply #3 Tuesday, February 10, 2004 7:16 AM
I also tried installing something called 'Network Monitor' that's meant to be an extra on the WinXP disk, but have no idea if it installed or not - there's certainly nothing new in the PDH listings.
ActiveX controls are completely beyond me at the moment. Sometimes I hanker back to the simplicity of assembler code.
regards, Jerry

Reply #4 Tuesday, February 10, 2004 8:06 AM
Reply #5 Tuesday, February 10, 2004 2:39 PM
Reply #6 Wednesday, February 11, 2004 12:16 AM
Pay particular regard to the two multipliers 32 and 1024, the raw data supplied by the WMI interface needs to be multiplied by these values to generate the total bytes received and sent. I think it's accurate tho am not 100% sure.
The problem is that these numbers are liable to be different on different systems, and I don't know how to find out what they are on a per system basis. I've looked all around but they just don't seem to exist. That's the task for us to crack.
regards, Jerry
Everything below here is the script:
' quick and dirty example to show how to display total bytes sent and received
' many thanks must go to [brazen weep] @ WC for his various pieces of code I've
' looked through, learnt from and re-edited into what I needed
' this code was developed by JerryHat @ WC with help from belsidaam @ WC
' in this form it's merely a technology demo that hardly does anything
' please don't copy it into a DX script edit window unless you know what
' you're doing. I don't see any way it could be harmful but I take no responsibility
' etc.
' that said, this code is freeware, take it, use it, don't bother to ask permission
' it would be nice to see the results tho
' to get it running you'll need to first find the proper InstanceName of your
' network adapter, mine is "NVIDIA nForce MCP Networking Controller"
' then create a new object in DX2.1, turn it into a text item in the states tab
' make a new script and copy and paste this script into it
' finally replace the InstanceName of my adapter with your own
' exit the edit script box and hit 'apply' on the properties dialog
' if all is well the bytes received and sent will display as your object
' hit 'apply' to force a refresh - sorry but I didn't have time to learn how
' to create a timer, as i said quick and dirty is the name of the game
' enjoy, JerryHat
' v0.1
Dim strComputer, objWMIService, total_string, total_obj
'Called when the script is executed
Sub Object_OnScriptEnter
total_string = ""
' get total bytes received and sent
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")
' get total received
Set total_obj = objWMIService.ExecQuery("SELECT * FROM MSNdis_CoReceivePdusOk")
For Each objItem In total_obj
If objItem.InstanceName = "NVIDIA nForce MCP Networking Controller" Then
total_string = objItem.NdisCoReceivePdusOk * 32 & " bytes received "
End If
Next
' get total sent
Set total_obj = objWMIService.ExecQuery("SELECT * FROM MSNdis_CoTransmitPdusOk")
For Each objItem In total_obj
If objItem.InstanceName = "NVIDIA nForce MCP Networking Controller" Then
total_string = total_string & objItem.NdisCoTransmitPdusOk * 1024 & " bytes sent"
End If
Next
' display as object text
Object.text = total_string
End Sub
'Called when the script is terminated
Sub Object_OnScriptExit
End Sub

Reply #7 Wednesday, February 11, 2004 2:48 AM
With that I can even know exactly what comes from my network and what comes from my modem (if internet doesn't come from the network)
Again, good work !
Reply #8 Wednesday, February 11, 2004 3:16 AM
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!







Reply #1 Tuesday, February 10, 2004 6:29 AM
The short answer is yes - but anything is possible.
The longer answer is that it's quite a complex process and I haven't found a solution. Meters such as the inbound and outbound traffic ones rely on DesktopX's ability to tie in any of Windows's Performance counters (see Admin tools > Performance) into their graphics/text display plugin. The problem is that none of the default Performance counters give a running total of the amount up or downloaded.
The system is extensible via .dlls so the solution should be to find a third-party Performance counter .dll or to develop your own. I couldn't find any of the former and lack the knowledge (of C++) to develop anything. The Windows Resource Kit apparently has sample code available to write these Performance .dlls if anyone is interested.
I know this is much more info than you were looking for but I hoped this message might inspire greater coders than myself to have a think.
regards, Jerry