Joef10 Posted December 2, 2010 Posted December 2, 2010 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 listviewControlClick ("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 youJoe
Joef10 Posted December 2, 2010 Author Posted December 2, 2010 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
PsaltyDS Posted December 2, 2010 Posted December 2, 2010 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. 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
Joef10 Posted December 2, 2010 Author Posted December 2, 2010 Hi.Here is the Summary of the listview.>>>> Window <<<<Title: Hall Manager | Developer - [Choose a Module]Class: WindowsForms10.window.8.app.0.33c0d9dPosition: -4, -4Size: 1688, 1028Style: 0x17CF0000ExStyle: 0x00050101Handle: 0x006D075E>>>> Control <<<<Class: WindowsForms10.SysListView32.app.0.33c0d9dInstance: 1ClassnameNN: WindowsForms10.SysListView32.app.0.33c0d9d1Name: lvModulesAdvanced (Class): [NAME:lvModules]ID: 28248352Text: Position: 2, 2Size: 1676, 520ControlClick Coords: 437, 259Style: 0x56010140ExStyle: 0x00000000Handle: 0x01AF0920>>>> Mouse <<<<Position: 439, 307Cursor ID: 0Color: 0xFFFFFF>>>> StatusBar <<<<>>>> ToolsBar <<<<>>>> Visible Text <<<<Choose a Module91 day(s)10.100.7.59365 day(s)6.0.3971Joe Fleck10.100.7.59EPSON TM-T88IIR Partial cutEPSON TM-T88IIR Partial cutDeveloperRegister:LICENSE INFORMATIONReceipt Printer:Days Remaining:Version:Leased To:Web Server:Lease Period:Session:Employee:Report Printer:Group:LOGON SETTINGS>>>> Hidden Text <<<<
PsaltyDS Posted December 2, 2010 Posted December 2, 2010 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. 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
Joef10 Posted December 2, 2010 Author Posted December 2, 2010 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now