It is currently July 19th, 2024, 12:27 am

Gadgets 7.7.0 - inspired by AddGadgets.com Sidebar Gadgets

A package of skins with a "theme" or by a single author
User avatar
Yincognito
Rainmeter Sage
Posts: 7742
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Gadgets 7.6.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by Yincognito »

SilverAzide wrote: October 7th, 2023, 2:50 pm Well, I would love to be able to do this too! In fact, this was the second gadget I wanted to create [...] I have no clue how Windows Resource Monitor is able to do what it does on the Network tab, for example.
Me too, ever since I started with Rainmeter. It's the only monitoring that's missing from our arsenal, so to speak. :D

There is the netstat command line, but while it does provide address related stuff and can even run continuously to provide data, it doesn't provide bytes sent / received stats individually and not sure just how much resolving it can do, as far as I know. Integrating with Rainmeter via RunCommand is not really an option for real-time data since the latter expects successful termination of the process to offer it, but continuously logging only the last result to a log file and reading that via WebParser / QuotePlugin / Lua might be feasible. This type of integration might work with other command line tools, by the way. :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
emp00
Posts: 112
Joined: October 7th, 2022, 8:08 pm

Re: Gadgets 7.6.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by emp00 »

I found TCPView as a very resource-friendly Autohotkey-script (github-link here) - this shows at least resolved TCP/UDP connections similar to netstat which gives me hope the same can be achieved with Rainmeter (or we could run this modified AHK script in the background and pass the filtered output text to Rainmeter). However, the TCPView script cannot be sorted based on up/download-throughput as far as I can see... Does this still give food for thought?

Screenshot showing the script running on a Win11 VM with a test-download initiated in Edge...

Image
verliebt bilder lustig
User avatar
SilverAzide
Rainmeter Sage
Posts: 2687
Joined: March 23rd, 2015, 5:26 pm

Re: Gadgets 7.6.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by SilverAzide »

emp00 wrote: October 8th, 2023, 11:40 am
I've looked at just about every tool I can find. Scraping a console (or text file) for output is not the way I'd want to go on this. Ultimately, the simple Network view shown in Resource Monitor is all we need, and that does not require running an elevated process. It's the perfect "top N network processes" view. Unfortunately, I can't find any information on how this works. The closest option I can find is the npcap library I mentioned earlier, which perhaps could be used to create a Rainmeter plugin.
Gadgets Wiki GitHub More Gadgets...
emp00
Posts: 112
Joined: October 7th, 2022, 8:08 pm

Re: Gadgets 7.6.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by emp00 »

Ok, looks like it's harder than I thought - I completely acknowledge your efforts. What about this comment from a stackoverflow-thread, can't we "read out the registry in realtime" with Rainmenter as mentioned here? Some documentation found here.

"You can actually get pretty much all the information Perfmon gets from the registry with the key HKEY_PERFORMANCE_DATA. I think that's what Perfmon enumerates and uses, so you should be able to poke around with perfmon to see what's there and works for you, then write code to read it out in realtime in your own program."

Admittingly, I'm fishing for simple solutions to a theoretically simple problem (which is obviously isn't)... Another stupid idea could be "decompiling perfmon"... Ok, nonsense. But there must be a way for us to get this information into a Rainmeter gadget. Let's collect more ideas, anybody else?
User avatar
MourningStar
Posts: 287
Joined: June 12th, 2016, 2:40 am

Re: Gadgets 7.1.1 - inspired by AddGadgets.com Sidebar Gadgets

Post by MourningStar »

SilverAzide wrote: September 29th, 2021, 2:51 am LOL, I was wondering when you'd mention that! :D
I made an option just for you because I knew you'd want it. ;) Look for the measure [MeasureCPUIcon]; there's two of them, one commented-out, the other not. Uncomment the one you prefer, and comment-out the other one.

I debated making this a formal option, but I haven't so far. You'll probably still need your special PNG file, as I forgot to include it as an alternate. Make sure you name it "CPU_intel_generic.png".
Just updated your Gadgets suite. I forgot how to use my logo - help.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2687
Joined: March 23rd, 2015, 5:26 pm

Re: Gadgets 7.6.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by SilverAzide »

MourningStar wrote: October 9th, 2023, 2:57 am Just updated your Gadgets suite. I forgot how to use my logo - help.
If I recall correctly, just replace the "CPU_intel_generic.png" file with your own. It should be in the @Backup\Resources folder if you didn't keep a copy elsewhere. You can also rename the "CPU_intel_legacy.png" to "CPU_intel_generic.png".
Gadgets Wiki GitHub More Gadgets...
User avatar
MourningStar
Posts: 287
Joined: June 12th, 2016, 2:40 am

