|
楼主 |
发表于 2024-5-19 08:40:22
|
显示全部楼层
窗口这个实在不会弄了,还请帮完善下
#include <GuiComboBoxEx.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Global $g_hCombo
Global $delnum
HotKeySet("{F9}","_DelCombo")
Global $hGUI
$hGUI = GUICreate("创建 ComboBoxEx", 400, 300)
GUISetOnEvent(-3,"_exit")
$g_hCombo = _GUICtrlComboBox_Create($hGUI, "", 2, 2, 194, 168)
For $x = 0 To 18
_GUICtrlComboBox_InsertString($g_hCombo,'text'&$x)
Next
GUISetState(@SW_SHOW)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
While 1
Sleep(100)
WEnd
Func _DelCombo()
$i = _GUICtrlComboBox_GetCurSel($g_hCombo)
_GUICtrlComboBox_DeleteString($g_hCombo,$i)
EndFunc
Func _exit()
Exit
EndFunc
Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
#forceref $hWnd, $iMsg, $wParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $tInfo
$tNMHDR = DllStructCreate($tagNMHDR, $lParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $g_hCombo
Switch $iCode
Case -9
ConsoleWrite('-99999'&@CR&@CR)
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
|
|