kaizenwarrior

How to overcome SysListView32 Text access restrictions

6 posts in this topic

I am trying to access the text from SysListView32 of some external applications. For this help request I am using NirSoft's SysExporter.

I tried the below code in my Win 7x64 OS and confirmed the code works fine. I am able retrieve the text from Task Manager's SysListView32, but not from the Sys Exporter.

#Include <GuiListView.au3>

$hWnd = WinGetHandle("SysExporter")
$hListView = ControlGetHandle($hWnd,"","[CLASS:SysListView32; INSTANCE:1]")
ConsoleWrite("Item Count =  " & ControlListView($hWnd,"",$hListView,"GetItemCount") & @CRLF)
ConsoleWrite("GetText =     " & ControlListView($hWnd,"",$hListView,"GetText",1,1) & @CRLF)
ConsoleWrite("Item Count2 = " & _GUICtrlListView_GetItemCount($hListView) & @CRLF)
ConsoleWrite("GetText2 =    " & _GUICtrlListView_GetItemText($hListView,0) & @CRLF)

$hWnd = WinGetHandle("Windows Task Manager")
$hListView = ControlGetHandle($hWnd,"","[CLASS:SysListView32; INSTANCE:1]")
ConsoleWrite("Item Count =  " & ControlListView($hWnd,"",$hListView,"GetItemCount") & @CRLF)
ConsoleWrite("GetText =     " & ControlListView($hWnd,"",$hListView,"GetText",1,1) & @CRLF)
ConsoleWrite("Item Count2 = " & _GUICtrlListView_GetItemCount($hListView) & @CRLF)
ConsoleWrite("GetText2 =    " & _GUICtrlListView_GetItemText($hListView,0) & @CRLF)

I am  looking for some help in directions and pointers to identify and overcome what causes this difference in behavior so that the text can be retrieved.

SysExp.png

Share this post


Link to post
Share on other sites



Open SysExporter and from the options menu select Display SysExporter items. Select the sysExporter top listview item and export the data with ctrl + E (command in sysexporter). Hope this helps. 


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

Thank you very much for your response.

I used SysExporter as an example application from which I am unable to get the text data from its SysListView32 control as this is accessible to all and can be used for simulating my issue.

I am trying to get data via my AutoIt script from a custom built monitoring application that uses SysListView32 control for pushing data.
I am able select/getcount etc on the control but unable to GetText either using ControlListView or _GUICtrlListView_GetItemText functions. I was doubtful if the custom application was locked to prevent such access in some way.
So when I tried with SysExporter, it was able to extract the text data from the custom application' SysListView32 control while my autoitscript wasn't able to.

The autoitscript works just fine on some SysListView32 controls , for example: Windows Task Manager. But the same script was unable to retrieve text data from the SysExporter's SysListView32 control.

And I thought of using SysExporter's SysListView32 Control as an example for my test script to keep my search simple enough and to understand the underlying changes on the control.

I also searched through previous posts in this forum and google'd for any workarounds, understood that Autoit is already using "WriteProcessMemory" & "ReadProcessMemory" approach for getting the ListViewItem text. And I am unable to find any further alternatives/approaches to explore and try.

Share this post


Link to post
Share on other sites

Thank you very much for the helpful tip.

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