Function Reference

_GUICtrlComboBox_GetDroppedControlRect

ドロップダウン状態にあるコンボボックスのスクリーン座標を取得します。

#Include <GuiComboBox.au3>
_GUICtrlComboBox_GetDroppedControlRect($hWnd)

 

パラメータ

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

 

返し値

成功: 次のフォーマットの配列:
        [0] - 長方形の左上隅のX座標
        [1] - 長方形の左上隅のY座標
        [2] - 長方形の右下隅のX座標
        [3] - 長方形の右下隅のY座標

 

注意

なし。

 

関連

_GUICtrlComboBox_GetDroppedControlRectEx

 


#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GUIComboBox.au3>
#include <GuiConstantsEx.au3>
#include <Constants.au3>

Opt('MustDeclareVars', 1)

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

Global $iMemo

_Main()

Func _Main()
    Local $aRect, $hCombo

    ; GUIを作成
    GUICreate("ComboBox Get Dropped Control Rect", 400, 296)
    $hCombo = GUICtrlCreateCombo("", 2, 2, 396, 296)
    $iMemo = GUICtrlCreateEdit("", 2, 32, 396, 266, 0)
    GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
    GUISetState()

    ; ファイルを追加
    _GUICtrlComboBox_BeginUpdate($hCombo)
    _GUICtrlComboBox_AddDir($hCombo, @WindowsDir & "\*.exe")
    _GUICtrlComboBox_EndUpdate($hCombo)

    ; ドロップされたコントロールの長方形を取得
    $aRect = _GUICtrlComboBox_GetDroppedControlRect($hCombo)
   
    MemoWrite("X coordinate of the upper left corner ......: " & $aRect[0])
    MemoWrite("Y coordinate of the upper left corner ......: " & $aRect[1])
    MemoWrite("X coordinate of the lower right corner .....: " & $aRect[2])
    MemoWrite("Y coordinate of the lower right corner .....: " & $aRect[3])
   
    ; ユーザーが終了するまでループ
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main

; メモコントロールに1行書き込み
Func MemoWrite($sMessage)
    GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite