Modify

Opened 8 years ago

Closed 8 years ago

Last modified 3 hours ago

#3622 closed Bug (No Bug)

AU3_ControlCommandByHandle FindString in ListBox

Reported by: ctrirxu@… Owned by:
Milestone: Component: AutoIt
Version: 3.3.14.5 Severity: None
Keywords: FindString ListBox Cc:

Description

AU3_ControlCommandByHandle FindString in ListBox return 0 if not found as the ListBox is 0 based.

Should return -1 like ::SendMessage(h, LB_FINDSTRINGEXACT, 0, L"") does

Attachments (0)

Change History (1)

comment:1 by Melba23, 8 years ago

Resolution: No Bug
Status: newclosed

If the string is not found then @error is set - use this to differentiate between the 2 cases:

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Test", 500, 500)

$cList = GUICtrlCreateList("", 10, 10, 200, 200)
GUICtrlSetData($cList, "A|B|C|D|E")

GUISetState()

$iRet = ControlCommand($hGUI, "", $cList, "FindString", "F")
ConsoleWrite("Not in list = F: " & $iRet & " - error: " & @error & @CRLF)

$iRet = ControlCommand($hGUI, "", $cList, "FindString", "A")
ConsoleWrite("In list = A: " & $iRet & " - error: " & @error & @CRLF)

While 1
	Switch GUIGetMsg()
		Case $GUI_EVENT_CLOSE
			Exit
	EndSwitch
WEnd

M23

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.