#include <GUIListBox.au3> #include <WindowsConstants.au3> ; GUI GuiCreate("Пример", 130, 130) ; LIST Global $ggg = GuiCtrlCreateList("",5, 5, 120, 120) GuiCtrlSetData(-1, "1 Sample|2 Sample|3 Sample|4 Sample") GuiSetState() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") While 1 $msg = GuiGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit ;~ If $msg = $ggg Then ;~ $gggg = GUICtrlRead($ggg) ;~ MsgBox(0, "", $gggg) ;~ EndIf WEnd Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg Local $hWndFrom, $iCode, $hWndListBox If Not IsHWnd($ggg) Then $hWndListBox = GUICtrlGetHandle($ggg) $hWndFrom = $ilParam $iCode = BitShift($iwParam, 16) Switch $hWndFrom Case $hWndListBox Switch $iCode Case $LBN_DBLCLK ; Sent when the user double-clicks a string in a list box MsgBox(64, "Внимание","Был произведен двойной клик мышкой") EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND |