Modify

Opened 7 years ago

Closed 7 years ago

#2301 closed Feature Request (Rejected)

_GUICtrlComboBox_GetEditControl for standard combobox

Reported by: funkey Owned by:
Milestone: Component: Standard UDFs
Version: Severity: None
Keywords: Cc:

Description

Maybe this is helpful, because ComboBoxEx has the same function

#include <GuiComboBox.au3>

GUICreate("Combobox Edit control")
GUICtrlCreateCombo("edit", 10, 10, 100, 100)

ConsoleWrite("Handle Edit: " & _GuiCtrl_GetInternalCtrl(-1) & @CRLF)
ConsoleWrite("Handle Edit: " & _GUICtrlComboBox_GetEditControl(GUICtrlGetHandle(-1)) & @CRLF)

GUISetState()
Do
Until GUIGetMsg() = -3


Func _GuiCtrl_GetInternalCtrl($_hCtrl)
	If Not IsHWnd($_hCtrl) Then $_hCtrl = GUICtrlGetHandle($_hCtrl)
	Local $aResult = DllCall("user32.dll", "hwnd", "GetWindow", "hwnd", $_hCtrl, "uint", 5) ; 5 = $GW_CHILD
	Return $aResult[0]
EndFunc   ;==>_GuiCtrl_GetInternalCtrl

; #FUNCTION# ====================================================================================================================
; Name...........: _GUICtrlComboBox_GetEditControl
; Description ...: Gets the handle to the edit control portion of a ComboBox control
; Syntax.........: _GUICtrlComboBox_GetEditControl($hWnd)
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - The handle to the edit control within the ComboBoxEx control if it uses the $CBS_DROPDOWN style
; Author ........: funkey
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _GUICtrlComboBox_GetEditControl($hWnd)
	If $Debug_CB Then __UDF_ValidateClassName($hWnd, $__COMBOBOXCONSTANT_ClassName)
	If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)

	Local $tInfo
	If _GUICtrlComboBox_GetComboBoxInfo($hWnd, $tInfo) Then
		Return DllStructGetData($tInfo, "hEdit")
	Else
		Return SetError(1, 0, 0)
	EndIf
EndFunc   ;==>_GUICtrlComboBox_GetEditControl

Attachments (0)

Change History (2)

comment:1 Changed 7 years ago by guinness

The example for _GUICtrlComboBox_GetComboBoxInfo already explains how to obtain this information and given the simple nature of the ComboBox UDF, there is no requirement for such a function.

comment:2 Changed 7 years ago by guinness

  • Resolution set to Rejected
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.