#include-once
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <EditConstants.au3>
#include <String.au3>
#include <Array.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <ListViewConstants.au3>
#include <Misc.au3>
; #include <GuiRichEdit.au3> ; Авторы: GaryFrost, grham, Prog@ndy, KIP, Chris Haslam (c.haslam), Yoan Roblet (Arcker), Paul Campbell (PaulIA); http://autoit-script.ru/index.php/topic,339.0.html
#include <WinAPI.au3>
#Include <File.au3>
; #Include <FTP.au3> ; Автор: Yashied; http://www.autoitscript.com/forum/index.php?showtopic=94212
#include <GuiTreeView.au3>
#include <TreeViewConstants.au3>
#include <StaticConstants.au3>
#include <Date.au3>
#include <GuiEdit.au3>
Global Const $widthofdisplay = @DesktopWidth
Global Const $width = $widthofdisplay * 0.63
Global Const $fontsizeLog=12
Global Const $fontsizeEdit=10
Global $Window3 = GUICreate ("Диспетчер писем", $width, 0.9*$width)
Global $Checkbox3a_1 = GUICtrlCreateCheckbox ("", 0.00945*$width, 0.0066*$width, 0.016*$width, 0.016*$width)
GuiSetStyle(-1, $WS_EX_TOPMOST, $Window3)
Global $Checkbox3a_2 = GUICtrlCreateCheckbox ("", 0.087*$width, 0.0066*$width, 0.016*$width, 0.016*$width)
GuiSetStyle(-1, $WS_EX_TOPMOST, $Window3)
;~ GUICtrlSetState (-1, $GUI_ONTOP)
Global $List3_1 = GUICtrlCreateListView(" Получить| Удалить|№|Новое|Скачанное|Отправитель|Тема|Получено|Размер, Kb|UIDL|E-mail|Размер, b", 0, 0, $width, 0.54*$width, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_HEADERDRAGDROP, $LVS_EX_MULTIWORKAREAS, $LVS_EX_SUBITEMIMAGES))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 0.08*$width) ; Получить
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 0.08*$width) ; Удалить
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 0.04*$width) ; №
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 0.055*$width) ; Новое
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 4, 0.085*$width) ; Скачанное
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 5, 0.105*$width) ; Отправитель
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 6, 0.32*$width) ; Тема
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 7, 0.19*$width) ; Получено
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 8, 0.09*$width) ; Размер в килобайтах
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 9, 0.25*$width) ; UIDL
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 10, 0.25*$width) ; E-mail
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 11, 0.25*$width) ; Размер в байтах
_GUICtrlListView_RegisterSortCallBack(-1)
;~ GUICtrlSetState (-1, $GUI_DISABLE)
;~ _GUICtrlListView_HideColumn($List3_1, 9)
;~ _GUICtrlListView_HideColumn($List3_1, 10)
;~ _GUICtrlListView_HideColumn($List3_1, 11)
GUISetState(@SW_SHOW, $Window3)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY2")
$hImage = _GUIImageList_Create(16, 16, 5, 3)
_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 110)
_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 131)
_GUICtrlListView_SetImageList($List3_1, $hImage, 1)
Global $indexitem=-1
For $r = 1 to 10
$indexitem +=1
_GUICtrlListView_AddItem ($List3_1, "", 1)
_GUICtrlListView_AddSubItem ($List3_1, $indexitem, "", 1, 0)
Next
While 1
$msg = GUIGetMsg ()
Switch $msg
Case $Checkbox3a_1
If GUICtrlRead ($Checkbox3a_1) = $GUI_CHECKED Then
For $e = 0 to $indexitem
_GUICtrlListView_SetItemImage ($List3_1, $e, 0, 0)
Next
ElseIf GUICtrlRead ($Checkbox3a_1) = $GUI_UNCHECKED Then
For $e = 0 to $indexitem
_GUICtrlListView_SetItemImage ($List3_1, $e, 1, 0)
Next
EndIf
Case $Checkbox3a_2
If GUICtrlRead ($Checkbox3a_2) = $GUI_CHECKED Then
For $e = 0 to $indexitem
_GUICtrlListView_SetItemImage ($List3_1, $e, 0, 1)
Next
ElseIf GUICtrlRead ($Checkbox3a_2) = $GUI_UNCHECKED Then
For $e = 0 to $indexitem
_GUICtrlListView_SetItemImage ($List3_1, $e, 1, 1)
Next
EndIf
Case $GUI_EVENT_CLOSE
GUIDelete ($Window3)
;~ _ExitApp ()
Exit
EndSwitch
WEnd
Func WM_NOTIFY2($hWnd, $iMsg, $iwParam, $ilParam)
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
$hWndListView = $List3_1
If Not IsHWnd($List3_1) Then $hWndListView = GUICtrlGetHandle($List3_1)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndListView
Switch $iCode
Case $NM_CLICK
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
$fitemindex = DllStructGetData($tInfo, "Index")
$fsubitemindex = DllStructGetData($tInfo, "SubItem")
$fcurrentitemimage = _GUICtrlListView_GetItemImage ($hWndListView, $fitemindex, $fsubitemindex)
If $fsubitemindex = 0 Or $fsubitemindex = 1 Then
If $fcurrentitemimage = 0 Then
_GUICtrlListView_SetItemImage ($hWndListView, $fitemindex, 1, $fsubitemindex)
ElseIf $fcurrentitemimage = 1 Then
_GUICtrlListView_SetItemImage ($hWndListView, $fitemindex, 0, $fsubitemindex)
EndIf
EndIf
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY2