Sign in to follow this  
Followers 0
Joef10

ListView

6 posts in this topic

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

Share this post


Link to post
Share on other sites



Hi.

I figured out how to use the main menu option by using an option from the Send Key List though if anyone has a solution to the other that would be great.

Thank

Joe

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

Hi PsaltyDS.

It worked. It returned the correct number of image that are displaying within the listview.

Thank you very much for the help.

Joe

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