Jump to content

ListView


Joef10
 Share

Recommended Posts

Hi.

I am having trouble selecting particular images within a listview.

The listview can have one to many images that require user interaction to navigate to other screens within the application which is a window forms.

Note: I can select the module images thru the main menu of the window but I do not know how to do that.

I have tried the following:

;Click listview

ControlClick ("Hall Manager | Developer | St Mary's - [Choose a Module]", "right", "[Name:lvModules]")

The above doesn't click within the listview.

Send("{TAB}")

Send("{TAB}")

The send tabs just moves the cursor between the button controls on the bottom of the screen.

Send("{RIGHT}")

Send("{ENTER}")

ControlFocus ( "Hall Manager | Developer | St Mary's - [Choose a Module]" , "Choose a Module", "[Name:lvModules]" )

#Include <GuiListView.au3>

Local $hWnd

;Local $iIndex

;_GUICtrlListBox_GetText($hWnd, $iIndex)

_GUICtrlListView_GetBkImage($hWnd)

I have tried the above and nothing happens. I think this is a lack of understanding how and what these are used for.

Can anyone give me a suggestion on how to handle this?

Thank you

Joe

Link to comment
Share on other sites

In general, it takes more detail about the window and the control to help you. Both can be retrieved using the AutoIt Window Info Tool (AU3Info.exe). It is usually most helpful to post the contents of the Summary tab while it's pointing at the control of interest.

:graduated:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Hi.

Here is the Summary of the listview.

>>>> Window <<<<

Title: Hall Manager | Developer - [Choose a Module]

Class: WindowsForms10.window.8.app.0.33c0d9d

Position: -4, -4

Size: 1688, 1028

Style: 0x17CF0000

ExStyle: 0x00050101

Handle: 0x006D075E

>>>> Control <<<<

Class: WindowsForms10.SysListView32.app.0.33c0d9d

Instance: 1

ClassnameNN: WindowsForms10.SysListView32.app.0.33c0d9d1

Name: lvModules

Advanced (Class): [NAME:lvModules]

ID: 28248352

Text:

Position: 2, 2

Size: 1676, 520

ControlClick Coords: 437, 259

Style: 0x56010140

ExStyle: 0x00000000

Handle: 0x01AF0920

>>>> Mouse <<<<

Position: 439, 307

Cursor ID: 0

Color: 0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

Choose a Module

91 day(s)

10.100.7.59

365 day(s)

6.0.3971

Joe Fleck

10.100.7.59

EPSON TM-T88IIR Partial cut

EPSON TM-T88IIR Partial cut

Developer

Register:

LICENSE INFORMATION

Receipt Printer:

Days Remaining:

Version:

Leased To:

Web Server:

Lease Period:

Session:

Employee:

Report Printer:

Group:

LOGON SETTINGS

>>>> Hidden Text <<<<

Link to comment
Share on other sites

OK, so this should get you a handle to the control and the count of items (just for testing sake):

#include <GuiListView.au3>

$hWin = WinGetHandle("Hall Manager | Developer", "")
If $hWin Then
    $hLV = ControlGetHandle($hWin, "", "[NAME:lvModules]")
    If $hLV Then
        $iCnt = _GUICtrlListView_GetItemCount($hLV)
        MsgBox(64, "Results", "$hWin = " & $hWin & @CRLF & _
                "$hLV = " & $hLV & @CRLF & _
                "$iCnt = " & $iCnt)
    Else
        MsgBox(16, "Error", "Failed to get listview handle.")
    EndIf
Else
    MsgBox(16, "Error", "Failed to get window handle.")
EndIf

If that works and comes up with the count, then things like _GUICtrlListView_FindItem() and _GUICtrlListView_ClickItem() should work.

:graduated:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...