Sign in to follow this  
Followers 0
Damein

Reading Data from Windows Control

3 posts in this topic

#1 ·  Posted (edited)

So I've never actually tried to pull data from anything I've not created inside AutoIt and I can't seem to get it to work.

 

What I am attempting to do is read the data displayed in this window here.

 

5e7jYkC.png

 

 

I want to be able to grab the data in the "Status" column to start out with. Once I figure out that I think I'll be set. My mouse is currently over that column for the Window Info (Note: mousing over all columns result in the same ClassnameNN)

 

I've tried using ControlGetText and ControlListView to no avail. But maybe I'm doing it wrong, here's to hoping!

 

#include <MsgBoxConstants.au3>

Opt("WinTitleMatchMode", 1)

;~ TAdvStringGrid3

Local $hWnd = WinWait("Ametek", "", 10)
$Data = ControlListView($hWnd, "", "TAdvStringGrid3", "GetItemCount")
If @Error Then
    MsgBox(0, "Test", @Error)
EndIf


;~  Local $sClassList = WinGetClassList($hWnd)

    ; Display the classlist.
    MsgBox($MB_SYSTEMMODAL, "", $Data)

 

 

Any help would be appreciated, thanks!

 

*** EDIT ***

 

Forgot to mention with the above code I don't get an error but my message box comes up as 0.

Edited by Damein

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post


Link to post
Share on other sites



Sorry if its not allowed but just curious if anyone has any thoughts on this?


Thanks


MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post


Link to post
Share on other sites

This is allowed. The problem is that your control is not a standard Windows control, but some kind of a grid control. ControlGetText and ControlListView and similar commands can only be used for standard controls and standard listviews (ListView32/SysListView32 controls).

To get information from a grid control you can use the UI Automation framework. Check with the "Simple spy demo" or Inspect.exe from Windows SDK if you can read data in the grid control.

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