#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <GUIListView.au3>
$GUI = GUICreate("GEPARD3.2.1", 610, 280, -1, -1, BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU))
$nTab = GUICtrlCreateTab(5, 5, 590, 240)
GUICtrlCreateTabItem("Общие")
GUICtrlCreateTabItem("Входные параметры")
; Last option Calls CoInitializeEx
$hListView = _GUICtrlListView_Create($GUI, "", 15, 40, 466, 190, BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_NOSORTHEADER), $WS_EX_CLIENTEDGE, True)
_GUICtrlListView_InsertColumn($hListView, 0, "Входные параметры", 225)
_GUICtrlListView_InsertColumn($hListView, 1, "Значения", 220)
For $i = 1 To 77
_GUICtrlListView_AddItem($hListView, "")
Next
$sURL = "http://s002.radikal.ru/i198/1004/7e/dc8579ff254a.jpg"
$sFile = @TempDir & "\LV_Back.jpg"
InetGet($sURL, $sFile)
_GUICtrlListView_SetBkImage($hListView, $sFile)
GUICtrlCreateTabItem("")
$nLoad_Buttton = GUICtrlCreateButton("&Загрузить", 485, 180, 100, 22)
$nSave_Buttton = GUICtrlCreateButton("&Сохранить", 485, 210, 100, 22)
GUICtrlCreateButton("Ок", 335, 250, 80, 22)
GUICtrlCreateButton("Отмена", 425, 250, 80, 22)
GUICtrlCreateButton("Сброс", 515, 250, 80, 22)
WinSetState($hListView, "", @SW_HIDE)
GUICtrlSetState($nLoad_Buttton, $GUI_HIDE)
GUICtrlSetState($nSave_Buttton, $GUI_HIDE)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
GUISetState(@SW_SHOW)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $nTab
GUISetState(@SW_LOCK)
If GUICtrlRead($nTab) = 1 Then
WinSetState($hListView, "", @SW_SHOW)
GUICtrlSetState($nLoad_Buttton, $GUI_SHOW)
GUICtrlSetState($nSave_Buttton, $GUI_SHOW)
Else
WinSetState($hListView, "", @SW_HIDE)
GUICtrlSetState($nLoad_Buttton, $GUI_HIDE)
GUICtrlSetState($nSave_Buttton, $GUI_HIDE)
EndIf
GUISetState(@SW_UNLOCK)
EndSwitch
WEnd
;=========================================================================================================
DllCall('ole32.dll', 'long', 'CoUinitialize') ; Must call for each CoInitializeEx call made
;=========================================================================================================
Func WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam)
Local $TagNMHDR = DllStructCreate("int hWndFrom;int iIDFrom;int iCode;int iItem;int iButton;ptr pitem", $lParam)
If @error Then Return $GUI_RUNDEFMSG
Local $hWndFrom = DllStructGetData($TagNMHDR, "hWndFrom")
Local $iEvent = DllStructGetData($TagNMHDR, "iCode")
Switch $hWndFrom
Case _GUICtrlListView_GetHeader($hListView)
Switch $iEvent
Case $HDN_ITEMCHANGING, $HDN_ITEMCHANGINGW
Return 1 ;Prevent columns resizing
EndSwitch
Case $hListView
Switch $iEvent
Case $LVN_ITEMCHANGING, $LVN_BEGINDRAG
Return 1 ;Prevent items selection
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc