Rorax Posted November 8, 2006 Posted November 8, 2006 (edited) Hello, What I'm trying to do is get the selected item from the listbox (see image) alternative picture host: clicky I've tried to use different types of currenttab and getcurrentselection but it doesnt seem to work. Is there any way to select/get information of a selection in that listbox? Basically I want to make a automated script to scan for me using those two options. I got one working using the wizard XP have built in but need to make one that dont use that also. But kind of stuck at the beginning. Tried to use commands like: expandcollapse popupControlCommand("Hp Smart Document Scan Software", "", "SysListView321", "CurrentTab", "") ControlCommand("Hp Smart Document Scan Software", "", "SysListView321", "GetCurrentSelection", "") [/code) And then using a msgbox to display the result, but always get the result to either blank or 0. Any help would be appreciated! Regards, Rorax Edited November 8, 2006 by Rorax (adsbygoogle = window.adsbygoogle || []).push({}); mcgill Posted November 9, 2006 mcgill Active Members 54 Posted November 9, 2006 Here is an example of getting the selected item from a listbox. I hope this is what you are looking for. #include <GUIConstants.au3> GLOBAL $MESSAGE = "The following buttons have been clicked" GUICreate("My GUI list",280, 100) ; will create a dialog box that when displayed is centered $Add=GUICtrlCreateButton ("Add", 0,0,75,25) $Clear=GUICtrlCreateButton ("Clear", 0,25,75,25) $MyList=GUICtrlCreateList ("buttons that have been clicked",75,0,205,110) GUICtrlSetLimit(-1,200) ; to limit horizontal scrolling GUICtrlSetData(-1,$MESSAGE) $DisplayText = GUICtrlCreateButton ("Display", 0,50,75,25) $Close=GUICtrlCreateButton ("Close", 0,75,75,25) GUISetState () $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $Add GUICtrlSetData($mylist,"You clicked button No1|") Case $msg = $Clear GUICtrlSetData($mylist,"") Case $msg = $DisplayText msgbox(4096,"TEST", GUICTRLRead($mylist)) Case $msg = $Close MsgBox(0,"", "the closing button has been clicked",2) Exit EndSelect Wend Rorax Posted November 9, 2006 Rorax Active Members 41 Author Posted November 9, 2006 Sort of, but that code makes a GUI itself and set events for what to happen when you click a button. I need to read the info in a listbox thats already made from another program (named SysListView321) Rorax Posted November 9, 2006 Rorax Active Members 41 Author Posted November 9, 2006 (edited) I've tried the latest beta now to just get anything from the listbox: $ID is either 1003 or "SysListView321", tried using both (and I know $ID isnt declared in the code here but I have it of course declared in the code I'm trying) #Include <GuiListView.au3> WinActivate("HP Smart Document Scan Software") WinWaitActive("HP Smart Document Scan Software") $Selected = _GUICtrlListViewGetItemCount($ID) msgbox(4096, "Listbox", $Selected) Selected is displayed as: 0 #Include <GuiListView.au3> WinActivate("HP Smart Document Scan Software") WinWaitActive("HP Smart Document Scan Software") $Selected = _GUICtrlListViewGetCurSel($ID) msgbox(4096, "Title", $Selected) Selected is displayed as: 0 ---------------------------------------------------------------- I'm probably using this wrong, but I'm kind of new to autoit so hoping someone with more experience them me can shed som light on this. Edited November 9, 2006 by Rorax
Cue Posted November 9, 2006 Posted November 9, 2006 Have you tried #Include <GuiListView.au3> _GUICtrlListViewGetSelectedIndices($h_listview[, $i_ReturnType=0])) i dont know if it works though. I remember having a problem with getting info from a similair control classname:SysListView321
PaulIA Posted November 9, 2006 Posted November 9, 2006 You can use the ListView library in Auto3Lib to manipulate external controls. It was designed specifically for this purpose. Auto3Lib: A library of over 1200 functions for AutoIt
ChrisL Posted November 9, 2006 Posted November 9, 2006 Is it not ControlListView() that you need to use rather than ControlCommand() [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
Rorax Posted November 10, 2006 Author Posted November 10, 2006 Ah yes, ControlListView worked perfectly. Thank you very much.
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