Jump to content

Reading Data from Windows Control


Recommended Posts

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

Link to comment
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

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...