检索控件中列表框在展开状态时的屏幕坐标,返回数据结构.
#include <GuiComboBoxEx.au3>
_GUICtrlComboBoxEx_GetDroppedControlRectEx($hWnd)
$hWnd | 控件的控件ID/句柄 |
#include <GuiComboBoxEx.au3>
#include <GUIConstantsEx.au3>
#include <Constants.au3>
$Debug_CB = False ;检查传递给 ComboBox/ComboBoxEx 函数的类名, 设置为True并输出到一个控件的句柄,用于检查它是否工作
_Main()
Func _Main()
Local $hGUI, $tRect, $hCombo
; 创建 GUI
$hGUI = GUICreate("ComboBoxEx Get Dropped Control RectEx", 400, 300)
$hCombo = _GUICtrlComboBoxEx_Create($hGUI, "", 2, 2, 394, 100)
GUISetState()
; 添加文件
_GUICtrlComboBoxEx_BeginUpdate($hCombo)
_GUICtrlComboBoxEx_AddDir($hCombo, "", $DDL_DRIVES, False)
_GUICtrlComboBoxEx_AddDir($hCombo, "", $DDL_DRIVES)
_GUICtrlComboBoxEx_BeginUpdate($hCombo)
_GUICtrlComboBoxEx_AddDir($hCombo, @WindowsDir & "\*.exe")
_GUICtrlComboBoxEx_EndUpdate($hCombo)
_GUICtrlComboBoxEx_EndUpdate($hCombo)
; Get Dropped Control Rect
$tRect = _GUICtrlComboBoxEx_GetDroppedControlRectEx($hCombo)
MsgBox(4160, "信息", "Dropped Control Rect: " & _
StringFormat("[%d][%d][%d][%d]", DllStructGetData($tRect, "Left"), DllStructGetData($tRect, "Top"), _
DllStructGetData($tRect, "Right"), DllStructGetData($tRect, "Bottom")))
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main