Function Reference

_GUICtrlComboBoxEx_GetComboControl

子-コンボボックスコントロールのハンドルを取得します。

#Include <GuiComboBoxEx.au3>
_GUICtrlComboBoxEx_GetComboControl($hWnd)

 

パラメータ

$hWnd コントロールのハンドル

 

返し値

成功: 拡張コンボボックスコントロール内のコンボボックスコントロールのハンドル

 

注意

なし。

 

関連

 


#include <GuiComboBoxEx.au3>
#include <GuiImageList.au3>
#include <GuiConstantsEx.au3>

Opt('MustDeclareVars', 1)

$Debug_CB = False ; ComboBox/ComboBoxEx関数に渡されるClassNameを調べる。動作を確認するにはTrueを設定し、他のコントロールのハンドルを使用

_Main()

Func _Main()
    Local $hGUI, $hImage, $hCombo

    ; GUIを作成
    $hGUI = GUICreate("ComboBoxEx Get Combo Control", 400, 300)
    $hCombo = _GUICtrlComboBoxEx_Create ($hGUI, "", 2, 2, 394, 268)
    GUISetState()

    $hImage = _GUIImageList_Create (16, 16, 5, 3)
    _GUIImageList_AddIcon ($hImage, @SystemDir & "\shell32.dll", 110)
    _GUIImageList_AddIcon ($hImage, @SystemDir & "\shell32.dll", 131)
    _GUIImageList_AddIcon ($hImage, @SystemDir & "\shell32.dll", 165)
    _GUIImageList_AddIcon ($hImage, @SystemDir & "\shell32.dll", 168)
    _GUIImageList_AddIcon ($hImage, @SystemDir & "\shell32.dll", 137)
    _GUIImageList_AddIcon ($hImage, @SystemDir & "\shell32.dll", 146)
    _GUICtrlComboBoxEx_SetImageList ($hCombo, $hImage)

    For $x = 0 To 5
        _GUICtrlComboBoxEx_AddString ($hCombo, StringFormat("%03d : Random string", Random(1, 100, 1)), $x)
    Next

    MsgBox(4160, "Information", _
            "Combo Control Handle: " & _GUICtrlComboBoxEx_GetComboControl ($hCombo) & @LF & _
            "Edit Control Handle: " & _GUICtrlComboBoxEx_GetEditControl ($hCombo))
   
    ; ユーザーが終了するまでループ
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>_Main