#include <ListBoxConstants.au3>
#include <GUIConstantsEx.au3>
#Include <GuiListBox.au3>
#include <Array.au3>
#include <WindowsConstants.au3>
HotKeySet("{ESC}","_Exit")
Global $iHLast = 1
Global $hGUI = GUICreate("История действий",400,300)
Global $hLogList = GUICtrlCreateList("",15,15,370,240,BitAND($GUI_SS_DEFAULT_LIST,BitNOT($LBS_SORT)))
Global $hDelLastBut = GUICtrlCreateButton("Уд. последнее действие",15,265,150,24)
Global $hClearBut = GUICtrlCreateButton("Очистить",175,265,100,24)
GUISetState()
; Типа длинный текст :D
_2History("gasdgmpotupmatubputbmpw9ubamp9ubm960w49b7a04949b76a408b67a4cm074mv047vm0847m08a7m0w87vmw0a87m08m7aw087bm0w67m4w807b80m")
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
_Exit()
Case $GUI_EVENT_MINIMIZE
_2History("GUI Minimized")
Case $GUI_EVENT_RESTORE
_2History("GUI Restored")
;~ Case $GUI_EVENT_PRIMARYDOWN
;~ _2History("Mouse Primari Down")
;~ Case $GUI_EVENT_PRIMARYUP
;~ _2History("Mouse Primari Up")
Case $GUI_EVENT_SECONDARYDOWN
_2History("Mouse Secondary Down")
Case $GUI_EVENT_SECONDARYUP
_2History("Mouse Secondary Up")
Case $hDelLastBut
_DelLast()
Case $hClearBut
_Clear()
Case $hLogList
GUICtrlSetTip($hLogList,_GUICtrlListBox_GetText($hLogList,_GUICtrlListBox_GetCaretIndex($hLogList)))
EndSwitch
WEnd
Func _Exit()
_2History("Good bye! :)")
Sleep(1000)
Exit
EndFunc
Func _2History($sString)
_GUICtrlListBox_AddString($hLogList,$iHLast&". "&$sString)
_GUICtrlListBox_SelectString($hLogList,$iHLast&". "&$sString)
GUICtrlSetTip($hLogList,$iHLast&". "&$sString)
$iHLast += 1
EndFunc
Func _Clear()
_GUICtrlListBox_ResetContent($hLogList)
GUICtrlSetTip($hLogList,"")
$iHLast = 1
EndFunc
Func _DelLast()
If $iHLast > 1 Then
_GUICtrlListBox_DeleteString($hLogList,_GUICtrlListBox_GetCount($hLogList)-1)
_GUICtrlListBox_SelectString($hLogList,_GUICtrlListBox_GetText($hLogList,_GUICtrlListBox_GetCount($hLogList)-1))
GUICtrlSetTip($hLogList,_GUICtrlListBox_GetText($hLogList,_GUICtrlListBox_GetCount($hLogList)-1))
$iHLast -= 1
EndIf
EndFunc