Re: Gadgets 7.6.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by MourningStar »

SilverAzide wrote: October 9th, 2023, 1:16 pm If I recall correctly, just replace the "CPU_intel_generic.png" file with your own. It should be in the @Backup\Resources folder if you didn't keep a copy elsewhere. You can also rename the "CPU_intel_legacy.png" to "CPU_intel_generic.png".
Ah yes, thank you so much.
emp00
Posts: 112
Joined: October 7th, 2022, 8:08 pm

Re: Gadgets 7.6.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by emp00 »

SilverAzide wrote: October 8th, 2023, 2:32 pm I've looked at just about every tool I can find. Scraping a console (or text file) for output is not the way I'd want to go on this. Ultimately, the simple Network view shown in Resource Monitor is all we need, and that does not require running an elevated process. It's the perfect "top N network processes" view. Unfortunately, I can't find any information on how this works. The closest option I can find is the npcap library I mentioned earlier, which perhaps could be used to create a Rainmeter plugin.
I reached out to the author of the above "TCPView" AHK script - this is what I got. He points to the official MS development documentation: Apps/Win32/API/IP Helper/Iphlpapi.h. See links below, it really looks like it's what we're looking for! The question is, how can we access these functions via Rainmeter? It's obviously possible via Autohotkey, in case I get more information or a demo AHK script, will let you know. Let's use this forum to discuss and maybe we can share the work to implement this in a decent Rainmeter skin as part of the Gadgets suite? :D
Since I don't have time to implement that, I'll give you the two WinAPI's. Maybe someone else can implement it.

Code: Select all

TcpConnectionEstatsData
This value requests extended data transfer information for a TCP connection.
[...]

TcpConnectionEstatsBandwidth
This value requests bandwidth estimation statistics for a TCP connection on bandwidth.
[...]
User avatar
SilverAzide
Rainmeter Sage
Posts: 2687
Joined: March 23rd, 2015, 5:26 pm

Re: Gadgets 7.6.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by SilverAzide »

emp00 wrote: October 9th, 2023, 6:39 pm
Oh yes, one of the links you posted from stackoverflow or whatever showed this as well, along with sample code. AHK is not the tool for this task, you want a real Rainmeter plugin, in either C++ or maybe C# (not really optimal, but it probably can be done). Also, note that those Win APIs are not available in Windows 7, which is one of the current Rainmeter targets. IIRC, the AHK code you linked did include functions for resolving IP addresses to domain names, so that's handy as well since those two APIs don't return that info.
Gadgets Wiki GitHub More Gadgets...
User avatar
Yincognito
Rainmeter Sage
Posts: 7742
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Gadgets 7.6.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by Yincognito »

emp00 wrote: October 9th, 2023, 6:39 pm I reached out to the author of the above "TCPView" AHK script - this is what I got. He points to the official MS development documentation: Apps/Win32/API/IP Helper/Iphlpapi.h. See links below, it really looks like it's what we're looking for! The question is, how can we access these functions via Rainmeter? It's obviously possible via Autohotkey, in case I get more information or a demo AHK script, will let you know. Let's use this forum to discuss and maybe we can share the work to implement this in a decent Rainmeter skin as part of the Gadgets suite? :D
Those functions can usually be accessed via a plugin, like SilverAzide already mentioned. Unfortunately, not everyone who does skins is an expert in doing a plugin, so that variant means reliance on the relatively limited number of plugin developers, their awareness of such a wish and obviously on their interest in developing a solution for Rainmeter.

That being said, if this connection data retrieval is possible via an AutoHotKey script, it should be possible via an AutoIt script as well, since their syntax is roughly similar. Since one can send bangs from an AutoIt script to a Rainmeter skin (like illustrated here), or send command line parameters as variables from a skin to such a script in order for the script to send bangs back to the skin at regular intervals (like implemented here), I suspect this could be a way to get closer to the desired objective by not scraping a console / file for output. The potential problems I see for such an approach would be:
- the script is a bit long and complex for us amateurs to identify which stuff need to be passed back to a skin
- the script (netstat too?) output doesn't quite match the Windows Resource Monitor stuff (e.g. hosts file used) and it doesn't have traffic amounts
- the script doesn't merge / rollup data from instances of the same process, or sort them in a permanent fashion
- the script takes a bit of CPU when updating, and this could be an issue in multiple skin scenarios, like most are
The good part is that it should be possible to integrate it with Rainmeter as described above, given enough effort and interest.

For the record, although I clearly see perfmon.exe running when the Windows Resource Monitor is running as well, I doubt that's used for the connection data, unless using some combination of undocumented counters that only MS is aware of.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth