jugador Posted October 15, 2019 Posted October 15, 2019 Having problem using _GUICtrlListBox $iTitle = "Something" Local $hdlWindow = WinGetHandle($iTitle ) Local $Ad_Mode = "[CLASS:ListBox; INSTANCE:4]" Local $hControl = ControlGetHandle($hdlWindow, "", $Ad_Mode) ;;this working _GUICtrlListBox_ClickItem($hControl, 1, "left",False) ;;but this return empty Local $iCnt = _GUICtrlListBox_GetCount($hControl) MsgBox($MB_SYSTEMMODAL, "", "Column " & $iCnt)
pixelsearch Posted October 15, 2019 Posted October 15, 2019 (edited) Hi jugador, When I insert your partial code into the help file example (_GUICtrlListBox_GetCount) then your script works fine : expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiListBox.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $idListBox ; Create GUI GUICreate("List Box Get Count", 400, 296) $idListBox = GUICtrlCreateList("", 2, 2, 396, 296) GUISetState(@SW_SHOW) ; Add strings _GUICtrlListBox_BeginUpdate($idListBox) For $iI = 1 To 9 _GUICtrlListBox_AddString($idListBox, StringFormat("%03d : Random string", Random(1, 100, 1))) Next _GUICtrlListBox_EndUpdate($idListBox) ; Get item count MsgBox($MB_TOPMOST, "Information", "Item count: " & _GUICtrlListBox_GetCount($idListBox)) ; ==================== ; begin jugador script ; ==================== $iTitle = "List Box Get Count" Local $hdlWindow = WinGetHandle($iTitle ) Local $Ad_Mode = "[CLASS:ListBox; INSTANCE:1]" Local $hControl = ControlGetHandle($hdlWindow, "", $Ad_Mode) ;;this working _GUICtrlListBox_ClickItem($hControl, 1, "left",False) ;;but this return empty Local $iCnt = _GUICtrlListBox_GetCount($hControl) MsgBox($MB_SYSTEMMODAL, "jugador", "Column " & $iCnt) ; ================== ; end jugador script ; ================== ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example I just changed your window title and INSTANCE:4 to INSTANCE:1 to match the help file example. If this doesn't help, could you please post your whole script (including Gui creation & other controls) so we can determine why it is not working at your place ? Edited October 15, 2019 by pixelsearch jugador 1 "I think you are searching a bug where there is no bug... don't listen to bad advice."
jugador Posted October 15, 2019 Author Posted October 15, 2019 pixelsearch Thanks. I guess then it cannot be help. It’s my office software and it’s not created using Autoit.
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