Sign in to follow this  
Followers 0
dragan

[not solved] Getting itemtext from SysListView32 from resource monitor

5 posts in this topic

#1 ·  Posted (edited)

I`m having trouble getting items text from SysListView32 control, can anyone confirm is this working for you (windows 7 required):

#include <GuiListView.au3>
Test()
Exit
Func Test()
if NOT ProcessExists("resmon.exe") then Run("resmon.exe")
if WinWait("Resource Monitor", "", 5) = 0 Then
MsgBox(0, "error", "window did not show up within 5 sec")
Return 0
EndIf
$hListView = ControlGetHandle("Resource Monitor", "", "[CLASS:SysListView32; INSTANCE:14]")
if @error then
MsgBox(0, "error", "couldnt get the control handle")
Return 0
EndIf
Do ;waiting for the resmon to display list items
Local $listCount = _GUICtrlListView_GetItemCount($hListView)
If NOT WinExists("Resource Monitor") then Return 0
Until $listCount > 0
ConsoleWrite("! total number of items: " & $listCount+1 & @LF)
For $i = 0 to $listCount
ConsoleWrite("> " & $i+1 & " - " & _GUICtrlListView_GetItemText($hListView, $i) & @LF)
Next
EndFunc

I get the number of items, but can't get its txts.

p.s. I searched numerous topics related to SysListView32, but none helped.

Edited by dragan

Share this post


Link to post
Share on other sites



Instance 14 is "Network Activity" on the "Network" tab, right?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Network tab, Network Activity, yes, exactly.

Share this post


Link to post
Share on other sites

I think it's easier to retrieve the required data directly using WMI. If you search the web for "Retrieve Resource Monitor values from WMI with vbscript" you will find a lot of scripts to do what you want.

They can easily be translated to Autoit.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Yeah, I figured I might be looking for an alternative to this, so I made a - WMI related..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • Fixis
      By Fixis
      Hi all,

      When I open Windows Task Manager (ctrl+alt+del) and go to tab "Users"
      I am quite new to autoit and I want to find out how to do this:
      I want the program to recognize if there is a user in the "User" column called for example "George". Then the user should be selected and I can write the rest (send message button/log off it doesn't matter). The problem is that I don't know how to "read" the users from the column with autoit (or select any). When I use Finder Tool it can't select me the name of the user, it just selects the whole list control SysListView32. I'll be most happy if anyone can help me with this