VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "cHeaderControl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Implements GXISubclass


Private Const GMEM_FIXED                                As Long = &H0
Private Const GMEM_ZEROINIT                             As Long = &H40
Private Const GWL_STYLE                                 As Long = (-16)
Private Const WS_BORDER                                 As Long = &H800000
Private Const WS_CAPTION                                As Long = &HC00000
Private Const WS_CHILD                                  As Long = &H40000000
Private Const WS_MAXIMIZEBOX                            As Long = &H10000
Private Const WS_MINIMIZE                               As Long = &H20000000
Private Const WS_MINIMIZEBOX                            As Long = &H20000
Private Const WS_OVERLAPPED                             As Long = &H0&
Private Const WS_POPUP                                  As Long = &H80000000
Private Const WS_SYSMENU                                As Long = &H80000
Private Const WS_THICKFRAME                             As Long = &H40000
Private Const WS_VISIBLE                                As Long = &H10000000
Private Const WS_OVERLAPPEDWINDOW                       As Double = _
    (WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX)
Private Const SW_HIDE                                   As Long = 0
Private Const SW_SHOW                                   As Long = 5
Private Const FW_NORMAL                                 As Long = 400
Private Const FW_BOLD                                   As Long = 700
Private Const LOGPIXELSY                                As Long = 90
Private Const DT_LEFT                                   As Long = &H0
Private Const DT_CENTER                                 As Long = &H1
Private Const DT_RIGHT                                  As Long = &H2
Private Const DT_VCENTER                                As Long = &H4
Private Const DT_SINGLELINE                             As Long = &H20
Private Const DT_CALCRECT                               As Long = &H400
Private Const DT_END_ELLIPSIS                           As Long = &H8000&
Private Const DT_RTLREADING                             As Long = &H20000
Private Const PS_SOLID                                  As Long = 0
Private Const Transparent                               As Long = 1
Private Const OPAQUE                                    As Long = 2
Private Const ILC_MASK                                  As Long = &H1
Private Const ILC_COLOR32                               As Long = &H20
Private Const ILD_TRANSPARENT                           As Long = &H1
Private Const CCM_FIRST                                 As Long = &H2000
Private Const CCM_SETUNICODEFORMAT                      As Double = (CCM_FIRST + 5)
Private Const CCM_GETUNICODEFORMAT                      As Double = (CCM_FIRST + 6)
Private Const WC_HEADERA                                As String = "SysHeader32"
Private Const WC_HEADER                                 As String = WC_HEADERA
Private Const HDS_HORZ                                  As Long = &H0
Private Const HDS_BUTTONS                               As Long = &H2
Private Const HDS_HOTTRACK                              As Long = &H4
Private Const HDS_DRAGDROP                              As Long = &H40
Private Const HDS_FULLDRAG                              As Long = &H80
Private Const HDS_FILTERBAR                             As Long = &H100
Private Const HDI_WIDTH                                 As Long = &H1
Private Const HDI_TEXT                                  As Long = &H2
Private Const HDI_FORMAT                                As Long = &H4
Private Const HDI_LPARAM                                As Long = &H8
Private Const HDI_IMAGE                                 As Long = &H20
Private Const HDI_ORDER                                 As Long = &H80
Private Const HDI_FILTER                                As Long = &H100
Private Const HDF_LEFT                                  As Long = 0
Private Const HDF_RIGHT                                 As Long = 1
Private Const HDF_CENTER                                As Long = 2
Private Const HDF_RTLREADING                            As Long = 4
Private Const HDF_SORTUP                                As Long = &H400
Private Const HDF_SORTDOWN                              As Long = &H200
Private Const HDF_BITMAP_ON_RIGHT                       As Long = &H1000
Private Const HDF_IMAGE                                 As Long = &H800
Private Const HDF_OWNERDRAW                             As Long = &H8000
Private Const HDF_STRING                                As Long = &H4000
Private Const HDFT_ISSTRING                             As Long = &H0
Private Const HDM_FIRST                                 As Long = &H1200
Private Const HDM_GETITEMCOUNT                          As Double = (HDM_FIRST + 0)
Private Const HDM_INSERTITEMA                           As Double = (HDM_FIRST + 1)
Private Const HDM_INSERTITEMW                           As Double = (HDM_FIRST + 10)
Private Const HDM_INSERTITEM                            As Long = HDM_INSERTITEMA
Private Const HDM_DELETEITEM                            As Double = (HDM_FIRST + 2)
Private Const HDM_GETITEMA                              As Double = (HDM_FIRST + 3)
Private Const HDM_GETITEMW                              As Double = (HDM_FIRST + 11)
Private Const HDM_GETITEM                               As Long = HDM_GETITEMA
Private Const HDM_SETITEMA                              As Double = (HDM_FIRST + 4)
Private Const HDM_SETITEMW                              As Double = (HDM_FIRST + 12)
Private Const HDM_SETITEM                               As Long = HDM_SETITEMA
Private Const HDM_LAYOUT                                As Double = (HDM_FIRST + 5)
Private Const HDM_HITTEST                               As Double = (HDM_FIRST + 6)
Private Const HDM_GETITEMRECT                           As Double = (HDM_FIRST + 7)
Private Const HDM_SETIMAGELIST                          As Double = (HDM_FIRST + 8)
Private Const HDM_GETIMAGELIST                          As Double = (HDM_FIRST + 9)
Private Const HDM_CREATEDRAGIMAGE                       As Double = (HDM_FIRST + 16)
Private Const HDM_SETHOTDIVIDER                         As Double = (HDM_FIRST + 19)
Private Const HDM_SETFILTERCHANGETIMEOUT                As Double = (HDM_FIRST + 22)
Private Const HDM_EDITFILTER                            As Double = (HDM_FIRST + 23)
Private Const HDM_CLEARFILTER                           As Double = (HDM_FIRST + 24)
Private Const H_MAX                                     As Long = &HFFFF + 1
Private Const HDN_FIRST                                 As Long = H_MAX - 300
Private Const HDN_ITEMCLICKA                            As Double = (HDN_FIRST - 2)
Private Const HDN_ITEMCLICKW                            As Double = (HDN_FIRST - 22)
Private Const HDN_ITEMDBLCLICKA                         As Double = (HDN_FIRST - 3)
Private Const HDN_ITEMDBLCLICKW                         As Double = (HDN_FIRST - 23)
Private Const HDN_DIVIDERDBLCLICKA                      As Double = (HDN_FIRST - 5)
Private Const HDN_DIVIDERDBLCLICKW                      As Double = (HDN_FIRST - 25)
Private Const HDN_BEGINTRACKA                           As Double = (HDN_FIRST - 6)
Private Const HDN_BEGINTRACKW                           As Double = (HDN_FIRST - 26)
Private Const HDN_ENDTRACKA                             As Double = (HDN_FIRST - 7)
Private Const HDN_ENDTRACKW                             As Double = (HDN_FIRST - 27)
Private Const HDN_TRACKA                                As Double = (HDN_FIRST - 8)
Private Const HDN_TRACKW                                As Double = (HDN_FIRST - 28)
Private Const HDN_BEGINDRAG                             As Double = (HDN_FIRST - 10)
Private Const HDN_ENDDRAG                               As Double = (HDN_FIRST - 11)
Private Const HDN_FILTERCHANGE                          As Double = (HDN_FIRST - 12)
Private Const HDN_FILTERBTNCLICK                        As Double = (HDN_FIRST - 13)
Private Const NM_FIRST                                  As Long = H_MAX
Private Const NM_RCLICK                                 As Double = (NM_FIRST - 5)
Private Const NM_RELEASEDCAPTURE                        As Double = (NM_FIRST - 16)
Private Const WM_USER                                   As Long = &H400
Private Const UM_STARTDRAG                              As Long = WM_USER + &H113
Private Const UM_ENDDRAG                                As Long = WM_USER + &H114
Private Const LVCF_TEXT                                 As Long = &H4
Private Const LVM_FIRST                                 As Long = &H1000
Private Const LVM_GETCOLUMN                             As Long = (LVM_FIRST + 25)
Private Const LVM_GETHEADER                             As Long = (LVM_FIRST + 31)
Private Const LVCF_IMAGE                                As Long = &H10


Public Enum EHdrTextAlign
    HdrTextALignLeft = HDF_LEFT
    HdrTextALignCentre = HDF_CENTER
    HdrTextALignRight = HDF_RIGHT
    HdrTextAlignRTLReading = HDF_RTLREADING
End Enum

Public Enum EHdrSortBitmapTypes
    HdrSortBitmapNone = 0
    HdrSortBitmapUp = HDF_SORTUP
    HdrSortBitmapDown = HDF_SORTDOWN
End Enum

Private Enum TRACKMOUSEEVENT_FLAGS
    TME_HOVER = &H1&
    TME_LEAVE = &H2&
    TME_QUERY = &H40000000
    TME_CANCEL = &H80000000
End Enum


Private Type RECT
    left                                                    As Long
    top                                                     As Long
    right                                                   As Long
    bottom                                                  As Long
End Type

Private Type POINTAPI
    x                                                       As Long
    y                                                       As Long
End Type

Private Type LOGFONT
    lfHeight                                        As Long
    lfWidth                                         As Long
    lfEscapement                                    As Long
    lfOrientation                                   As Long
    lfWeight                                        As Long
    lfItalic                                        As Byte
    lfUnderline                                     As Byte
    lfStrikeOut                                     As Byte
    lfCharSet                                       As Byte
    lfOutPrecision                                  As Byte
    lfClipPrecision                                 As Byte
    lfQuality                                       As Byte
    lfPitchAndFamily                                As Byte
    lfFaceName(32)                                  As Byte
End Type

Private Type tGroupCol
    lColumn                                                 As Long
    lOrigColSize                                            As Long
    lOrigColOrder                                           As Long
    tR                                                      As RECT
    bMouseOver                                              As Boolean
    bPressed                                                As Boolean
    sXMouseDown                                             As Single
    sYMouseDown                                             As Single
End Type

Private Type HD_HITTESTINFO
    pt                                                      As POINTAPI
    flags                                                   As Long
    iItem                                                   As Long
End Type

Private Type HDITEMA
    Mask                                                    As Long
    cxy                                                     As Long
    pszText                                                 As String
    hbm                                                     As Long
    cchTextMax                                              As Long
    fmt                                                     As Long
    lParam                                                  As Long
    iImage                                                  As Long
    iOrder                                                  As Long
    type                                                    As Long
    pvFilter                                                As Long
End Type

Private Type HDITEMW
    Mask                                                    As Long
    cxy                                                     As Long
    pszText                                                 As Long
    hbm                                                     As Long
    cchTextMax                                              As Long
    fmt                                                     As Long
    lParam                                                  As Long
    iImage                                                  As Long
    iOrder                                                  As Long
type                                                    As Long
    pvFilter                                                As Long
End Type

Private Type NMHDR
    hwndFrom                                                As Long
    idfrom                                                  As Long
    code                                                    As Long
End Type

Private Type HDNOITFYA
    hdr                                                     As NMHDR
    iItem                                                   As Long
    iButton                                                 As Long
    pitem                                                   As HDITEMA
End Type

Private Type HDNOITFYW
    hdr                                                     As NMHDR
    iItem                                                   As Long
    iButton                                                 As Long
    pitem                                                   As HDITEMW
End Type

Private Type NMHEADER
    hdr                                                     As NMHDR
    iItem                                                   As Long
    iButton                                                 As Long
    lPtrHDItem                                              As Long
End Type

Private Type HDTEXTFILTER
    pszText                                                 As Long
    cchTextMax                                              As Long
End Type

Private Type WINDOWPOS
    hwnd                                                    As Long
    hWndInsertAfter                                         As Long
    x                                                       As Long
    y                                                       As Long
    cx                                                      As Long
    cy                                                      As Long
    flags                                                   As Long
End Type

Private Type HDLAYOUT
    lprc                                                    As Long
    lpwpos                                                  As Long
End Type

Private Type PAINTSTRUCT
    hdc                                                     As Long
    fErase                                                  As Boolean
    rcPaint                                                 As RECT
    fRestore                                                As Boolean
    fIncUpdate                                              As Boolean
    rgbReserved(32)                                         As Byte
End Type

Private Type LVCOLUMN
    Mask                                                    As Long
    fmt                                                     As Long
    cx                                                      As Long
    pszText                                                 As Long
    cchTextMax                                              As Long
    iSubItem                                                As Long
    iImage                                                  As Long
    iOrder                                                  As Long
End Type

Private Type BITMAP
    bmType                                                  As Long
    bmWidth                                                 As Long
    bmHeight                                                As Long
    bmWidthBytes                                            As Long
    bmPlanes                                                As Integer
    bmBitsPixel                                             As Integer
    bmBits                                                  As Long
End Type

Private Type HDHITTESTINFO
    pt                                                      As POINTAPI
    flags                                                   As Long
    iItem                                                   As Long
End Type


Private Type TCRD
    lO                                                      As Integer
    Hi                                                      As Integer
End Type

Private Type TCLC
    lBase                                                   As Long
End Type

Private Type TRACKMOUSEEVENT_STRUCT
    cbSize                                                  As Long
    dwFlags                                                 As TRACKMOUSEEVENT_FLAGS
    hwndTrack                                               As Long
    dwHoverTime                                             As Long
End Type



Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpvDest As Any, _
                                                                     lpvSource As Any, _
                                                                     ByVal cbCopy As Long)

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, _
                                                                            ByVal nIndex As Long, _
                                                                            ByVal dwNewLong As Long) As Long

Private Declare Function SetWindowLongW Lib "user32" (ByVal hwnd As Long, _
                                                      ByVal nIndex As Long, _
                                                      ByVal dwNewLong As Long) As Long

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, _
                                                                            ByVal nIndex As Long) As Long

Private Declare Function GetWindowLongW Lib "user32" (ByVal hwnd As Long, _
                                                      ByVal nIndex As Long) As Long

Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, _
                                                                              ByVal lpClassName As String, _
                                                                              ByVal lpWindowName As String, _
                                                                              ByVal dwStyle As Long, _
                                                                              ByVal x As Long, _
                                                                              ByVal y As Long, _
                                                                              ByVal nWidth As Long, _
                                                                              ByVal nHeight As Long, _
                                                                              ByVal hWndParent As Long, _
                                                                              ByVal hMenu As Long, _
                                                                              ByVal hInstance As Long, _
                                                                              lpParam As Any) As Long

Private Declare Function CreateWindowExW Lib "user32" (ByVal dwExStyle As Long, _
                                                       ByVal lpClassName As Long, _
                                                       ByVal lpWindowName As Long, _
                                                       ByVal dwStyle As Long, _
                                                       ByVal x As Long, _
                                                       ByVal y As Long, _
                                                       ByVal nWidth As Long, _
                                                       ByVal nHeight As Long, _
                                                       ByVal hWndParent As Long, _
                                                       ByVal hMenu As Long, _
                                                       ByVal hInstance As Long, _
                                                       lpParam As Any) As Long

Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
                                                  ByVal nCmdShow As Long) As Long

Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long

Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, _
                                                    ByVal fEnable As Long) As Long

Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, _
                                                  ByVal x As Long, _
                                                  ByVal y As Long, _
                                                  ByVal nWidth As Long, _
                                                  ByVal nHeight As Long, _
                                                  ByVal bRepaint As Long) As Long

Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, _
                                                     lpRect As RECT) As Long

Private Declare Function InflateRect Lib "user32" (lpRect As RECT, _
                                                   ByVal x As Long, _
                                                   ByVal y As Long) As Long

Private Declare Function InvalidateRect Lib "user32" (ByVal hwnd As Long, _
                                                      lpRect As RECT, _
                                                      ByVal bErase As Long) As Long

Private Declare Function PtInRect Lib "user32" (lpRect As RECT, _
                                                ByVal ptX As Long, _
                                                ByVal ptY As Long) As Long

Private Declare Function UpdateWindow Lib "user32" (ByVal hwnd As Long) As Long

Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, _
                                                 ByVal hWndNewParent As Long) As Long

Private Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, _
                                                      lpPoint As POINTAPI) As Long

Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, _
                                                     lpRect As RECT) As Long

Private Declare Function SendMessageLongA Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _
                                                                             ByVal wMsg As Long, _
                                                                             ByVal wParam As Long, _
                                                                             ByVal lParam As Long) As Long

Private Declare Function SendMessageLongW Lib "user32" Alias "SendMessageW" (ByVal hwnd As Long, _
                                                                             ByVal wMsg As Long, _
                                                                             ByVal wParam As Long, _
                                                                             ByVal lParam As Long) As Long

Private Declare Function SendMessageA Lib "user32" (ByVal hwnd As Long, _
                                                    ByVal wMsg As Long, _
                                                    ByVal wParam As Long, _
                                                    lParam As Any) As Long

Private Declare Function SendMessageW Lib "user32" (ByVal hwnd As Long, _
                                                    ByVal wMsg As Long, _
                                                    ByVal wParam As Long, _
                                                    lParam As Any) As Long

Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, _
                                                                        ByVal wMsg As Long, _
                                                                        ByVal wParam As Long, _
                                                                        ByVal lParam As Long) As Long

Private Declare Function CreateDc Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName As String, _
                                                                 lpDeviceName As Any, _
                                                                 lpOutput As Any, _
                                                                 lpInitData As Any) As Long

Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long

Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

Private Declare Function GetVersion Lib "kernel32" () As Long

Private Declare Function lstrlenA Lib "kernel32" (ByVal lpString As Long) As Long

Private Declare Function lstrlenW Lib "kernel32" (ByVal lpString As Long) As Long

Private Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (lpLogFont As LOGFONT) As Long

Private Declare Function MulDiv Lib "kernel32" (ByVal nNumber As Long, _
                                                ByVal nNumerator As Long, _
                                                ByVal nDenominator As Long) As Long

Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, _
                                                   ByVal hObject As Long) As Long

Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long

Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, _
                                                    ByVal nIndex As Long) As Long

Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, _
                                                             ByVal nWidth As Long, _
                                                             ByVal nHeight As Long) As Long

Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long

Private Declare Function DrawTextA Lib "user32" (ByVal hdc As Long, _
                                                 ByVal lpStr As String, _
                                                 ByVal nCount As Long, _
                                                 lpRect As RECT, _
                                                 ByVal wFormat As Long) As Long

Private Declare Function DrawTextW Lib "user32" (ByVal hdc As Long, _
                                                 ByVal lpStr As Long, _
                                                 ByVal nCount As Long, _
                                                 lpRect As RECT, _
                                                 ByVal wFormat As Long) As Long

Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, _
                                                ByVal nWidth As Long, _
                                                ByVal crColor As Long) As Long

Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long

Private Declare Function GetSysColorBrush Lib "user32" (ByVal nIndex As Long) As Long

Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long

Private Declare Function FillRect Lib "user32" (ByVal hdc As Long, _
                                                lpRect As RECT, _
                                                ByVal hBrush As Long) As Long

Private Declare Function SetBkColor Lib "gdi32" (ByVal hdc As Long, _
                                                 ByVal crColor As Long) As Long

Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, _
                                                ByVal nBkMode As Long) As Long

Private Declare Function SetTextColor Lib "gdi32" (ByVal hdc As Long, _
                                                   ByVal crColor As Long) As Long

Private Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, _
                                               ByVal x As Long, _
                                               ByVal y As Long, _
                                               lpPoint As POINTAPI) As Long

Private Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, _
                                             ByVal x As Long, _
                                             ByVal y As Long) As Long

Private Declare Sub InitCommonControls Lib "comctl32.dll" ()

Private Declare Function ImageList_Create Lib "Comctl32" (ByVal cx As Long, _
                                                          ByVal cy As Long, _
                                                          ByVal flags As Long, _
                                                          ByVal cInitial As Long, _
                                                          ByVal cGrow As Long) As Long

Private Declare Function ImageList_AddMasked Lib "Comctl32" (ByVal hIml As Long, _
                                                             ByVal hbmImage As Long, _
                                                             ByVal crMask As Long) As Long

Private Declare Function ImageList_GetImageCount Lib "Comctl32" (ByVal hImagelist As Long) As Long

Private Declare Function ImageList_Destroy Lib "Comctl32" (ByVal hImagelist As Long) As Long

Private Declare Function ImageList_Draw Lib "Comctl32" (ByVal hIml As Long, _
                                                        ByVal i As Long, _
                                                        ByVal hdcDst As Long, _
                                                        ByVal x As Long, _
                                                        ByVal y As Long, _
                                                        ByVal fStyle As Long) As Long

Private Declare Function ImageList_GetIconSize Lib "Comctl32" (ByVal hIml As Long, _
                                                               cx As Long, _
                                                               cy As Long) As Long

Private Declare Function BeginPaint Lib "user32" (ByVal hwnd As Long, _
                                                  lpPaint As PAINTSTRUCT) As Long

Private Declare Function EndPaint Lib "user32" (ByVal hwnd As Long, _
                                                lpPaint As PAINTSTRUCT) As Long

Private Declare Function GetDesktopWindow Lib "user32" () As Long

Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long

Private Declare Function GetDC Lib "user32.dll" (ByVal hwnd As Long) As Long

Private Declare Function OffsetRect Lib "user32" (lpRect As RECT, _
                                                  ByVal x As Long, _
                                                  ByVal y As Long) As Long

Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, _
                                                                   ByVal nCount As Long, _
                                                                   lpObject As Any) As Long

Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, _
                                                 ByVal hdc As Long) As Long

Private Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (ByVal hdc As Long, _
                                                                                         ByVal lpsz As String, _
                                                                                         ByVal cbString As Long, _
                                                                                         lpSize As POINTAPI) As Long

Private Declare Function PathCompactPath Lib "shlwapi.dll" Alias "PathCompactPathA" (ByVal hdc As Long, _
                                                                                     ByVal pszPath As String, _
                                                                                     ByVal dX As Long) As Long

Private Declare Function CopyRect Lib "user32" (lpDestRect As RECT, _
                                                lpSourceRect As RECT) As Long

Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer


Private Declare Function TrackMouseEvent Lib "user32" (lpEventTrack As TRACKMOUSEEVENT_STRUCT) As Long

Private Declare Function TrackMouseEventComCtl Lib "Comctl32" Alias "_TrackMouseEvent" (lpEventTrack As TRACKMOUSEEVENT_STRUCT) As Long

Private Declare Function GetModuleHandleA Lib "kernel32" (ByVal lpModuleName As String) As Long

Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, _
                                                        ByVal lpProcName As String) As Long

Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long

Private Declare Function LoadLibraryA Lib "kernel32" (ByVal lpLibFileName As String) As Long


Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, _
                                               ByVal x As Long, _
                                               ByVal y As Long) As Long

Public Event ColumnWidthChanged(ByVal lColumn As Long, lWidth As Long)
Public Event ColumnWidthChanging(ByVal lColumn As Long, lWidth As Long, bCancel As Boolean)
Public Event StartColumnWidthChange(ByVal lColumn As Long, lWidth As Long, bCancel As Boolean)
Public Event DividerDblClick(ByVal lColumn As Long)
Public Event ColumnClick(ByVal lColumn As Long)
Public Event ColumnDblClick(ByVal lColumn As Long)
Public Event ColumnBeginDrag(ByVal lColumn As Long)
Public Event ColumnManualDragRequest(ByVal lColumn As Long, ByRef bForceManualDragDrop As Boolean)
Public Event ColumnEndDrag(ByVal lColumn As Long, ByVal lOrder As Long)
Public Event ColumnFilterClick(ByVal lColumn As Long)
Public Event ColumnFilterChange(ByVal lColumn As Long, ByVal sFilter As String)
Public Event RightClick(ByVal x As Single, ByVal y As Single)
Public Event Resize()
Public Event RePaint()
Public Event OleDrag()
Public Event ColumnGroupChange(lColumn As Long)
Public Event ColumnUnGroup(lColumn As Long)

Private m_bInitSize                                     As Boolean
Private m_bVisible                                      As Boolean
Private m_bUserMode                                     As Boolean
Private m_bIsNt                                         As Boolean
Private m_bAllowGrouping                                As Boolean
Private m_bHideGroupingBox                              As Boolean
Private m_bSubClass                                     As Boolean
Private m_bHotTrack                                     As Boolean
Private m_bDragReorderColumns                           As Boolean
Private m_bButtons                                      As Boolean
Private m_bFullDrag                                     As Boolean
Private m_bFilterBar                                    As Boolean
Private m_bEnabled                                      As Boolean
Private m_bPreventDrag                                  As Boolean
Private m_bHidingDragImage                              As Boolean
Private m_bCustomHeader                                 As Boolean
Private m_bPainting                                     As Boolean
Private m_bTrackUser32                                  As Boolean
Private m_bSkinLoaded                                   As Boolean
Private m_bHeaderClrAuto                                As Boolean
Private m_bGutterButtonSkinned                          As Boolean
Private m_bUseHeaderTheme                               As Boolean
Private m_lHeaderLuminence                              As Long
Private m_lThemeColor                                   As Long
Private m_lHeaderSkinStyle                              As Long
Private m_lGutterButtonColor                            As Long
Private m_lHeaderBgColor                                As Long
Private m_lTextForeColor                                As Long
Private m_lTextHighLite                                 As Long
Private m_lParentHwnd                                   As Long
Private m_lHdrHandle                                    As Long
Private m_lHeaderWidth                                  As Long
Private m_lHeaderHeight                                 As Long
Private m_lImlHandle                                    As Long
Private m_lHdc()                                        As Long
Private m_lBmp()                                        As Long
Private m_lBmpOld()                                     As Long
Private m_lCurrState                                    As Long
Private m_hFnt                                          As Long
Private m_hIml                                          As Long
Private m_hImlDragImageList                             As Long
Private m_lFilterChangeTimeOut                          As Long
Private m_iGroupedHeaderCount                           As Long
Private m_lCol                                          As Long
Private m_lCXY                                          As Long
Private m_lColOrder                                     As Long
Private m_lR                                            As Long
Private m_iDragCol                                      As Long
Private m_lLastDivider                                  As Long
Private m_lDragCandidateBefore                          As Long
Private m_lDragCandidateAfter                           As Long
Private m_sngLuminence                                  As Single
Private m_sGroupBoxHintText                             As String
Private m_sTag()                                        As String
Private m_cDrag                                         As cImageListDrag
Private m_tULF                                          As LOGFONT
Private m_tR                                            As RECT
Private m_tFont                                         As LOGFONT
Private m_font                                          As StdFont
Private m_pHeader                                       As StdPicture
Private m_tGroupedCol()                                 As tGroupCol
Private WithEvents m_tmrDragDrop                        As clsTimer
Attribute m_tmrDragDrop.VB_VarHelpID = -1
Private m_cRender                                       As clsRender
Private m_cHeaderDc                                     As clsStoreDc
Private m_GXHeader                                      As GXMSubclass


Private Sub Class_Initialize()

    'm_bCustomHeader = True
    '/* Ensure that the common control DLL is loaded
    InitCommonControls
    m_bTrackUser32 = FunctionExported("TrackMouseEvent", "User32")
    '/* default colors
    m_lTextForeColor = &H111111
    m_lTextHighLite = &H676767
    
    '/* Are we running NT
    Dim lVer As Long
    lVer = GetVersion()
    m_bIsNt = ((lVer And &H80000000) = 0)
    
    '/* Enabled default
    m_bEnabled = True
    '/* default to 2s
    m_lFilterChangeTimeOut = 2000
    m_lCol = -1
   ' m_sGroupBoxHintText = DEFAULT_GROUPBOX_HINT_TEXT
    HotTrack = True
    DragReOrderColumns = True
    HasButtons = True
    FullDrag = False

    Set m_cDrag = New cImageListDrag
    Set m_tmrDragDrop = New clsTimer
   
End Sub

Friend Property Get AllowGrouping() As Boolean
    AllowGrouping = m_bAllowGrouping
End Property

Friend Property Let AllowGrouping(ByVal Value As Boolean)

    If Not (m_bAllowGrouping = Value) Then
        m_bAllowGrouping = Value
        If Not (m_bAllowGrouping) Then
            Do While (m_iGroupedHeaderCount > 0)
                ColumnIsGrouped(m_tGroupedCol(1).lColumn) = False
            Loop
        End If
        RaiseEvent Resize
    End If
   
End Property

Friend Property Get ColumnAtIndex(ByVal lIndex As Long) As Long

Dim i As Long

    For i = 0 To ColumnCount - 1
        If (ColumnIndex(i) = lIndex) Then
            ColumnAtIndex = i
            Exit For
        End If
    Next i
   
End Property

Friend Property Get ColumnCount() As Long

    m_lR = SendMessageLongA(m_lHdrHandle, HDM_GETITEMCOUNT, 0&, 0&)
    ColumnCount = m_lR
    
End Property

Friend Property Get ColumnExtraData(ByVal lColumn As Long) As Long

Dim tHI As HDITEMA

    tHI.Mask = HDI_LPARAM
    If (pbGetHeaderItemInfo(lColumn, tHI)) Then
        ColumnExtraData = tHI.lParam
    Else
        debugmsg "Get column extra data error"
    End If

End Property

Friend Property Let ColumnExtraData(ByVal lColumn As Long, _
                                    ByVal lExtraData As Long)

Dim tHI As HDITEMA

    tHI.Mask = HDI_LPARAM
    tHI.lParam = lExtraData
    If Not (pbSetHeaderItemInfo(lColumn, tHI)) Then
        debugmsg "Set column extra data error"
    End If
    
End Property

Friend Property Get ColumnFilter(ByVal lColumn As Long) As String

Dim sFilter As String
Dim tHI     As HDITEMA

    tHI.Mask = HDI_FILTER
    If (pbGetHeaderItemInfo(lColumn, tHI, sFilter)) Then
        ColumnFilter = sFilter
    End If
   
End Property

Friend Property Let ColumnFilter(ByVal lColumn As Long, _
                                 ByVal sFilter As String)

    If Len(sFilter) = 0 Then
        '/* Clear the filter:
        If m_bIsNt Then
            SendMessageLongW m_lHdrHandle, HDM_CLEARFILTER, lColumn, 0
        Else
            SendMessageLongA m_lHdrHandle, HDM_CLEARFILTER, lColumn, 0
        End If
    Else
        '/* Add the text to the filter:
        Dim tHI As HDITEMA
        tHI.Mask = HDI_FILTER
        tHI.type = HDFT_ISSTRING
        If pbSetHeaderItemInfo(lColumn, tHI, sFilter) Then
        Else
            debugmsg "Failed to set filter."
        End If
    End If
    
End Property

Friend Property Get ColumnGroupCount() As Long
    ColumnGroupCount = m_iGroupedHeaderCount
End Property

Friend Property Get ColumnHeader(ByVal lColumn As Long) As String

Dim iPos        As Long
Dim sColHeader  As String
Dim tHI         As HDITEMA

    tHI.cchTextMax = 255
    sColHeader = String$(tHI.cchTextMax, Chr$(0))
    tHI.Mask = HDI_TEXT
    tHI.pszText = sColHeader
    If (pbGetHeaderItemInfo(lColumn, tHI)) Then
        sColHeader = tHI.pszText
        iPos = InStr(sColHeader, Chr$(0))
        If Not (iPos = 0) Then
            ColumnHeader = left$(sColHeader, iPos - 1)
        Else
            ColumnHeader = sColHeader
        End If
    Else
        debugmsg "Get column header text error"
    End If
   
End Property

Friend Property Let ColumnHeader(ByVal lColumn As Long, _
                                 ByVal sText As String)

Dim tHI As HDITEMA

    With tHI
        .cchTextMax = Len(sText)
        If (sText = "") Then
            .pszText = vbNullChar
        Else
            .pszText = sText
        End If
        .Mask = HDI_TEXT
    End With
    If pbSetHeaderItemInfo(lColumn, tHI) Then
        If (ColumnIsGrouped(lColumn)) Then
            RaiseEvent RePaint
        End If
    Else
        debugmsg "Set column header text error"
    End If
   
End Property

Friend Property Get ColumnHeaderFromPoint(ByVal x As Long, _
                                          ByVal y As Long) As Long

Dim lCol    As Long
Dim i       As Long
   
    lCol = -1
    For i = 1 To m_iGroupedHeaderCount
        If Not (PtInRect(m_tGroupedCol(i).tR, x, y) = 0) Then
            ColumnHeaderFromPoint = m_tGroupedCol(i).lColumn
            Exit Property
        End If
    Next i

    If (y >= m_tR.top) And (y <= m_tR.bottom) Then
        Dim xLast As Long
        Dim lWidth As Long
        xLast = m_tR.left
        For i = 0 To ColumnCount - 1
            lCol = ColumnAtIndex(i)
            If Not (ColumnIsGrouped(lCol)) Then
                lWidth = ColumnWidth(lCol)
                If (x >= xLast) And (x < xLast + lWidth) Then
                    ColumnHeaderFromPoint = lCol
                    Exit Property
                End If
                xLast = xLast + lWidth
            End If
        Next i
    End If
    ColumnHeaderFromPoint = lCol
   
End Property

Friend Property Get ColumnImageOnRight(ByVal lColumn As Long) As Boolean

Dim tHI As HDITEMA

   tHI.Mask = HDI_FORMAT
   If (pbGetHeaderItemInfo(lColumn, tHI)) Then
      ColumnImageOnRight = ((tHI.fmt And HDF_BITMAP_ON_RIGHT) = HDF_BITMAP_ON_RIGHT)
   End If
   
End Property

Friend Property Let ColumnImageOnRight(ByVal lColumn As Long, _
                                       ByVal bState As Boolean)

Dim tHI As HDITEMA

    With tHI
        .Mask = HDI_FORMAT
        If (pbGetHeaderItemInfo(lColumn, tHI)) Then
            If bState Then
                .fmt = .fmt Or HDF_BITMAP_ON_RIGHT
            Else
                .fmt = .fmt And Not HDF_BITMAP_ON_RIGHT
            End If
            If (pbSetHeaderItemInfo(lColumn, tHI)) Then
                If (ColumnIsGrouped(lColumn)) Then
                    RaiseEvent RePaint
                End If
            Else
                debugmsg "Failed to set image on right property"
            End If
        End If
    End With
    
End Property

Friend Property Get ColumnGroupOrder(ByVal lColumn As Long) As Long

Dim i   As Long
Dim lr  As Long

    lr = 0
    For i = 1 To m_iGroupedHeaderCount
        If (m_tGroupedCol(i).lColumn = lColumn) Then
            lr = i
            Exit For
        End If
    Next i
    ColumnGroupOrder = lr - 1
   
End Property

Friend Property Let ColumnGroupOrder(ByVal lColumn As Long, _
                                     ByVal lOrder As Long)

Dim i               As Long
Dim lExistingIndex  As Long
Dim tGExisting      As tGroupCol
Dim tHI             As HDITEMA

    '/* Check order index:
    If (lOrder > m_iGroupedHeaderCount) Or (lOrder < -1) Then
        Exit Property
    End If
   
    '/* Find if the column already exists in the groups
    For i = 1 To m_iGroupedHeaderCount
        If (m_tGroupedCol(i).lColumn = lColumn) Then
            lExistingIndex = i
            LSet tGExisting = m_tGroupedCol(i)
            Exit For
        End If
    Next i
            
    If (lOrder = m_iGroupedHeaderCount) Then
        '/* This item wants to be added to the end of the groupings.
        '/* We need to check that it isn't already in the groupings -
        '/* if it is, then you can't add at this order, instead you
        '/* would change the order of the existing item:
        If lExistingIndex > 0 Then
            Exit Property
        End If
        '/* Ok so it wasn't already there, let's add it
        m_iGroupedHeaderCount = m_iGroupedHeaderCount + 1
        ReDim Preserve m_tGroupedCol(1 To m_iGroupedHeaderCount) As tGroupCol
        With m_tGroupedCol(m_iGroupedHeaderCount)
            .lColumn = -1
            .lOrigColOrder = ColumnIndex(lColumn)
            .lOrigColSize = ColumnWidth(lColumn)
            .lColumn = lColumn
        End With
        tHI.Mask = HDI_WIDTH
        tHI.cxy = 0
        pbSetHeaderItemInfo lColumn, tHI
        ColumnIndex(lColumn) = 0
        '/* Resize (we've added something)
        pResize
        '/* Repaint
        RaiseEvent RePaint
    ElseIf (lOrder < 0) Then
        '/* We're removing this column from the grouping
        '/* if it is there
        If (lExistingIndex > 0) Then
            'Debug.Assert "TODO" = ""
        End If
    Else
        '/* Check if this column is already in the grouping:
        If (lExistingIndex > 0) Then
            '/* We are moving this item from the existing location to the new one:
            '/* Check if the column is already at this position:
            If (lExistingIndex = lOrder + 1) Then
            '/* nothing to do
            Else
                '/* Check which direction we're going in:
                If (lExistingIndex - 1 < lOrder) Then
                    '/* Increasing the order.  Move anything from
                    '/* lExistingIndex to lOrder + 1 up one:
                    For i = lExistingIndex To lOrder
                        LSet m_tGroupedCol(i) = m_tGroupedCol(i + 1)
                    Next i
                    '/* Now put this item at lOrder + 1:
                    LSet m_tGroupedCol(lOrder + 1) = tGExisting
                Else
                    '/* Decreasing the order.  Move anything from
                    For i = lExistingIndex - 1 To lOrder + 1 Step -1
                        LSet m_tGroupedCol(i + 1) = m_tGroupedCol(i)
                    Next i
                    '/* Now put this item at lOrder + 1:
                    LSet m_tGroupedCol(lOrder + 1) = tGExisting
                End If
                RaiseEvent RePaint
            End If
        Else
            If (lExistingIndex > 0) Then
                '/* We are inserting this item at the specified index:
                m_iGroupedHeaderCount = m_iGroupedHeaderCount + 1
                ReDim Preserve m_tGroupedCol(1 To m_iGroupedHeaderCount) As tGroupCol
                For i = m_iGroupedHeaderCount To lExistingIndex Step -1
                    LSet m_tGroupedCol(i) = m_tGroupedCol(i - 1)
                Next i
                With m_tGroupedCol(m_iGroupedHeaderCount)
                    .lColumn = -1
                    .lOrigColOrder = ColumnIndex(lColumn)
                    .lOrigColSize = ColumnWidth(lColumn)
                    .lColumn = lColumn
                End With
                tHI.Mask = HDI_WIDTH
                tHI.cxy = 0
                pbSetHeaderItemInfo lColumn, tHI
                ColumnIndex(lColumn) = 0
                '/* Resize (we've added something)
                pResize
                RaiseEvent RePaint
            Else
                '/* inserting this item:
                m_iGroupedHeaderCount = m_iGroupedHeaderCount + 1
                ReDim Preserve m_tGroupedCol(1 To m_iGroupedHeaderCount) As tGroupCol
                For i = m_iGroupedHeaderCount To lOrder + 2 Step -1
                LSet m_tGroupedCol(i) = m_tGroupedCol(i - 1)
                Next i
                With m_tGroupedCol(lOrder + 1)
                    .lColumn = -1
                    .lOrigColOrder = ColumnIndex(lColumn)
                    .lOrigColSize = ColumnWidth(lColumn)
                    .lColumn = lColumn
                End With
                tHI.Mask = HDI_WIDTH
                tHI.cxy = 0
                pbSetHeaderItemInfo lColumn, tHI
                ColumnIndex(lColumn) = 0
                '/* Resize (we've added something)
                pResize
                RaiseEvent RePaint
            End If
        End If
    End If
    
End Property

Friend Property Get ColumnImage(ByVal lColumn As Long) As Long

Dim tHI As HDITEMA

    tHI.Mask = HDI_FORMAT
    If (pbGetHeaderItemInfo(lColumn, tHI)) Then
        If (tHI.fmt And HDF_IMAGE) = HDF_IMAGE Then
            tHI.Mask = HDI_IMAGE
            If (pbGetHeaderItemInfo(lColumn, tHI)) Then
                ColumnImage = tHI.iImage
            Else
                debugmsg "Get column image error"
            End If
        Else
            ColumnImage = -1
        End If
    End If
   
End Property

Friend Property Let ColumnImage(ByVal lColumn As Long, _
                                ByVal lImage As Long)

Dim tHI As HDITEMA

    With tHI
        If Not (ColumnImage(lColumn) = lImage) Then
            .Mask = HDI_FORMAT
            If pbGetHeaderItemInfo(lColumn, tHI) Then
                If (pbValidImage(lImage) < 0) Then
                    .fmt = .fmt Or HDF_IMAGE
                    .Mask = .Mask Or HDI_IMAGE
                    .iImage = lImage
                Else
                    .fmt = .fmt And Not HDF_IMAGE
                End If
                If (pbSetHeaderItemInfo(lColumn, tHI)) Then
                    If (ColumnIsGrouped(lColumn)) Then
                        RaiseEvent RePaint
                    End If
                Else
                    debugmsg "Set column image error"
                End If
            End If
        End If
    End With
   
End Property

Friend Property Get ColumnIndex(ByVal lColumn As Long) As Long

Dim tHI As HDITEMA

    If Not (lColumn = m_lCol) Then
        tHI.Mask = HDI_ORDER
        If (pbGetHeaderItemInfo(lColumn, tHI)) Then
            ColumnIndex = tHI.iOrder
        End If
    Else
        ColumnIndex = m_lColOrder
    End If
   
End Property

Friend Property Get ColumnIsGrouped(ByVal lColumn As Long) As Boolean

Dim i As Long

    For i = 1 To m_iGroupedHeaderCount
        If (m_tGroupedCol(i).lColumn = lColumn) Then
            ColumnIsGrouped = True
            Exit For
        End If
    Next i
   
End Property

Friend Property Let ColumnIsGrouped(ByVal lColumn As Long, _
                                    ByVal bState As Boolean)
    
    ColumnIsGroupedSub lColumn, bState, -1

End Property

Friend Property Let ColumnIndex(ByVal lColumn As Long, _
                                ByVal lOrder As Long)

Dim tHI As HDITEMA

    If Not (ColumnIndex(lColumn) = lOrder) Then
        tHI.Mask = HDI_ORDER
        tHI.iOrder = lOrder
        If Not (pbSetHeaderItemInfo(lColumn, tHI)) Then
            debugmsg "Set column order error"
        End If
    End If
   
End Property

Friend Property Get ColumnOwnerDraw(ByVal lColumn As Long) As Boolean

Dim tHI As HDITEMA

    tHI.Mask = HDI_FORMAT
    If pbGetHeaderItemInfo(lColumn, tHI) Then
        ColumnOwnerDraw = ((tHI.fmt And HDF_OWNERDRAW) = HDF_OWNERDRAW)
    End If
   
End Property

Friend Property Let ColumnOwnerDraw(ByVal lColumn As Long, _
                                    ByVal bState As Boolean)

Dim tHI As HDITEMA

    tHI.Mask = HDI_FORMAT
    If pbGetHeaderItemInfo(lColumn, tHI) Then
        If bState Then
            tHI.fmt = tHI.fmt Or HDF_OWNERDRAW
        Else
            tHI.fmt = tHI.fmt And Not HDF_OWNERDRAW
        End If
        If Not (pbSetHeaderItemInfo(lColumn, tHI)) Then
            debugmsg "Set column owner draw error"
        End If
    End If
   
End Property

Friend Property Get ColumnSortBitmap(ByVal lColumn As Long) As EHdrSortBitmapTypes

Dim tHI As HDITEMA

    tHI.Mask = HDI_FORMAT
    If (pbGetHeaderItemInfo(lColumn, tHI)) Then
        If (tHI.fmt And HdrSortBitmapUp) = HdrSortBitmapUp Then
            ColumnSortBitmap = HdrSortBitmapUp
        ElseIf (tHI.fmt And HdrSortBitmapDown) = HdrSortBitmapDown Then
            ColumnSortBitmap = HdrSortBitmapDown
        Else
            ColumnSortBitmap = HdrSortBitmapNone
        End If
    End If

End Property

Friend Property Let ColumnSortBitmap(ByVal lColumn As Long, _
                                     ByVal eSortBitmapType As EHdrSortBitmapTypes)

Dim tHI As HDITEMA

    tHI.Mask = HDI_FORMAT
    If (pbGetHeaderItemInfo(lColumn, tHI)) Then
        If (eSortBitmapType = HdrSortBitmapDown) Then
            tHI.fmt = tHI.fmt Or HdrSortBitmapDown And Not HdrSortBitmapUp
        ElseIf (eSortBitmapType = HdrSortBitmapUp) Then
            tHI.fmt = tHI.fmt Or HdrSortBitmapUp And Not HdrSortBitmapDown
        Else
            tHI.fmt = tHI.fmt And Not (HdrSortBitmapUp Or HdrSortBitmapDown)
        End If
        If (pbSetHeaderItemInfo(lColumn, tHI)) Then
            If (ColumnIsGrouped(lColumn)) Then
                RaiseEvent RePaint
            End If
        Else
            debugmsg "Failed to set ColumnSortBitmap"
        End If
    End If
   
End Property

Friend Property Get ColumnTag(ByVal lColumn As Long) As String
    ColumnTag = m_sTag(lColumn)
End Property

Friend Property Let ColumnTag(ByVal lColumn As Long, ByVal sTag As String)

    If (lColumn < ColumnCount) Then
        m_sTag(lColumn) = sTag
    Else
        debugmsg "Error setting column tag."
    End If
    
End Property

Friend Property Get ColumnTextAlign(ByVal lColumn As Long) As EHdrTextAlign

Dim tHI As HDITEMA

    tHI.Mask = HDI_FORMAT
    If (pbGetHeaderItemInfo(lColumn, tHI)) Then
        ColumnTextAlign = tHI.fmt And &H7&
    End If
   
End Property

Friend Property Let ColumnTextAlign(ByVal lColumn As Long, _
                                    ByVal eAlign As EHdrTextAlign)

Dim tHI As HDITEMA

    With tHI
        .Mask = HDI_FORMAT
        If (pbGetHeaderItemInfo(lColumn, tHI)) Then
            .fmt = tHI.fmt And Not &H7&
            .fmt = tHI.fmt Or eAlign
            If (pbSetHeaderItemInfo(lColumn, tHI)) Then
                If (ColumnIsGrouped(lColumn)) Then
                    RaiseEvent RePaint
                End If
            Else
            End If
        End If
    End With
    
End Property

Friend Property Get ColumnWidth(ByVal lColumn As Long) As Long

Dim i   As Long
Dim tHI As HDITEMA

    If lColumn = m_lCol Then
        ColumnWidth = m_lCXY
    Else
        If (ColumnIsGrouped(lColumn)) Then
            For i = 1 To m_iGroupedHeaderCount
                If (m_tGroupedCol(i).lColumn = lColumn) Then
                    ColumnWidth = m_tGroupedCol(i).lOrigColSize
                    Exit For
                End If
            Next i
        Else
            tHI.Mask = HDI_WIDTH
            If (pbGetHeaderItemInfo(lColumn, tHI)) Then
                ColumnWidth = tHI.cxy
            Else
                debugmsg "Get column width error"
            End If
        End If
    End If

End Property

Friend Property Let ColumnWidth(ByVal lColumn As Long, _
                                ByVal lWidthPixels As Long)

Dim i   As Long
Dim tHI As HDITEMA

    If Not (ColumnWidth(lColumn) = lWidthPixels) Then
      If (ColumnIsGrouped(lColumn)) Then
         For i = 1 To m_iGroupedHeaderCount
            If (m_tGroupedCol(i).lColumn = lColumn) Then
               m_tGroupedCol(i).lOrigColSize = lWidthPixels
               Exit For
            End If
         Next i
      Else
         tHI.Mask = HDI_WIDTH
         tHI.cxy = lWidthPixels
         If (pbSetHeaderItemInfo(lColumn, tHI)) Then
            RaiseEvent ColumnWidthChanged(lColumn, lWidthPixels)
         Else
            debugmsg "Set column width error"
         End If
      End If
   End If
   
End Property

Friend Property Get ColumnX(ByVal lColumn As Long) As Long

Dim i As Long
Dim x As Long

    For i = 0 To ColumnCount - 1
        If (ColumnIndex(lColumn) = i) Then
            Exit For
        Else
            If Not ColumnIsGrouped(ColumnAtIndex(i)) Then
                x = x + ColumnWidth(ColumnAtIndex(i))
            End If
        End If
    Next i
    ColumnX = x
   
End Property

Friend Property Get CustomHeader() As Boolean
    CustomHeader = m_bCustomHeader
End Property

Friend Property Let CustomHeader(ByVal PropVal As Boolean)

    m_bCustomHeader = PropVal

End Property

Friend Property Get DragImageList(ByVal lColumn As Long)

    ClearDragImageList
    If (ColumnIsGrouped(lColumn)) Then
        Dim i As Long
        Dim lIndex As Long
        Dim lWidth As Long
        Dim lHeight As Long
        '/* Need to create a new image list for dragging:
        For i = 1 To m_iGroupedHeaderCount
            If (m_tGroupedCol(i).lColumn = lColumn) Then
                lIndex = i
                Exit For
            End If
        Next i
        lWidth = m_tGroupedCol(lIndex).tR.right - m_tGroupedCol(lIndex).tR.left
        lHeight = Height
        m_hImlDragImageList = ImageList_Create(lWidth, lHeight, ILC_MASK Or ILC_COLOR32, 1, 1)
        '/* Now need to create an image of the item to be dragged to add to the drag image list:
        Dim lhDCDisp As Long
        Dim lHDC As Long
        Dim lhBmp As Long
        Dim lhBmpOld As Long
        Dim tR As RECT
        Dim hFontOld As Long
        tR.right = lWidth
        tR.bottom = lHeight
        lhDCDisp = CreateDc("DISPLAY", ByVal 0&, ByVal 0&, ByVal 0&)
        lHDC = CreateCompatibleDC(lhDCDisp)
        lhBmp = CreateCompatibleBitmap(lhDCDisp, lWidth, lHeight)
        DeleteDC lhDCDisp
        lhBmpOld = SelectObject(lHDC, lhBmp)
        '/* Draw the item onto the DC:
        hFontOld = SelectObject(lHDC, m_hFnt)
        DrawGroupedHeaderItem lHDC, lIndex, tR
        SelectObject lHDC, hFontOld
        '/* Select the bitmap out:
        SelectObject lHDC, lhBmp
        '/* Clear up DC:
        DeleteDC lHDC
        '/* Add the bitmap to the ImageList:
        ImageList_AddMasked m_hImlDragImageList, lhBmp, &H10101
        '/* Clear up the bitmap:
        DeleteObject lhBmp
    Else
        If m_bIsNt Then
            m_hImlDragImageList = SendMessageLongW(m_lHdrHandle, HDM_CREATEDRAGIMAGE, lColumn, 0)
        Else
            m_hImlDragImageList = SendMessageLongA(m_lHdrHandle, HDM_CREATEDRAGIMAGE, lColumn, 0)
        End If
    End If
    DragImageList = m_hImlDragImageList

End Property

Friend Property Get DragReOrderColumns() As Boolean
    DragReOrderColumns = m_bDragReorderColumns
End Property

Friend Property Let DragReOrderColumns(ByVal bState As Boolean)

    If Not (m_bDragReorderColumns = bState) Then
        m_bDragReorderColumns = bState
        If Not (m_lHdrHandle = 0) Then
            pSetStyle HDS_DRAGDROP, bState
        End If
    End If
   
End Property

Friend Property Get Enabled() As Boolean
   Enabled = m_bEnabled
End Property

Friend Property Let Enabled(ByVal bEnabled As Boolean)

Static bResetOnEnable As Boolean

    If Not (m_bEnabled = bEnabled) Then
        m_bEnabled = bEnabled
        If Not m_bEnabled Then
            If m_bButtons Then
                HasButtons = False
                m_bButtons = True
                bResetOnEnable = True
            End If
        Else
            If bResetOnEnable Then
                If m_bButtons Then
                    m_bButtons = False
                    HasButtons = True
                End If
            End If
        End If
        EnableWindow m_lHdrHandle, Abs(m_bEnabled)
    End If

End Property

Friend Property Get FilterBar() As Boolean
    FilterBar = m_bFilterBar
End Property

Friend Property Let FilterBar(ByVal bFilterBar As Boolean)

    If Not (m_bFilterBar = bFilterBar) Then
        m_bFilterBar = bFilterBar
        If Not (m_lHdrHandle = 0) Then
            pSetStyle HDS_FILTERBAR, bFilterBar
            pResize
        End If
    End If
   
End Property

Friend Property Get FilterChangeTimeOut() As Long
    FilterChangeTimeOut = m_lFilterChangeTimeOut
End Property

Friend Property Let FilterChangeTimeOut(ByVal lTimeOutMs As Long)

    m_lFilterChangeTimeOut = lTimeOutMs
    If m_bIsNt Then
        SendMessageLongW m_lHdrHandle, HDM_SETFILTERCHANGETIMEOUT, 0&, lTimeOutMs
    Else
        SendMessageLongA m_lHdrHandle, HDM_SETFILTERCHANGETIMEOUT, 0&, lTimeOutMs
    End If
   
End Property

Friend Property Get FullDrag() As Boolean
    FullDrag = m_bFullDrag
End Property

Friend Property Let FullDrag(ByVal bFullDrag As Boolean)

    If Not (m_bFullDrag = bFullDrag) Then
        m_bFullDrag = bFullDrag
        If Not m_lHdrHandle = 0 Then
            pSetStyle HDS_FULLDRAG, bFullDrag
        End If
    End If
   
End Property

Friend Property Get GroupBoxHintText() As String
    GroupBoxHintText = m_sGroupBoxHintText
End Property

Friend Property Let GroupBoxHintText(ByVal sText As String)
    m_sGroupBoxHintText = sText
End Property

Friend Property Get GutterButtonColor() As Long
    GutterButtonColor = m_lGutterButtonColor
End Property

Friend Property Let GutterButtonColor(ByVal PropVal As Long)
    m_lGutterButtonColor = PropVal
End Property

Friend Property Get GutterButtonSkinned() As Boolean
    GutterButtonSkinned = m_bGutterButtonSkinned
End Property

Friend Property Let GutterButtonSkinned(ByVal PropVal As Boolean)
    m_bGutterButtonSkinned = PropVal
End Property

Friend Property Get HasButtons() As Boolean
    HasButtons = m_bButtons
End Property

Friend Property Let HasButtons(ByVal bHasButtons As Boolean)

    If Not (bHasButtons = m_bButtons) Then
        m_bButtons = bHasButtons
        If Not m_lHdrHandle = 0 Then
            pSetStyle HDS_BUTTONS, bHasButtons
        End If
    End If
   
End Property

Friend Property Get HeaderBackColor() As Long
    HeaderBackColor = m_lHeaderBgColor
End Property

Friend Property Let HeaderBackColor(PropVal As Long)
    m_lHeaderBgColor = PropVal
End Property

Friend Property Get HeaderColorAuto() As Boolean
    HeaderColorAuto = m_bHeaderClrAuto
End Property

Friend Property Let HeaderColorAuto(PropVal As Boolean)
    m_bHeaderClrAuto = PropVal
End Property

Friend Property Get HeaderSkinStyle() As Long
    HeaderSkinStyle = m_lHeaderSkinStyle
End Property

Friend Property Let HeaderSkinStyle(ByVal PropVal As Long)
    m_lHeaderSkinStyle = PropVal
End Property

Friend Property Get Height() As Long
    Height = m_tR.bottom - m_tR.top
End Property

Friend Property Let Height(ByVal lHeight As Long)

    m_tR.bottom = m_tR.top + lHeight
    pResize
   
End Property

Friend Property Get HideGroupingBox() As Boolean
    HideGroupingBox = m_bHideGroupingBox
End Property

Friend Property Let HideGroupingBox(ByVal Value As Boolean)

    If Not m_bHideGroupingBox = Value Then
        m_bHideGroupingBox = Value
        RaiseEvent Resize
    End If
   
End Property

Friend Property Get HotTrack() As Boolean
    HotTrack = m_bHotTrack
End Property

Friend Property Let HotTrack(ByVal bHotTrack As Boolean)

    If Not (m_bHotTrack = bHotTrack) Then
        m_bHotTrack = bHotTrack
        If Not (m_lHdrHandle = 0) Then
            pSetStyle HDS_HOTTRACK, bHotTrack
        End If
    End If
   
End Property

Private Property Get IdealHeaderHeight() As Long

Dim lr      As Long
Dim lHeight As Long
Dim cx      As Long
Dim cy      As Long
Dim tHDL    As HDLAYOUT
Dim rc      As RECT
Dim pwpos   As WINDOWPOS

    tHDL.lprc = VarPtr(rc)
    tHDL.lpwpos = VarPtr(pwpos)
    lr = SendMessageA(m_lHdrHandle, HDM_LAYOUT, 0&, tHDL)
    lHeight = pwpos.cy
    ImageList_GetIconSize m_hIml, cx, cy
    If (lHeight < cy + 4) Then
        lHeight = cy + 4
    End If
   
    IdealHeaderHeight = lHeight

End Property

Friend Property Get IdealHeight() As Long

Dim lHeight As Long
   
    lHeight = Height
    If (m_bAllowGrouping And Not (m_bHideGroupingBox)) Then
        If (m_iGroupedHeaderCount = 0) Then
            lHeight = lHeight + lHeight + 12 + 8
        Else
            lHeight = lHeight + lHeight + 12 + (m_iGroupedHeaderCount * 8)
        End If
    End If
   
    IdealHeight = lHeight
   
End Property

Public Property Get IHeader() As StdPicture
'/* header image
    Set IHeader = m_pHeader
End Property

Public Property Set IHeader(PropVal As StdPicture)
    Set m_pHeader = PropVal
End Property

Friend Property Get left() As Long
    left = m_tR.left
End Property

Friend Property Let left(ByVal lLeft As Long)

Dim lOrigLeft As Long

    With m_tR
        lOrigLeft = .left
        .right = lLeft + .right - .left
        .left = lLeft
        pResize Not (.left = lOrigLeft)
    End With
    
End Property

Friend Property Get HeaderLuminence() As Long
    HeaderLuminence = m_lHeaderLuminence
End Property

Friend Property Let HeaderLuminence(PropVal As Long)
    m_lHeaderLuminence = PropVal
End Property

Friend Property Get HeaderThemeColor() As Long
    HeaderThemeColor = m_lThemeColor
End Property

Friend Property Let HeaderThemeColor(ByVal PropVal As Long)
    m_lThemeColor = PropVal
End Property

Friend Property Get top() As Long
    top = m_tR.top
End Property

Friend Property Let top(ByVal lTop As Long)

    With m_tR
        .bottom = lTop + .bottom - .top
        .top = lTop
    End With
    pResize
    
End Property

Friend Property Get UseHeaderTheme() As Boolean
    UseHeaderTheme = m_bUseHeaderTheme
End Property

Friend Property Let UseHeaderTheme(ByVal PropVal As Boolean)
    m_bUseHeaderTheme = PropVal
End Property

Friend Property Get Visible() As Boolean
    Visible = m_bVisible
End Property

Friend Property Let Visible(ByVal bVisible As Boolean)

    m_bVisible = bVisible
    If Not m_lHdrHandle = 0 Then
        If bVisible Then
            ShowWindow m_lHdrHandle, SW_SHOW
        Else
            ShowWindow m_lHdrHandle, SW_HIDE
        End If
    End If

End Property

Friend Property Get Width() As Long
    Width = m_tR.right - m_tR.left
End Property

Friend Property Let Width(ByVal lWidth As Long)

    m_tR.right = m_tR.left + lWidth
    pResize
   
End Property

Friend Function AddColumn(ByVal sText As String, _
                          Optional ByVal lWidth As Long = 64, _
                          Optional ByVal eTextAlign As EHdrTextAlign = HdrTextALignLeft, _
                          Optional ByVal lExtraData As Long = 0, _
                          Optional ByVal lImage As Long = -1, _
                          Optional ByVal lInsertAfter As Long = -1) As Long

Dim b()     As Byte
Dim lr      As Long
Dim wP      As Long
Dim tHI     As HDITEMA
Dim tHIW    As HDITEMW

    With tHI
        .Mask = HDI_TEXT Or HDI_WIDTH Or HDI_FORMAT Or HDI_LPARAM
        .fmt = eTextAlign Or HDF_STRING
        If Not m_hIml = 0 Then
            If (pbValidImage(lImage)) Then
                .Mask = .Mask Or HDI_IMAGE
                .fmt = .fmt Or HDF_IMAGE
                .iImage = lImage
            End If
        End If
        .cxy = lWidth
        .lParam = lExtraData
        If Len(sText) = 0 Then
            .Mask = .Mask And Not HDI_TEXT
        Else
            .pszText = sText
            .cchTextMax = Len(sText)
        End If
    End With
    If (lInsertAfter < 0) Then
        wP = ColumnCount + 1
    Else
        wP = lInsertAfter
    End If
    
    If m_bIsNt Then
        '/* Copy to tHIW:
        With tHIW
            .Mask = tHI.Mask
            .fmt = tHI.fmt
            .iImage = tHI.iImage
            .cxy = tHI.cxy
            .lParam = tHI.lParam
            .cchTextMax = tHI.cchTextMax
            If (Len(sText) > 0) Then
                b = tHI.pszText
                ReDim Preserve b(0 To UBound(b) + 2) As Byte
            Else
                ReDim b(0 To 1) As Byte
            End If
            .pszText = VarPtr(b(0))
        End With
        m_lR = SendMessageW(m_lHdrHandle, HDM_INSERTITEMW, wP, tHIW)
    Else
        m_lR = SendMessageA(m_lHdrHandle, HDM_INSERTITEM, wP, tHI)
    End If
      
    If (ColumnCount > 0) Then
        ReDim Preserve m_sTag(0 To ColumnCount - 1) As String
    End If
           
End Function

Friend Sub ClearAllFilters()

    If m_bIsNt Then
        SendMessageLongW m_lHdrHandle, HDM_CLEARFILTER, -1, 0
    Else
        SendMessageLongA m_lHdrHandle, HDM_CLEARFILTER, -1, 0
    End If

End Sub

Friend Sub ClearDragImageList()

    If m_hImlDragImageList Then
        ImageList_Destroy m_hImlDragImageList
        m_hImlDragImageList = 0
    End If
   
End Sub

Friend Function ColumnHitTest(ByVal xPixels As Long, _
                              ByVal yPixels As Long) As Long

Dim i       As Long
Dim j       As Long
Dim lIndex  As Long
Dim yHeader As Long
Dim rc      As RECT

    lIndex = -1
    yHeader = yPixels
    If (m_bAllowGrouping And Not (m_bHideGroupingBox)) Then
        GetWindowRect m_lParentHwnd, rc
        yHeader = yPixels + rc.bottom - rc.top - Height
    End If
    For i = 0 To ColumnCount - 1
        If Not (ColumnIsGrouped(i)) Then
            If m_bIsNt Then
                SendMessageW m_lHdrHandle, HDM_GETITEMRECT, i, rc
            Else
                SendMessageA m_lHdrHandle, HDM_GETITEMRECT, i, rc
            End If
            If Not (PtInRect(rc, xPixels, yHeader) = 0) Then
                lIndex = i
                Exit For
            End If
        End If
    Next i
   
    If lIndex = -1 Then
        For i = 1 To m_iGroupedHeaderCount
            If Not (PtInRect(m_tGroupedCol(i).tR, xPixels, yPixels) = 0) Then
                lIndex = m_tGroupedCol(i).lColumn
                Exit For
            End If
        Next i
    End If
   
    ColumnHitTest = lIndex
   
End Function

Friend Sub ColumnStartFilterEdit(ByVal lColumn As Long)

    If m_bIsNt Then
        SendMessageLongW m_lHdrHandle, HDM_EDITFILTER, lColumn, 0
    Else
        SendMessageLongA m_lHdrHandle, HDM_EDITFILTER, lColumn, 0
    End If
   
End Sub

Private Sub HeaderThemeSettings()

    Select Case m_lHeaderLuminence
    Case  HdrSortBit
        ImageList_Destroy m_hImlDraRnd Sub

Private Sub f m_bIsNe  Hdr
   
Rnd Sub

PrivN(d SuaderLum    '/* Copy ttings()

    Select Case m_lHeright - m_tR.left
m   lProperwGrouping And Not (m_bHidelnd Sub

PrivN(d Suad(i lProperwdCol(i).lColumn
     Exit ForroperwGro If m_bIsNt Then
        SendMessageLongW m__________extMax = tHI.cchTextMax
        rty Get top() As Long
    top = m_tR.top
End Property
roperty
rope/ O   top = m_tR.top_lHdrHandle r_bIsNt Then   SendMessageLongA mdnd Property       SendMessageLongW m_lHdrHandle, HDM_EDITFILTER, lColumn, 0
    Else
 ot (PtInRect(ageLongW m_lHdrHandle, HDM_EDIT Pate SuGd PrR, lC
    Else
 ot (Pt   Eg And Not (mg
Dim lIndeFILTER, lColight + lHeight + 12 + 8
        Else
      hLEARFILTER, -DM_GETITEMR8
        E1GetIconSize S.cchTextMax
        rty Get top(Heightt (Colu     .lParam = lExtraDderBackColo
Dim i As nR

Privat   HIf
OEperty

FrUsible = bVisiblS.cchTextMax
       Select Cam_lHdal sText As String, _
              electring, _Obo.(
 vN(d     Sel, HDM_GETITEMRECT, i, rc
            Else
           = bVi Sel,lse
            debugmsg "Set column width error"
         EnDlectring, _Obo.(
 vNl,lse
   WIDT'tR.top + lHeight
    HIf
OEpd If
   l As                                          Nl,ls    t Case Dlectring, _Obo.(
fpSet columR
   geList(ByVaEperty

FrUsible erColumns = m_bDragRDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDhTextMax
        rty Get       .lPaDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDCrcolumR
   geList(ByVaEpe   geList(ByVaEpe   geList(ByVaEped Ife (Colu     .lParam =wElse
       QColu     .lParam =
   GetIconSize S.cchTexParam
        End   m_lR =Sd Property

Friend Property LetVal lC                               Nl(gImageList Then
        ImageList_Destroy m_hImlDraI    lIndex = -1 Cgs -
        '/* if it is,LNot (LetVal lC d IfeRct) Thens -
        '/* ifo.(_lGutte  geL        End If
    End If
   
End Proels
ll        lIndex = iaI   m
    End If
     End If
   
End Proels
ll   RW_s If
rty
rope/ O   top =      DDDDDDDDDhTextMax
d &H7&
th error"
    oley          errotMax
       nIf m_bIsNt THg) As Long
a End Function
           Nl(gImageList Then
        ImageList_Des As THg)  With
          geList(ByVaEped Ife (Colu   olSiDDDDDDDDCrcolumR
   geLiong
a Enlu   olSiDDDs THg)  WithnIf m_bIsNt THg) As Long
i As THg)  With
    Dl1sroperty Get IHeader() As StdPicture
'/* header image
    Set IHeader ,NlHdrHandn Or HDF_STRING
    StdPi!oe
    Set IHeader =ngW m_l HeaderThemeSettings()

    Select Case m_lHeaderLuminence
Handle = 0 TderLu  geList(ByVaEped   WIDT'tR.top + lHeight
    HIfThene =, -1, W WIDHeaderLucUDDDDDDDDDDDDDhTdMessageLon3KngW m_l HeaderThemeSettageLon3KngW m_l HeaE,LNot (LetVal lC d IfeRct) Thens -
        '/* ifo.(_lGutte  geL        End If
 geList Then
        ImageList_Des As THg)  With
          gePnd  geL      lDDDD1        Wieer() As StdPicture
'/* headulGutte  geL        End If
 geList2
Privat lDDDD1        Wieer(_ THg)   geL        End If
L        End IResize Not (.left =     Else
    DDD1      Re Not (.lesk =B
        '/*         Ene No3eerty Get HotTrIcte         End      As   Exit For
        d    Set IHeader =ngW m_bHasButtons
Q    C
        '/* Add the bitmap to the ImageList:
        ImageList_AddMasILTER, lColumn, 0
    Else
        SendMessageLongu =ngW m_bHa      iT*hiblS.cch  Set IHeaderl = 0 Then
  ong
    left = h -
        '/*Cen
a   e
    Set IHeader =ngW m_l HeaderThem    As RECT
Dim pwpos (LetVal lC dLetVal lC d IfeRct) Thit         End If
    Else
rt RePaint
     1, W WIDHeaderLucUDDDDDDDDDDDDDhTdMetHeaderItemInfo(lCB
        '/*     n)
DDDDDDDhTdMetHeaderItemInfo(lCB
        '/*     n)
DDDDDDDhRchTexttn (LetVal  Sub CoIDHeaderLucUDDDDDDerty GM   Dim ls As(lCB
        '/* exttn (LetVal  Sub lGutte  geL       sageLongum ls As(lCB
        '/t(ByVaEpe   geList(1W m_l HeaderThem    As R3KngW m_l HeaderThemeSettageLon3KngW m_l Hea (.left =     Else
    DDD1      Re Not (.lesk =B 3T'tR.top + lHeiThen
    W m           If No       sE   Re Not (drTexTHg       End If
                If (pbSetHeaderI     Iet IHeader =ngW m_bHasButtons
Q    C
        '/* Add the bitmapperty Get IHeadepperty Get IHeadept_pHeader
End Prrrrrrrrrrr            ong End If
    End If
    
End Property

Frrr      s m_bI0
 ReOrderColumns() As , HDM_CREATEDRAGIMAGE, lColumn,     pResize
    HDM_CREATEDRAGIM    DDDDDhRchTextm lr        End If
   
    ColumnHDhRchTextm lr       rm_bHaLu  geLis Iet IHeader =ngW m_bHasButto Then
  ong
    left =
        debugmsg "ErrHeadebStateTHg)  LetVal lC dLe As Los -
c    pResize
    HDM_CREATEDRAGIM    DDDDDhRchTextm lr        End If
   
    ColumnHDhRt(ByVaEub CoIDHe1) As Byte
        oT    debuTTTTTTTf
   
    ColbuTThemeSettageLon3Kng   oTCYm_lGutterButtonColor
Val lC dLe As Los -
c    pResize
m_bGutterButtonc    pResize
m_bGutterButtonc    pResize
m_bGu.A    Exit Forrot IHeadepperty GIM    DDDDDhRchTexttTTTTTTf
   
    Colbb CoIDHe1) As Byte
    DDDhRchTODHe1) As Byte
    DDDhRchmeeiTAbSetHeaEor(Brty

Frieniiiiiiiiiiiiiiiiiic   y(Proper8oa
    ColuColbb CoIDHe1) As Byte
  
    Colbb CoIDHe     der =ngW m_bHas Iet IHeader =ngW  =ng   End If
   
    ColumnHHHHHHHHHEDRAGIoa
    ColuC8s Byte
 SmRader =ngW m_l HeaderThemeSettings()

      Senl HeaderTheme()

         pResizeaderTh          = bVi Sel,lse
        HeaC dLe As Los -
c    pReTextMax
        p1) As         = bVi Sel,lse
        HeaC dLe As Los -
    gme()

endMessageLongA mdnd Prop=)
    End With
   EATEDRAGI SelediIf
  dt     End   m_lAAi!iiiiiiiiiiiiic   y(Proper8oa
    ColuColbb CoIckColoHeaderLucUDDDDDDerty GIckCng   m UR, -DM=DD1      Re Not (DEe   oTtHI.fmt Or HdrSortBitmapDown And Not HdrSortBitm eLongW m_lngW m_l H   m UR, -DM=DD1      Re Not (DEe   oTtHIProperty       SendMessacbIsNe  Hdr
   
Rnd m_l H   m UR, -DM=DD1    ntHea-L  m UR, -DM=DD1    ntHeaR ColbuTThemeSettageiiiiiii
    DDDhRchmeeiTAbaderThemeSeOAGIoa
    ColuC8s Byte
 SmRader hemeSettage.soloonc    pResiiiiiiiiiiiiiiiiiiic   y(Proper8oa
    DDDhRcc    pResiiiiiii  der -
c    pResize
lnd utto TeLongA mdnd ProN+ 1
         ShowWindo itmapD Pro_
    lIoa
  Sd Get FilterBCSy
   
End 
        ShowWim pwpos (LetVal lC 'eiiiiiii
 cmn
     Ioa
  lbb(aOdDRoperku
'/* head Ioa
iiiiii
itmapD Pro_
 Byte
  -DM=Diend PropertRagAal lC 'eiiiiiii
 cmn le As Los -
c    pResi.agAhemeSettageLon3KngW m_l Hea (.lef      pResi.Header =ngW  =tHI.lParams      perty Let HeaderThemeColor(ByVal PropVal As Long)
    m_l mdnd PrWend P(DEe   opAuto(PropVal As BooleaaaaaaaaaaaaaaaaangW  AAAAAAAAeDim Preserve b(0aaaaagW  AAAAAAAAeDim Pre_tR.right -n_l Hea (.lef      pResi.HsageLongA mdnd Pr   ColumsW  AAAAAAAAeDim Pre_tR.right -n_l Hem Preserve b_Db"A mdnDM=DD1    ntHeQ    RchTerty

 c     RaiseEvhRchmeeiTAbaderThemeSeOAGIoa
    ChmeeiTAbaderThemeSeOAGI  Else
        SendMessageLongA m_lHdr            Chg
        Dim lWidth Asr
   
        Dim lWidth d If
it =  8oa
    DDDhRcc    pResiiii     If (m_tGDM=DD1    ntHeQ    RchTerts,Width Asr
 If
it =  8oa
    DD_l mdndeLon Asr
   
        Dim lWidth d If
it = NsageLongA TCm  Els -DM=Dao   Ch_EDITFILTER, lColumn, LDDDhRcc    pRFngA mOl(Ioa
    ColuC8s Byte
 SmRader =ngW mn leEls -DM=Dao   Ch_EDITM=DD1  sButtons    DDoluC8sht -n_l Hea (.lef ITFILTER, lColund Sub Colns    DDolef ITFe
    DDD2n le As LrThemeIEnd Pr  C   DDolef ITFe
    DDD2n le As LrThemeIEnd eNdee
    Dor() As LoD.lef ITFILTTTTTTnSortBitmap = Hdry Let Visible(ByumnIsGrouped-perkilterBCible(ByumnIsGroup4 nd PropertRagAal ty Get FilterBar() As 2Get IcfOee
 LAAAASortBdrHandley Get FilterBar() As 2Get im pwponCoXeQ    RchTerts,Width Asr
 If
it =  Ifdth d If
it =  8oa
    DDDhRcc    pResiiii  ao   Plef ITFnd Not (m_oXeQ  s  Plef ITFnd t (m_oXeQ  sITFIL Colu &H7&
th error"
                        A&
th err  = bVi Sel,ls
        End If
    Next i, bState, -1

End Pro = HDI_TEXT ror und(bTL>Rader   DDD2n le e1) As BytT   pResi.HsageLongA mdnd Pr   ColumsW  AAAAAAAAeDim Pre_e1) AsageLongA m_lHdrHan
    m_lHeadAAAesi.HsageLoL_lHdrHan
    m_lHeadAAAesSettage.soloonc    peadAAAesi.HsageLoL

FriendtWindowRect me b(0 To UBounsroperty Get IHeaddrHahTdMetHeaderItemInfo(lCeList
     s  Plef ITFnd t (m_oX0d    End   m_lAAirHahTd
    m_l,HdrHan
    m_lHeadAAAesSettage.sssssssssssGutterButtonrrrrr            onrThemeSeOAGNssssssssssGuXeQ  s  Plef ITFn  End   m_lAAirHaL=ot                     Nl(gIALoX0d    End   RyVaM6ToX0d    End  eOOOOOOOOOOOOn eTextAlign As EHddnd Pr  Next i8s Byte
 SmRader =ngW mn leEls -frUsible = bVisiblS.cchTextMaxtr =ngW  lLeftttonrrrrr            onrThemeSeOAGNssssssssssGuXeIet IHea sssssssssssssssssssssssssss     lhDCDisp = CreateDc("DIblS.cch  Set IHeaderl = 0 Then
  ong8oa
ra
    ColuC8aL=ot                  = ColuC8aL=ot         roperty      iiii
 cmn   n)
DDDDDDDhRchTexttn (LetVal  Sub CoIDHeaderLusSett= CreoiDDDhumsWMmdnd Pr   '/* Add the bitmap to t If m_bIsNt ThParam = lExtraD         = ColuCrl =     = ColuCrl =  m_lFilterChan  m_lFilterChan  m_lFilter = ColuCrl =     = ColuCrl =  m_lFilterChan  m_lFilter Long
        Dim lhBmp As Long
        Dim lhBmpOld As Long
        Dim tR As RECT
        (adA
  o   Plef ITFnd Not (     (adA
  o   Plef ITFnd Not (    E ImageList:
       E   (ar    E ImageList:
      Wieer() As StdPicch  e2rouped-perkilterBCible(ByumnIsGroup4 nrouped-perkilteolumn
              
  o   Plef ITFnd Not (                  onrThemeSeRyVaM6ToX0d dAAAesSettage.sssssssssssGutterButtonnrThemeSeRyVaM6To() As 2Get IcfOee
 LAa.sssssssssss.soloon= ColuCrl =  ilteolumnT o   PliT      Dim lhBmp As Lole, SW_HIDE
        End I -
c    pRState,  Plef ITFnd Not (m_oXeQ  s  Plefiiiiiiic   y(Proper8oa
    Cm =,TFnd Not (m_oXelter PlefiiiiiiiAf
   
EnPlefiiiiiiiAf
   
_DD1 N  DDolef ITFe     iiii
 cmn   n)
DDDDDDDhRchTexC   
  
En_n)
DDDDDDDhRchTexC As EHdrTextAlit (    
  o   Plef ITFnd Not (                  onrThemelefiiiiiiiAf
   
_DD1 N  DDolef hexC   
  
En_n)
DD 
  
En_n)
DDDDDDDhRchT
DDDuCrl =  ilteolu=   
_DD1 N  DI.lPar (    
     (arThemeSeR2f
   
_DD1 N  DDolefmelefiiiiiiiAf
   
_DD1B*DD1 N  IDel            us2rouped-perkilterBCible(ByumnIsGroup4 nroupte,  Plef ITFnd Not (m_oXeQ  s  Plefiiiiilnd     P  o   Plef d the bitI (adA
  o L Plef Ihmeet:
      Wieer(w N  IDel  n
                Exit t Then
  R  P  o   PDawl  n
Friend Property Get Col t Then
  R iiiiilnd     P OAG        tet IHeaddrHahTdMetHeaderIt_bHas umnTag_bHas umnTag_bHas umnTag_bHas umnTag_bHas ubrHahTdMet)en
     an
    m_lHeadAAAesSe     AAAesi.HsageLoL

FriendtWindowRect me b(0 To ieer(w N  IDel  n
               rHan
   le(ByumnIsGroup4 nd Prop+E' an
    mGrack
     (               ader1 N  DDolef ITFe    ht FilterBCSy
   
End 
        ShowWim pwpos (LetVal lC 'ei Property

Friend PrelterChan  Nse
        m_lR = SendMessageAouped-perkilteolumn
      a
    Coly3
Friend PrelteButtonnrThemeSeRyVaD3
Friend Pre                                                                                                                                                                             wRect me b(0 To ieer(w N  IDel        N  I   ct me DluCrl                            =ngW  =t s  Plef ITF m_bI0
 ReOrderColumns() Aolor
End Propert(B       lWidthPixels
  T      Dim lhBmp As Lole, ddrHahTdMilnd                 .fm                    Lonn
Youp4 nroupEDITM=DD1  s  Plef ITF m_bI0erveGo ieer(wn
Yst:
      Wieer() 0 Then
  ong8oa
ra
    ColuC8aL=otg_bHas ubrHahTdMet)en
      m_bDndMessageLongA mdnd Prop=)
 N  DDolLoageLf
 y GIckCnrHahTdMet)en
eQ    '3
Friend umnnTee
    Set IHeader = m_pHennTee
   d Property Get Col t Then
  R iiiiilnd     P OA)N(d Suad(i lP
    Coly3
Friend Preltegit       ag_bHan
  R iiiiilnd     P OAG     lWidthPixels
CB      ILiiiilnd     P OAGhag_bHan
  iiilnd     ixels
  T KAbaderThemeSeOAGIoa
  rop=)
 N  endtWropeOOOOOOO          If
  iiiT KAbaderThemeSeOAGIoa
  ilteolumnT o   P  rop=)
 N  endtT KAberror     
   d PropeLetVa                    HHeaderBackColor() A
  ong8oC ifo.(_lDDDh     A&
th err  = bVi Sel,EmnT o   P  ropeO Property Get Col t Then
  R iiiiilnd     P OA)N(d Suad(s Iet IHeader =ngW m_bHaoperty

Iet IHeader =ngW m_bHaoperty

Iet IHeadas umnTKAberro  rop=)
 itmapDown   m_bUseHea)
DDDDDDDhRchT
DDDVal PropVal As Boolea5Toup4 nd Prop+E' andjETpVal As BooleatmapDown  Laolor() As Long
AoolePlefiiiiiiiAf
   
_DD1 et IHeader =ngW tt Enatt Enatt Enatt EnaTer() 0 Then
e             ByVal e(wn
Yst:
     ropAs Long
Ao     erTssssssssssGuttg
Ao  Val e(wn
YstderBa      e(wn
Yst:
     ropppppppppppppppp= lHeight
sGuttg
Ao  Val e(wn
YstdOAGIoa G    P OAG   alhBmp rTssssssssssGuttg
A
_DD1 et IHeader =n(d Suad(strTsssssssssnGIoa G    P ght
sGuttg
Ao  Val e(wn
YstdOAGIouad(strTsssssssssnGIoa G    P ght
sGuttg
Ao OAGITee
   d Property N   
End Poa
  rop=)
 N  endtWr =ngW tt Enatt Enatt E  Val As Long
rHahTdderty Get Col t Then
 ea)
Dixels
CB      ILiiiilnd     P OAhTdderty Get Col t ,   d Property N   
EndImea)
Dixels
CB      ILiiiilnd     P OAhTdderty Get Col t ,   d ProperBBBBBBBBBBBBBBBBBBBBpfOee
rop=)
 N  Boolean
    CustomHeader = m_bCustomHeader
HI.cchTextMax
        rty Get top() As Long
    top = m_tR.top
End Property
roperty
rope/ O   to
Iet IHmnTKAbeEpppppppppppppppppppp PrHmnTKA= m_tR.top
   DicY=ngW  lLefttacIHeader =ngW tt Enat ProperpD  
  ot IHeader =ngW tt Enap lColumnfttacIhT
DDels
CB      ILiiiilnd          WXeIet I)) As Loolean
   ong
    top = m_tR.top
E-n_l Hx
  ot IHeader =nS.   ong
L  onrThemeSeolec  onrTonrThemeSeolec emeSeolec erTheme-A Loolean
   ong
    top = m_tR.top
ibFilterBty = m_tR.tomeSe(d SuBBBBBpfOeIi"
                        A&Propm    y = m_tR.tomeSe(s()

      A Else
        'i   Dim lhBmp As Lole, SW_HIDE
   +ct) Thens -
        '/* ifo.(_
YstdOAGIoa G    P OA     A&Propm    y =m eLongW m_lngW m_l H   m UR, -DM=DD1         ILiiiilst(1W m_l R   Dim lhBmp As Lole, SW_HIDE
   +ct) Thens -
       GIoa G  m lWiongW m_lngW m_l H   m UR, -DM=DD1        N  I   ct me ot) Thens -
 
  o      ILii  ao   Plef ITFnd Not (m_oett Enat ProperS                  dnd PongW m_lnglBBBBBBBB         ByVal e(wn
YsiilndM=DD1         ILiiiilste(wn
eDE
 (e.soloonc    pRv8dM=DD1         ILiieSe(d       ByVal e((nTKAbeEppp' G  m lWiongW m_lngW 'WIyiiiii  derrrrrrrrrrrrrrrrrrrrrrrrrrr       dnd PongW m_Ond I -
c  m_lHdrHan   dndAAeDim       dndLetteSeolec erTheme-A((nTTheme()

         pRest I)) As Loolean
 fIE   As Long
Dim lk IHeCeolec erTheme-nd N: Tg
Dim lk IHeCeolec erTheme-nd N: Tg
Dim lk IHeCeolec erTheme-nd N: Tg
Dim lk IHeCeolec erTheme-nd N: Tg
Dim lk IHeCeolec erTheme-nd N: Tg
Dim lk IHeCeoleA ot) -DM=DD1        N .PixelshPiPoleA otndtl  Sub CoIDHeaderSetl  Sub
m_bGu.A    Exit Forrot IHeadepperty GIM ight -n_l Hea (.lef   nor
                End If
            Next i
ty N   
End Poa
  roI -
c  m_lHdrHan  E-
c  m_lHdrHIf
          t i
nor
                End If
iiiilste: m_lngW m_l H   m UR, me-nd                  =ngW  =t s     ILiii        End If
iiiilste:     End If
iiiilsI  End If
    For i = l  SehemeColor eolumn
   _l Hea (.left =      End If
=fngWerSetl  Sub*   End If
iiii

Dim =re-nd N: Tg
Dim lk IHeCeoleA ot) -DMre-nd N: Tg
Dim lk IHeCeoleA ot) -f
iiii

Dim =re-nd NNNNNNNNNNNNNNNNNNNNNNNNNNNnd NNNNNNNNNNNNNNNNumsW  AAAAAAAAeDim Pre<lhBmp As Lole, SW_HlefO IHeCeoleA ot) -DM=DD1        N .PixelshPiPoleA otndtl  Sub CoIDHleA oSub
e, SWheme()

   
    ColumnHDhRt(ByVaADSub
eeeeeeee   ColumnHDhRt(BoIDHleA oSub
e, SWheme()

   
    Colum
    ColumnRe
                olumnRe PongW m_lnRk oa
    ChmenleA oSR=               P OAH   m eLongA mdnd Pr   ColhmenleA    _e()

   
 l  SehemeColor e  End   m_lAAirHahTd
im lk IHeCeA otndtl  Sub CoIDHl= m_tR.tomeSe(sk IHeCeA otndtl  Sub CoIDHl=ahTd
im lk IHeCeA 1 N  DI.lPar (   s ubr  Sub -          Dimste:     End If
iiiilsI  slBBBBBBnP OAGhag_bHan
  iiilnd     ix    ntHeaREmnTe
            lHeigoperS     I m_lnRk oerSs Lole, SW_Hnoiilnd     ix    ntHeaREmnT-perkilteolumn
      a
   dChilteolumn
      a
 s_BnP Oi=               P OAH   m ewRb
  Tg
Dim h As L  ntHeaREmnTe
            lHeigoperS     I m_lnRk oerSs Lole, SW_Hnoiilnd     ix    ntHeaREmnT-perkie, SW_HnoiigoperS  lColu lhBm =rEs Long
ngA m_lHdrHan
  ntHeaREmnT-perkilteolumn
      ct me b(0 To UBt As ntH
   T-perkidnd (As Boolean
    CustomHearEs Long
ngA bHaolomHearEs Long
ngA bHaolomHea (As Bong
ngA bH CoIDHl= mDVaaaaaaaaaaaoSR m_tR.left
m   lProperwGrouping And Not (m_bHidelnd Sub

PrivN(d Suad(i lProperwdCol(iHidelnd Sub

PrivN(d Suad(i lProperwdCol(iHidelndttings()

 
  o                             _l Hea (.left =      End If
=i
gW m_lnge&IH CoISe(d       fOeIi"
mu"Color e  End   m_lAAirHahTd
im l,I6 m_l H          EI(i lProH CoISe(d Ief ID= Endt       '/* ifo.(_
YstaREmnTTTTTTTTTTTTTTTTT     A              ByVal ychTd
imTTT     A hTd
i3D
PrsNNNNNNNNNrf=atIL Colu E geList2
Privat lm UR, -DM=DD1        olu E geList2
Privat lm U ColnI = lEe list:
       
c  ms8dM=DDidnd (As Boolean
    CustCeoleA ot) -DOnd If
   
End Property

FrienDtth
   eolec erTh3oleim lhBIong
ngA r
   
 ean)
rrrrc( I m__________B   
 ean)
rrrrc( IA .Mac2       .leftan)
strTigoperS  mhBIong
ngA r
  $oa G    P ght
seCeA NNNNNNrf=atIL C                        _l Iyr()TO Re Not (.ler=DDidnd (As Boolean
    CLdM=DDidloHeaderLucUDDDDDDerty GIckCe     iiii
 cmn   TO ReoNNNNNNNNNNNNNNNHdrHan  E-
c  m_lHdrLA AAA iiii
 cmn   TO ReoNNNNNNNNNNNNNNNNNNNNYhNNHdrHan  E-
c  m_ywr Pry
rodrLA AAA iiii
 cmnist:
xtALignLeft, _
          mHearEs Long
ngA bHaolomHeme()

drLA
xtALignLeaREmnTe
 
        '/*     lIndex = m_tGroupedCol(i).lColumn
                Exhllumn
    Exhlluc     lIsText)
 ggggggggggggii
 cmnist:
Column
  lPrL   lIcccccccwndtticccnd PongW m_Ond I -
ID
PsmHemeimeOut(ByVal lTimeO   Col
   
da     tR.bottom = lHeXC?en
        GetWindowWindowWindowWinnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnns  CLdM=DDidloHeadekend PropeWS lIcccccccwndtticccnnnnIOg, _meO   Col
 nnnnnnnnnnnnnnnnnnnnnnns  CLdM=DDidloHeadekend Pnnnnnns  CLdM=DDidlE0Mac2       .le
rop=nnnnnnnnnnnnnnns  CLdM=DDidloHeadekend Pnnnnnns  CLdM=Dn r
 dlo
PsmHemeimeOut(B End I"rc( IA .Mac2     im lWS lIcccccccwndttiupedCollNNNNNNNNNNN_vCam________________y.ndexekend SubDerty GIcI(i lPhB   
rsNNNNNNNNNNN_vCamtWindoeBBBBBBBBBBBv     I m_lnRk oerSs Lo       mHeDwA otnWindoeBBBBBBBBBBBv x = mA End W erwdCol(iHidelndttings()

 
  o                             _AGet HendoeBBBB Re Not (.leNNNNHdrHan m_l O I m_lnRk oerSs Lole, SW_HnFriend PrelterChan  Nse
       A End WCam________________TT                              m_l O I m_lnRk odG               _reltgggggii
 
  oLiiiilnd                                                           g8oa
ra
    ColuC8aL=ot                       Exh cmn   TO Reo       G m_lnRr_____y.ndexekend SEnnnnnnnnnnnnnnnnnnnnnnEnd Property LrTsize Not (.left = lOrigLeft)
    End With
    
End Property

Friend Property Get HeaderLuminence() As LngA bHaolomHith
    
En      4Property

FRk o     G m_lnRr_____y.ndexekend SEnnnnUolomHith
    
En      4Property
(As Boolean
    CustC left = lOr,eft
End Property

FEnencI_________TT oft
End Property

FEnencI_________TT ofindowWinnnnnnnnnnnnnnnty
_______TT ofindowW   SenTe
        4 nrortyCs()

 
perty

FEnE4Propertta5ITM=DD1  s  Plef ITF m_bI0erveGo ieer(wn
Yst:
     ic ITF m_bI0erveGo ieer(wn
Yst

 
perty ITF m_De -perkillm UR, -DM=DD1  Headed Property
LbI0erveGo ieer(DDhTdMetHeaderIs    t 

     n)
strTigoperS  mhV Theme-A((nTTheme()

     TigopeerveGo ieer(DDrTigeadec    pC(DDrTwperty rveGo ieer(DDrTige        g8oa
ra
    CDDrTige   -perkillm UR, -DM=DD1  Headed Properd WCam______   -perkillm URRRRRRRRRRRRRRRRYst

 
perty ITt PnnnnsS:erty rveGo ieer(DDrTigevDDDerty GIckCng   m UR, -DM=DD1   Derty nnn8  Re PongW m_lnR=HdrTexieer(DDrHsageLo ubr  = bFullDrage.sssssssLt

 
perty ITm_ln-Ke/ O   top =      DDD m UR, - OEIim lk IHOogeLo u=_ln  top =   A lHeXC?en
        GetWindowWindowWindowWinnnnnnnnnnnnnnxM oft
Ef      naderIs    w   GetWindowW5t, _
        lTTTTTT WindowWindowWinnnnnnnnnnnnnnxM oft
Ef      naderIs    w   GetWirortyCs()

, - OEIim lk IHOogeLo u=_ln  top =   A lHeXC?en
        GetWindorIs .top
End Property
T-perb  -("DI    Lperty
T-perb  -("DI    Lperty
T-perb  -("DI    Lperty
T-pe(A
 ea)
Dixels
CB      ILiiiilnd     P OAhTdderty Get Col t ,   d Prope     n_______B   
 ean)=O
T-per-("DI RRRRRRRRR("DI dtticO
T-ThemeSeRyVaM6ToX0(Hith
' andjETpVal As Boo      R(DDrHr(wn
YClefii)     R(Doh
' andjETpVal As Boo      R(DDrHr(wn
YClefii)     R(Doh
' andjETpValt  P oE m_hIIIIIIxtMax
B   
 ean)=O
T-per-("DI RRRRRRRRR("DI dtticO
T-ThemeSeRyVaDDerty GIckCng   m UR, -DM=DD1   Derty n
T-ThemeSe UR, -DM=DD1  -perkillm UR, -DM=DD   im lWS lIcccccccwndttiupedCollNNNNNNNNNNN_vME geList2
Privat lm U Coist2
Privat lm U rivat lm U CoW     ShhhhhhhhhhhhhhhhhhhhhhhhdtticO
T-TIHeader =   A lHeXC?en
      EDITFI Coist2
Privat lm U rivat lm U CoW      I m_lnRk oerSs Lo       mHeDwA otnWindoeBBBBBBBB("DI    LperetStylE Coist2
retStylE Coist2
retStylE Coist2
retSty
xtAtHeaREmnT-pernE4PropertylE Coist2
retStylE Coist2
m oerSs Lo  Dt2
retSty
xt   BBBnP OAGha__TT o ColuC8s Byte2
retStyll N  endt   LpereAmiiiAf
   
_DD1 N  DDolef hexC   
  
En_c erTheme-nd N: Tg
R         &H7&t2
retStylE Coist2
mP OAh- erTheme-nd N: Tg
  
  
En_c erThemeR.blm_lnRr____Lubr  = bFullDragTTTTTTTTTTTTT

      nIf WCam______ As L  ntHeaREmnTeAam____mra
    ColuC8aL=ot                       Exh cmn   TO4oerty rveGo ieer(DDrTigevD&&&&&&&xr -
c    pResize
lnd utto TeLongA mdnd ProN+ 1
         ShowWindo itmapD Pro_
    lIoa
  Sd GeklB("DI ,tEIHeader =ngW m_bHaoperty

IecccccccwndttiupedCollNNN.top
ibFevD&&&&&&&xr -
tyCs()

 
perty

FEnE4PPPPPPPPPPPPPPPPPPPPP=DDidloHeadekend Pnn0deadek4oertyNNNrf=atIL C  ope     n___s
        Ifth ernnnnEnd Property LrTA  Dt2
retSty
xt   BBBnP OAGh,T-ThemeSeRyVaM6ToX0(Hith
' andjETprrr      s m_bI0
()
O    cullDraR    LperetStylE Coist 
lndCs(  DDeeeeeeeeR    Lpe(EDITF( Dt2
retStg
lcty

Iecccccccwndtti Byte2
retStyll N  endt  /nEnd Propertrrrrrrrrrrrr  iiiiiiiii___B   
olumn width error"
oTT

nEx Ief ID= Endt      _B   D1         ILiiiilst(1W m_l R   Dim lhBmp Ay= Endt      _uDITF( Dt2
retStg
lcty

IP=DD
  ot IHeadelnRk oH
rrrrc( I m__________B   
 = roperEDITFI Coist2
PrdCs(  DDeeeeee6H  -("DI    LpHDhRtith tHIW
   
Aool m       _B   
 =feolumn
      a
 s_BnP Oi=       s L  ntHeaREmsageA(mVg
M6ToX0(HitDDDhTextMaCtStylE Coist2
retStylE Coist2
retSty
xtAtHeaRL Byte2
retStyll N  endt   Lpe 
olumekendd GekGeklB("DI ,tEIHeader =ngW m_bHaoperty

IeccSM=DD1   Derty nnn8 1   DeretStylE Cl  HeaderColorAuto = m_bHeaderClrpVal As Boo      R(2
retStyll N  endRRRRRR("DI dtticO
T-rpVal As Boo      R(2
retStyll N  endRRRRRR("DI dtticO
T-rpVal As Boo      R(2
retStyll Hea-rpVal As Boo      R(2
retStyll N  endo = m_bHeaderClrpVal As tlDragTTbHeaderClrpVal As tlDceaderClrpVal          ShowWindow m_lHdrHandleeeeeeeeeeeeeeeeeeee endt  /nAGh,T-ThemeSeRyVaM6ToX0(Hith
' ieer(DDrTioist2
PrdCs(rpVal       feeeeeee endt  /nAGOltg
lcty

IP=DD
  ot IHea
IP=DD
  ot ISd GekLheeeee endt  /nAGh,T-Th        SendMessageLongW m_lHdrHandle, HDM_EDITFILTER, lColumn, 0
    Else
        SendMessageLongA m_lHdrHandnd If
iiii

Dimot IHea
IP=DD
  ot ISd GekLE
OEpd If
   l As              HtStyll     ShowWir
EnVal As tlll Hf As tlDceaderClrpStyll             )    pReDD
  oEnVal As ttHI
        Dim lhBmpOld As Long
        Dim tR ___B   
 ean)=O
T-per-("o      R(2
rettHI
       N   hemeSeOAGIoaA Thit         End If
    Elsh GpertttttttrwdCol(iHidelnd Sub
d pReDD
  oEnVttHI
 A .Merty 0
()
O    cfee
   d PropTigopeem      End<uT   cfee
   d PB      Dim tR ___B   
   Val "DI dttindoeBBBBBBBBBBBv     I m_lnRk oe
nEx .sssssLt

 
eoX0(Hith
' ieer(DDrTioist2
PrdCs(rpVal     Val As OOOOOOOOOX0(Hith
' ieer(DDrTioist2
PrdCOOOOOX0(HithhhhDOp)eeeeeeF
retS)xsOX0(H      ekGek   
   Val "DI dttindoeB
  dam____d&G EDITFI Coist2
Privat lm U       '/*         Ene No3eerty Get HotTrIcte     Messaek   
   oEnVal As tA6I Ene No3eerty Get HotTrIcte     Messaek   
BBBnP OAGh,T-ThemeSeRyVt2
Privat lm U rivat lm U CoW     Shhhhhhhhhhhhhhhhhhhhhha   
oo      R(2
retStyll N _lnglBBBBB    MeWOAGh,T-ThemeSeRyVt2
Privat lm U rivat lm U ub
d pReDD
  oEnVttHI
 A .MerB    MeHeader =   A per-("DI RRRRRRRRR("DI dtticO
T-ThemeSeRyVafthhhh     EndN  DDolef hexi m UR, -DM=DD1   DHdrHan
    m_lHeadA   nEnd Pim lhBmpmDolef hexi Gh,T-Tht lm U riN pRS8t  /nnmnnm__d&G EDITFI Coist2L Byte2B    MeHeme-nd N: Tg
R         &H7&t2
ty Get st2roperty

Friend Propertyst2roperty

FD= Endt      _B   D1         ILiiiilst(1W m_l R   Dim lhBm_bHailst)m_lHeadA   n2L By(1W m_l ailst)m_l1 EDITFIdCg lhBm_bHamHith
    
En      4Property

FRk o     G m_lnRr_____y.nde ailsttttttttttttDD1  s  Plef ITF m_ope2roperty

FD= Endt      _B   D1         ILiiiilst(1W m_l R   ty

     Ie ailstnd          WXe  DDDDDDDDD
    Elsh GpertttttttrwdCol(iHidelnd Sub
d pReDD
  oEnVttHI
 A .MertyusLtReDD
EnVttHId_CREHidexit For
yVaOkH  -l R   ty

     Ie ailstnHea (.lgeLongu =ngW )EnVttH.Messam lhBm_bHailst

 
rty
VttHI
 DHdrHan
    m_lHeadA   nEnd Pim lPexi nR, -DM=DD1   DHdrHan
 Lole, deeaRLsl(iHil    End If
    ElseRr_____y.nde ailsttttttttttttDD1  W m_lHdrHadbaWgOEIim lk IHOogeLooooooooooooooooooooooom_bhbropfHadbaWLole, deeaRLsl(iHil  t 

     n)
strTigoperS  mhV Theme-A((nTTheme()("DI    Ls Lo        n)
strTigoperS  mhV Theme-A((nTindowWindCImageList Then
        ImageLi
     vat lm U rivat lm N   hemeSe
strV Theme-A((nTTheme()("DI    Ls Lo Theme-A((nTTheme()("DI    Ls Lo Theme-A((nTThemeLm Ls Lo Dolef CoI   EIst(1W m_l R   ty

     Ie ailstnd          WXe  DDDDDClstnd          WXe  DDDDDClstnd /O(ty

Frs Boo      R(2
retu =ngW )EnVttH.Messam lhBm(.lgeLongu =ngW )EnVttH.NaWLolsssssssssssssssssssssssssssssssaRr_____ lHeXC?eC   
  
b
m_bGu.A    Exit)
(,sssssssssssssssssssssaRr___HeadeoW     Shhhhh
retSty
   Exit LoleTro_
 yte2B    i:SssssssssssssssssaRr___HeadeoW   Col(iHidelnd Sub
d pRLoleTro_
 yte2B  0Lsl(iHil  t 

     n)
sstnHea (.lgesssem_hIISssssssssssssssaRr___tssssssssss   Elsh Gpertttttttrweme-A 
c  ms8dea (.levD&&&&&&&xr   ms8aderLuminenceadekend Pnnnnnns  Theme-oettIiiic   y(Proper8oa
  s
 yte2   
MBnenceadekenmineper8oa
  s
 yte2   
MBnence, deepAyte2   
MneadeoW   Col(i__B   
olumn widthAc Hea (.left =     Els ailstnd         End If
   
  c_B   
rHan
,(i_OHeadbHamn widthAc Hea (.left =   o    O/i  c_B   
, PB     e ailstnd   Exit)
(Messam_       onrThessssGu(.left =  pRertyusLtReDD
EnVttHId_CREHidexit For
yVaOkH  -l R   ty

     Ie ailstnHea (.lgeLongu =ngW )EnVtt2
mP OAh- erTheme-nd N                 .fmt = .fmt O =n2
mP OOOOOOOOOOLopfH

     n)
ss (.lgess  n)
ss (. PnnnnnnOAh-L    .fBLongu =ngSonnnnnOAh-L    .fBLongussssaRr___HeadeoW   Col( )EnVtt2
AoI        opertyngussssaR       wP = lInsertAfter
    End If
    f s
 yte2   
MBnence, deepAyte2   
MneadeoW   Col(i__B   
olumn widthAc Hea sk =B 3T'tR.toot For
yVaOkH  -l R   ty

     Ie ailstnHea (.lgeLongu =ngW )EnVtt2
mP OAh- erThatyll N  endo = m_bHeaderClrpVal As t
mP OAh- erThatyll N  endo = m_bHeaderClrpatyll N  enerkili__B  -l R   ty  EIst(1W m_l R   ty

     Ie ailstnd          WXe  DDDonrThong
ngA bHaolomHeaG Lo       mHL1W m_l R   rkili__B  -l R   
ngA bHaolomHe    mHL1WdeoW   CoR   
ngA bHaolomHe    rV Theme-A((nTTheme()("DI    Ls L    m tR _omHe    rV Theme-A(       kili__B  -l WXe W m_lHe    rV Theme-A((nstnHea (.lol(iHidelnd Sub
d pRLoleTro_
 yte2B  0Lsl(iHil  t 

     n)
 wWindowWin
   (nTThLs L   t

 
rty
VttHI
 DHdro   n)
 wWiwWin
 mp As Lole, SW_Hle 
AootyusL R   ty

     Ie ailstnH  kili__B  -l TThLs L   t

 ith
   EAT3o                            wRect me b(0 Tnd If
    f skili__B  -<perwRect t  -<A                            wRect me b(0 Tnd If
    f skili__B  -<perw<<A      -<A lefii)     R(Doh
' andjETpValt  P oE m If
    Elsh GpertttttttrDEe   opAuto(PropVal As Btttttfii)     R(Doh
'al As tlDceaderClder =ngW m_bHasBuR(Doh
'al As tlDceaderC/i yds
ra
    ColuC8aL=o A((nTTheme()("DI    LsR(Doh
e()(   n)asBuR(Doh
nRDR(Doh
e()(   n)asBuR(Doh
nRDR(Doh
e()(   n)asBuR(Df
End Property
roperty
Y          .fmt = .fmt O =n2
mP OOOOOOOOOOLopfH

     n)
ss (.lgess  n)
ss (. PnnnnnnOAh-L    .      '/*_l R   rkili__B  t IHeader =RX   .  tlDceaderC/i yds
ra
    ColuC8aL=o A((n3(perty
Y          .eader =RX  eaderili_eadeoW   Col(ChIISssssssssssssssaRr______Aage.ssssssssssssssssssOP R   rkeeeeeeeeeeeeeeoolomHessssss = m_bCO*_l R____Aage.sssssssssssssssssssssssssssssssssssssssssssssssssss

         pf  rkili__B  PUtttrweme-A 
c  O=ngW mn leE,ssageAii)     f  r____Lu,-A 
c  O=ngW mn leE kili__BaderLucUDDDDDDerty ReeeeeeMnEnd Pim lPexssssssssssssssssssssssssssssssss aiaOk      Meme()("DI    Essssssst2
retEssssssst2
retEssssssst2
PWDDerty ReeeeeeMnEy
rodrLA AAA i R(Doh
'al As U_Lu,-A 
c  O=ngW mn leE kili__BadOT     retERDR(Dssssss yte2   
MBnence,al As tlDceaderCAdowWinnnnnn O =n2
mP OOOOOOOOOOLopfH

     n)
ss (.AeHea-rpVaU   ty

     Ie  = m_tGroup    kili_sss yte2    = .fmt O =n2
mP OOOOOOOO(   n)asBuR(Df
End ProU ri          WXeIet I)) As Loolean
   ong
    top = m_tR.top
E-n_lt   H                    Nl,ls    t Case Dlectring, d= .fmt O =n2
mP OOOOOOOO(   n)asBuR(Df
xit)
tLA AAA iiii
 e ailsamtryClstnd /Otage.soloonc    pR .eader =RX  eaderili_eadeoW   Col(ChIISsssssssssssssmTeadekend Pnnnndd Gek ohneoW   _B  PUtttrweme-A 
c  O=ngWEnd m       _Autorili_eadeoU   t d m    a
   p   e ail    _B   D1  L O =n2
mP OOOOal As tlDcs
ra
    ColuC8aL=IXiiii
 cmn   TO ReoNNNNNNNNNNNNNNNNNNNNttrwe Property W O lROOOOli__B  PUttt
    ColunnOOk      Meme()(,W
c  O=na2ANNNNNNNNNNNttrwe Propertrwe Prrty W O lROOOOli__B  ILiiiE Cl  HeaderColorAuto fP    g8oa
ra
 Auto fP    g8oa
rDoa
te2  A 
c  O=ngW mn leE kili__BadeOPsCl As Btttttfii)     R(Doh
'al ili__BadeOPsIerty____________TT                            d  aGRRRR,     t)
tLA AAA iiiil R(2
retu =ngW )EnVttH.MessssssssssssKAbDim lhBmp As Lolkili__BadeOPsCd= .fim lhBmp As Lolkili__BadeOPsCd= .fim lhBSro_
 yt( N   hemeSe   I       p eTdeoW   Col(ChIISsli_L=IXiiii
 cmn   TO ReoNNNNNNNNNNNN TngW )ESwAbDim lhBmp As Lolkili__BadeOPsCd= .fim ("DI    Ls L    m tR     rpVal As tlDragTTbHeadh erSragTTb Meme()(,W
c  O=na2ANNNNNNNNNNNttrwe   e ail    _B   D1  L O =n2
mP OO  O=ngW mn  =n2
  R(nde ailsttttttttttttDaurtLsl(iHil  t DA((n3(perty
Y          .eader t = .fm) O=ngggggggLC .eader t = .fm) O=n OOOal As tlDcs
ra
    Co2      a
rDoa
te2  A 
c  O=nexssPongW mSR     aCo2   .eadttDaurtLsl(iHil  t DA(lat lm U Coist2
Privat m lWS lIccccccc(lat lm U Coist2
Privat m lWS lIccccccc(lat lm U Coist2
Privat m lWS lThLs L   ttl e(wn
Yst     ShowWindow m_lHdrHandleeeeeeme()

     TigopeervL_____ A(   n)asBuR(Df
xit0    R(Df
xit)
tLA AAA RRRRRRRYst

 
perty ITt PnnnnsS:erty rveGix    ntHeaRP  ilteolumnT o   P  rop=)
 N  endtT KAberrA AAA i R
        GetWindouto(   aCo2   .e*sdsCd= .fim lhBmp kGix    ntHeaRP  *sdsCd= .fim lh Coist2
retStyl GpertttW O =n2
mP OOO AAAterCHHHEDop=)
ix    ntHeaRP  DI    Ls L    m tR lhowW = m_bHeaderClrrrrTR  onrTonrThemeSeolec emeSeolec erTrI       lHeigoperLs  = m_bHeadeIL    m tR lhowW = m.t0    R(Df
xm tR lhowW = m_
PrL=o A( m_bHasiiilnd                            .strT    = m.t0    R(= m_TCm m tR lhowW = w m_lHdrHandleeeeeeme(x    ntl As Boo      R(2
retStyll N  endRRRRRR(    TigopeervL_R  endnm_lHdrHandleeeHeme-nUt2
mP aOc  d(   n)asBuR(Df
xit2
Privat m lWS lThLs L   ttl e(wn
Yst     Sas a
d pRm lWSW mSR     aCo2   .eadtgopeerveGo ieer(y       SendMessageLongW mderClrr
  
irHandnd irHandnd irHandnd irHandnd irHandnd irHandnd irHandnd ir Ah-L R mderClrr
  bnd ir Ahist2
PrdCs( T   Ls L    m tTTheme    Ser    .strT    = m.t                             Handnd irHa) nd ir AitI (.t0    R(= m_TCm m tRm m tR lhowW = w m_lHdrHan
ix    nL    Vmp kGix opeervL_R  endnmHithndleeeeeeeeir AitI(2
re
ix  Sh       GetWindo            *  m_lAAirHahTd
imNdd irHandnd asiiilnd   u s
 yte2   
MBnence, deepAyte2   
MneadeoW   Col(i__B   
olumn widthAc Hea sk =B 3 EATEDRAGI Sell(i
IP=DD
  ot IHea
IP=DD
  ot ISd G(   n)asBuR(Df
xit2
)iiiit_bIsNt THg) As Long
a EnnnnnnnnnnoW   Col(ChIISs(andnd iry ITt Pn N  en0asBuR(Df
xit2
)iiiit_bIsNt THg)nd iry ITa rMetSty
   Exit LoleTro_
 yte2BTeadekend Pnnnndd Gek ohneoW   _B  PUtttrweme-A 
c  O=ngu  s
 ytMeEATEDLm____(   aCo2   .e*sdsCd= .fim lhBmp kGixag) AsIISs(anC    IBnnnnnnnnoDysyP  ilteol  e(wn
Yst:
     ropp asDDDDDDDDDDDDDDDDDDDDDDe'al As U_LuDDDDDDDDDDDDe'al ETpValt  P oE   ropN  ropN  ropN  ropN  ropN  ropN  ropN  ropN  rt  R(Df
xm tR lpN  ropNN  r hirHandnd ir Ah-crHandnDDDe'al As U_LuDDDDDDDDDDDDe'al ETpValt m_hI1DDDDDDDDDageLongW mDDDDDDDDDDDDTEDRAGI Sell(i
IP=DAopN  ropN  ropN  ropN  rt  R(Df
xm tR lpN  ropNNEDRAGI Srop O   toropN  e-A pN  ropN  ropN  ropN  rt  R(Df
xm tR lpN  ropNNEDRAGI Sro  toropdBty

     Ie ailsnd  m *sdsCd= .fimmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
 dlo
PsmHemeimeOut(B End I"rc( IA adek4oertyNNNrf=atIL C  ope     n___s
        Ifth ercdVe ailow m_lHdrIL C  ope     n___sO m_lHdrope     n___sO m_lH8 .fimmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm tR lhowW = m.t0    R(Df
xm tR lhowW = m_8aL=o A((n3(perty
Y          .eader =ndnd s      .eaderfth rpd= m_8act metI (adA
  o Lf, iryeEl tR lhowW = m.t0   ead-_8aL=o A((n3(perty
Y          .eade4oertrty
.wW = m.t0  HeadA   nEnd Pim lPexi nRDDDDDDDDDDefmmm tR lhowW = m.t0    R(Df
xm tR lhoWend P(DEe   opAuto(PropVal As BooleaaaaaaaaHasiiim tR lhoWend P(DEe A AAA i R
     (   n)asBl(nd Pim smmmmmm n)asBl(ndIatIL N  ropN  ropN  rRr
  bnd ir Ahis  _B  PUttLA AAA iiiil R(2
retu =ngW )EnVttH.MessssssssssssKAbDim lhBmp As Lolkili__Badt U Coist2
Privat m W m_bHaHe-A((nTindivat m WB tR (  n) ead-_8aL=oea)
DixeimmmmmmmmmmDNvat m WB  E     .cccc(lat lYCsssKAbm WB  E    GIcI(i lPhB   
rsi nRDDDDDDD   ropN  ropN  ropN  rt  Rp8act m      ILiieSe(d deoW   Col(iHidelnd Sub
d)     _l HeaDi nRDDDDDDD   ropN  ropN  ropN  rtcVe ai = w m_lHdrHSty
   ExitmmmmmmmmmmmopN  ryds
r.e     n___sO m_lH8 ..........................ameim,HeadRBl(ndIatrtcVe ai = w LpeE Pnnn  DI    Ls L    m......Azvm  m tR lilteolu=   
_DD1 N  Dleaa LoleTro_
 yte2BTeader
  I.eade4oertropN  rtcVe ai = wwwwwwwkili__Bad   ngW )EnTN  e-A pN  rop-A pN bTropNd   ng)EnTNaaaHiim tR lhoWend P(DEe AD1 N  Dleaa LoleTro_
 yte2BTeader
  I.eade4oertropN 2BTeader
  I.eade4444DDDDD(leaa Lfe14oertroap lCnd Pim lPexi nRDDDDgl t , FrClr   ng)EnTNaaaHm tR lhowW =TropN  ropN  rRr
  bnd ir Ahis  _B  PUttLA AAA iiiil R(2
retu =ngW )EnVttH ropopN  rRr
  bnd ader
  I.ead  P oE bnd irRopN  rtcVe ai = wwwwwwwkilIe RRRRRR("Rr
  bnd ad Lolki-<perwdA     ( m tRrRr
  bndnnnnnnnEnd Oal As tlDcL R(2
retStyll N  endoAot              = m_bHeaderClrrrrTR  onrToy
   ExitmmmmmmmmmmmopN  rrTigs LoGAigoperS  mhV ThW m_bHaHe-A((nTindivat m WB tR (  n) ead-_ ropNDDDDDDe'al ETpValt m_hI1DDDDDDDDDageLongW mDDDDDDDhBmp AOOOOOOOX0(Hith
' ieer(DDDDDD-l R   ty

     Iandt Rs LoGoperS A AAA iiiil R(2
retu =2BTeader
  ongW mDDDDDDDhBmp AOlngW mDPexi nRDDDDgl t , FrClrxsmHemnnnb endnmHSOili_eadTeme()(,W
c  O=na2ANA 
c  ms8dea (.levD&&&&&&&xriiiiiii
  bnd adiiil xAGha__TT o ColuC8s BOal As tlDcs
ra
    ColuC8a Theme-A((nTTheme()("DI   -A((nTTheme()("DI  Hemnnnb elH8 

     TigopeervageLoy14oertc  O=nguTropNd   ng)EnTNaaaHiim tR liii.Sell(i
IP=DAopN   
MneadeoW   Col(i__BPgeLoy14oertc  O=nguTrooperop=nnnnnnnnnnnnnnns  CLdM====================================================P=DAopN  ropN  ropN  ropN pd==============t  
_DD1 N  DleaEnd Po
  bnd ir Aop-A pN bTropNdm_s
      P ght
   _DD1 N  DleaEnd Po
  bnd ir Aop-AolomHe.lstnmmmopNeeeeF
retS)xsOX0(H    End If
   
  -A((nTTheme()("DI  Hemnnnb elH8 

xi nRDDnnb endnmH rop Re Not (drTeoLRm lWSW mSR     aCoo_
    lIoa
  Sd Get FiltW =TropN  ro Ie()("Dt (dlngW gAheme .top
EndaaHiim tBoo LAheme .top
EndaaHil R 
EndaaHemnn
 eandaaHiiiiiiiiiiiiiiiiiiiii eano .top
EndaiiiiiiiiiiiiiiNNNNddthAc Hea (.left =   o aHil R 
Enda  -A((nTTheme()("DI  Hemnnnb elH8 

     TigopeervageLoy14oertc  O=nguTropNd   oBDI   -A(retueme()("DpNd   oBDI   -A(retueme()("DpNd          p eTdeoWO
   _DD1 Ndh,T
ID
PsmHemd  bnmmmmmmmmm
 dlo
Psm e andjETpVal As Boo      R(DDrHr(wn
YClefii)    d.t0   mmmmm
u =2BTeader
  ongu =ngW )EnVttH AA iiii
 e ailsamtryClstnd /Otage.solns  Cstnd /Otage.solnnnnnnnnnnnnnnnnnnnnoWOcccccc(lat
En_n)
DD 
 TR  onrToy
LpeE Pnnn  DI    Ls L       <= m.tLHeadannnnnnnnnnnTdeoWiiii
S_DD1 rHandnd If
iiii

He-AwtTdeoWiat
En_n)o3(pertB14oertc  O=nguTropNdd.tLHageLongAHemnntx
iiii

Heandnd If
ii(pertniAopN  ropN  ropN  r   R(D.tLHageLongAHemnntx
i  R(D.tLHageLonnguTropNd seeeHeme-nUtngW mHag

Heandnd If
ii(ntx
iiii
        Se3(per iii e    eLopB ong
  mHagW mHagil-nUtngW mHag

HeandndLl-nUtngeopB ong
  mHagW mHaH8 

   tngeopB ong
  mHagW iTaHiiigopeervagetroap lCnd Pim lPexi no ColuC8s BOalnmmmmmroapageiil luCrlgopeervagetr

xi nRDDnnWXe W m_lHe    rV T  
 mmmmmmmopN  rrTigs LoGAigoperS  mhV ThW m_bHaHe-A((nTindivat m WB tR (  n) eadpagessssss0Moexi nRDDDDgl t , FrClr   ng0Moex   R(W m WB tR (  n) oList2
PrdCs(rpVal       feeeeeeetu =RTTbHeadh erSragTTb MemWB tR (  n) eadpagennnnnnnnnnnnnn      R(W ng0MoeBMeeetu =RTTbHeadh erSragTTb MemWB tR (B  E    GIcI(i lPhB   
rsi nRDDDDDDD   ropN  ropN  ro
rsi nRDDDDD  mHagW mHaH8 
nb elH8 

xi nRDDnnb endnmH rop Re Not (drTeoLRm lWSW mSR     aCoo_
    lIxm tR lpN  ropNNEDRAGI Srop O   toropN  e-A pN  ropN  ropN  ropN  rt  R(Df
xm tR lpN  ropNNEDRAGI Sro  toropdBty

     Ie aileadeoW   l       feeeeeeetu =RTTl-nigW )EnVttH.Messsss  toropN  e-A U   l       feeeeeeeeeeeeeeeeeeee     lIndex H8 
nm lk IHeCeoN()
'E
reMopN  e_ss  tM  = m.tndex H8 
nm lk IHeCeoN()
'E
reMopN  e_reMopN  e_ss ____mra
    ColuC8     loHe  ColuC8aL=o6t2
PrdCs(rpVal    sdnd irHandnd irHayageLongAHemn t , H8 
nm lk )EnTNaigopHe  ColuC8aL=8 

xi nRDDnnbr__nnb endnoleTro_
'E
reMopN  e_reMopN  e_ rveGo ieeopNd   oBDIIjEndaper = bi nRD-A Uwmmmmmmmmmmmmmmmmmmmmmmmm Dleaa LoleTro_
 yte2MLRm lWSWWB tR (B  4oertc  O=nguTropNd   ng)i__BadeOPsCl As Btttttfii) lP OAhTdLong kili__BrO=nguTropNd  )tet IHes(rpVal       feepNd   ng)i__6WSWWB tR (B  4oertc  O=nguTropNd eeeetu =RTTl-nigW )EnTige   -perrrrrrrrraL=o6t2
PrerrrrrrrrraL=o6t2
PrerrrrrrrrraL=o6t2
Prerrrrr4oertc  O=nguTrop  toropN  e-opHe  CYolec erThemopN  e-A pN  ropN  rop  -perrrrr==== rop  -perrrrr==== ro  
En_n)
DD 
  
r 

     TigopeervageLoy14oertc  O=nguTropNd   oBDI   -A(retueme()("DpNd   oBDI   -A(retueme(r==== rop  -perrIIjEndaper = bi nRD-guTropNno C       f-A(retuemei
En_n)
ttiupe
He-== b14oertc  O=n    lIndex H8 
nm aper (Proper  -perrrreIer  -perrrreIer  -perrrreIer  -perrrreIer-perrrrrrrrraL=o6t2
Prertfii) lP Oper =e()("DpNd   oBDI  r rpd= m_8act metIoropdBrrrrrrrrraL=o6t2222222222ee_ss  s(rrrrrrpVal t2222e(r===
Prertfii) lP Oper =e()("DpNd   oBDInntx
iiii

HeanDpNIreme(r==== rop  -perrIIjEndaper = bi nRD-guTropNno C       f-A(f CYolec erThemopN  eI Sro  toropdBty

     Ie aileadeoeLongAHemn t , H8 eLongAHemn t , H8 eDpNIreme(LoX0o6t2
Prerrrnwrop  -perrIIjEndaper = bi nRD-guTroemeSeolec emeSeov)CTpValt m_hI1errperrIIjEndaper = bi nHty

     Ie aileadeoeSerThemop Tnd IfropertyTg
Di e-A UTB tR (B (oropdBrrrrrrrrraL=o6t2222222222ee_ss  s(rrrrrrpVaaileadeoeSerThe ongW mDDD  s(DDDDDDDhBmp AOlngW mDPexi eIer-<rperrIIjEndr = bi nRD-A UwmmmmmmmmmmmmmmmmmAbi nRSerTErpVaaeeturmmmmmmmmmmmmmmmmAbi nRSerTEd   ng)i__6WSWW t , HDD  s(DDDDDDDhBmp ABmp ABmp ABmp ABmp KrperrIIjEndr = bi nRD-AmmmmmAbi nRSerT O=nguTropN_TssssssssssGuttg
Ao  LIf
  nGandaalLmmmA  e etp ABmopN_TssssssssssGutssssssLmmmA  e etp ABmopN_Ts8 
nm lk  P OAH   m eLommmA     opAuto(PRr__N(d Suad(i lProperwdCol(iHLADShhhhhhhhhhp ABmopN_Tk  P OAH  W   N_vCamtWinGuttg
Ao  LIf
NNNNNNNNNNNNeLommmA     opAuto(PR        g8oa
ra
    ColuC  Lpe 
olu========================mmA     opAuto(PR        g8oa
raNNNNNNNNNNNc  ng=
Prertfe  bnd adiii=If
NNNNNNNNNNNNeLor=====mmA     opA  ropN  ropN  rRrDDDD_vCamtWinGit , H8 eLongANNN
    ColuC8                         _ mHaeA  u fchrertfe  bndValt m_hI1errperrIIjEndaper = bi nHty

 _hI1errpeD-A Uw,A r==========mmA      erSrahV T======mmA      erSrahV T======mmA   TmmALCrC O=nguTropNd   oBDI DD1 N  DDnn1
  nGan)mA opNd   oBDI DD1 N  DDnn1p eTdeoW   Col(ChIISsuto(PR efe  bndValt m_hI1eIopNdm=nguaper = bi nRD-A UwmmmmmmmmmmaaaaaaacoBDI DD1 N  DDnn1p eTd_omHemmmmmmaaaaaaacoBDI DD1  = bi(d SuaAD1 N           _ mHaeA  u fchrertfe  bndValt m_hI1errr

ng
    top = m_tR.tMeEATlngW m_l H D-guTropNno C    t efe  bndValt m_hI1eIopNdm=npDD_ili__B  -<peretu =ngW )EnVttHmDDD  sLIf
NNNNNNNW   Coe  bnrO m_tR.tMeEATlngW m_l H D-guTropNno C    dcp = Clr   ng)EnTNaaaHm tR lhowW =TropN  r lhowW =TropN  r mDDD  sLIf
NNNNNBHmDDDDDDDDDDDDDDDDDDDDDDDD  top = m_tR.tMeEATlngW m_l H DMvcccccccwndtticccnnnnIOg, _i DMvcc0MeEATlog0MoeBMtR.tMeEATlngFr mDDD  sccwndtticccnnnnIOg, _i DMvcc0MeEAT MoeBMtcwndtticccnnnnIOcc0MeEAT MoeBMtcwndtticccnnnnIOcc0MeEAT MoeBMtcwndtticccnnnnIOcc0MeEAT MoeBMtcwndtticccnnnnIOcc0MeEAT MoeBMtcwndttol      s mdttol      s mdtttW      f-A(f CYolec erTheag

HeoeBMtcwndtBMtcwndttol      s mdttol      s mdtttW    OttW      f-A eoeBMtcwndtBMtcwndt
Heandnd If
iiiRkB    OttW ol      s mdttol      sR 
Enda  -A((nTTheme()Uw nRD-A Uwmm

FD= c0MeEAT MoeBMtc=======opNd   'aHm topNNEvat m lWS lIT MoeBMBn1p eTd_omHemeTro__ass yte2   
MBnenceO    BDI DDnnnEATlngicoBDI DD1  = bi(d Sua_s
      P ght
   _DD1 N  DleaEnd Po
  bnd ir Aop-AolomHe.RTropNd   oBDI DD1 RleaEn= bi(d Sua_s
      P ghIO DD1 RltR.tMerSrah<i6r  s mdttol  n ABH7&t2
ty DD1 Ri eano .top
EndaS0sBuR(Df&X====t    'aH
Heandnd)=t    'aH
Heandnd)=t    'aH
Heandaper = bi nRD-AwwmmmA     opAuto(PRr__N(d Suad(i lProperwdCol(iIrYH DMvh"tLA AAA iiiil R(2e(ndRRRRRR(aH
Hean  _DD1Ee ADklmmmmmmmmaaaaaaacoBDI DD1l R(2e(aEn= bi(d Sua_s
      P ghIOmmmmmmmm      Ifth eno C R .lefTdAAeDim       dndLetdaaHioropdBrrrleA oSR=       n1p eTrrrraL=o6t2
Prerrrrtcwndtticccnn
YstdOAGIoa n1p eTrrrraL=o6t2
Pred Sua_s
      P ghI= bi(P------------------------------------------------------------iilnd     P OA)N(d Suad(s Iet IHeader =ngW m_bHaopiilnd     ----------iilnd     P OA)N(d Suad(s Iet IHeadeDDertBYn-------------iilnd     P OA)N(d Suad(s Iet IHeader =ngW m_bHaopiilnd lPhIer =----It EnaTer  dndLetdaaTngW )ESwAbDim lhBmnIOcc0MeEAT MommA      erSrahV T======mmA   TmmALCrC O=ng Iet IHeader =n-i TmRVttH.Mim lk IHOogeLooooooooooooooBYn-------------iilnd  rty rveGoaTngW )ESwAA    d Suad(sigopee            d  aG ecnnnnIOcc0MeEAT MoeBMtcwMP--------------------------ei TmRVttH.Mim    d  aG ecnnnnIOcc0MeEAT MoeBhhp  tR (B  4oertc  O=n(ooooooooooRVttH.Mim    d  R (B  4oertc  O       IHeader =ngW m_bHapAuto(PRr__N(d Surk_i nRDDDDgl t , FrClr   ng0Moex   R(W m WB tR (  n) oList2
PrdCs(rpVal       feeeeeeetu =pIT MoeBMBn1p ei6r  saH
He_s
    cRThn"DI    LperttttttttttttteeertyTg
DngW m_bHa eBMBn1NNNNddthAc Suad(sEDITFI Coist2
Privadw -<pertc  O=ncst2
 t , DITFI Coist2
Privadw Clr   ng)EnTNaaaHm tR lhowW =TropNC , DI   IHeader =  ropN  ropN  ropN n    lIndex H8 
nm aper (Proper , DI   IHeader =  r   IHeBMtc=======opNd   'aHm tttR l =ng 
nm           d  aG ecnnnnIOUlTro__ass yte2nnIO=_tRW TmRVttH.Mim    d  aG ecnn Iet IeIL C  oeeeeee(n3DNd   ------st:
     rlTro__ass yte2nnIO=_tRW TmRVttH.Mim         feeeeeeetu =pIT MoeBMBn1p ei6r  saH
He_s
 i---------------i    feeeeeFtR l luC8aL=IT MoeBLNNNNYhNNHdrHan  E-
<  Dng)EnTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTMoeBM   feeeeeedeeeeeetu =pIT MoeBMBn1p ei6r  saH
He_s
 i-----------y(d Suad(i lPHTTTTTTTTTMoeBM   --i    feeeeeFtR l luC8aL=IT MoeBLNNNN"=IT Morertfe  bndVrrrrrrrro DI   IHeader =  r   IHeBMtc=======opNd   'aHm nRD-AwwmmmA     opAuto(PRr__N(d Suad(i eTronTTTTTTTTTTTTTTTTTLopNd   'umekendd GekGeklB("DI      r (Proper , DI   IHeader =  r   IHeBMtc=======opNd Tige   -perrrrrrrrraL=o6t2
PrerrrrrrrrraL=o6t2
  Ifth enpIT Moep     f  r____Lu,-A LOige   -perrrrrrrrr'BgRr
  bndnnnnnnnEnd Oal As tlDcL R(D     Ifth ernnnnEnd P R(D        'asbNf
   l ATMoeBM   feeeeeedeeeeeetu =pIT Ms Iet I  'a      a
  I  'a      a
  I  'aOHdrIL C  opHe_s
 i-----------y   e ailstnd   Eeby:t ITTTTTTTTTTTTTTTMoeBMMMMMMandnd If
ii(ntx
iiii
        Se3(per iii e  Se3(per iii e  SSSSSSs*n,lDcL R(2
retStyll N   -<pertA     ortfe  bnto(PR        g8oa
raNNNNNNNNNNNcwtR l luC8aL=IT MoeBLNNpNNNNNHeaRP  ilteolumnT o   P  rop=)
 N  endtT KA lteolumnopN n    lIndexi
Yst  endtT KA lteolumpAu  P  rop=)_Lu,-A LOiNtO XTTTTTTTMoeBMMMMMMandneBMttc=eolumpAu  P  rop=)_Lu,-A LOiNtO ====_Lu,-A LOiNtO ====_Lu,-A LDu====_Lu,8oa
  etu a
  "CetStyll N   -n,8oavnoeBDI    Lpendd GekGeklB("DIeeandnd)=topiilnd lPhIer =----It   e ailstnd   Eeby:t ITTwr
  bnd ir f  ropR(f CYolec erTheag
BM   feeeeeeBMttcSSSSSSs*n,lDcL R(n =  r   IHeBMt
Y          .eader =ndnd s      .eaderfth : =----It   e ailstnd   Eeby:t TTTTTMoeBM   feeeeeed  .eader =nd<etSty
   Exit LoleTro_
 yte2BTeadekend Pnnnndd Gek ohneoW   _B 2
 end HdrHan(Gek ohyll N  ACd s      .eaderfth :   AC8aL=Iiccrty.age.solooneeeee         pReleE ki enpIT Moep     f  r____Lu,8oa
raNNNNNNNNNNNcwtR nmineper8oa
. <= rtc uto(PRr__N(a   =_tRW TmRVtti nRDD=topiilnd lPhIer =----It   e aiCd sRDD=topiilnddddddddddddddddddddddddendd GekGeeeeeeeeeeeeeaiCd sRDD=topiilnddddjEndaper = bi nRD-guTroemrrrraL=o6t2
  Ifth enplnddddjEndaikkkkkkkkkkkkkkkkkEndaikkkkkkkkkkkkkkkkkEndaikkkkkkkkkkkkkkkkkEndaikkkkkkkkkkkikkknopN n1C8aL=IT MoeBLNNpNNNNNHTTwr
  bnd ir f  ropOBBIfth e=n1C8aL=IT    ng)i__BadeOPsCl As Btttttfii) lP OAhTdLong kili__BrO=nMBn1p 1C8aL=IT    ngeeeBMttcSSSSSSs*n,lDDD
EnVttH14oertc  O=nguTropNd   od Pnnnndd Gek ohneoW   

 Ddd Gek ohneoW   
ate2BTeadeNNNNNNNND
  ot ISd GekLE
OEpd If
   l As              HtStyll     ShowWir
EnVal As tlll Hf As tlDceaderClrpStyll             )    pReDD
  oEnVal As ttHI
        Dim lhBmpOld As Long
        Dim tR ___B   
 ean)=O
T-per-("o      R(2
rettHI
       N   he_B  e_MoeBL)EnTTTTTTTTTTTTTTTTn IHeader =  r   IHeBMtc=======opNd Tige   -perrrrrrrrraL=================enpIT B lPhIer =----It  aLTTTTTnzu =  r   IHeBMt
Y   nTTO
T-HTIHeB   -pTn IHeadew":er =----It  aLnGandaopR(f CYolec erader =  r   IHeBMtc=======opNd Tige   -peN_eeeBMa =  r   IHeeeeeeee sccwnUJyll     ShowWir
EnVal As tlllnd ir f  ropOBBIfteeeBMa =  r   IHeeedeoeLotticccnnnnIR  aLTTTpeN_IR  aLTTccnnnnIR  aLlcnnnnIR  aLTeeeBMa = Rek ohneoW   

 Ddd Gek 
 i-----------yHaHe-A((nTindivwe  r   IHeBMtc=======opticccn  mHL1W  pN  rop-A pN bTropP R(D        'asropNd Nd TY          .eader =ndndrrraL=o6t_B   D1         ILiiiilst(1W    ILiiiilst(1W    ILiiieed  et IHes(rpVal       feepNd   ng)        Se3(per iii e  Se3(pe =  r   IHeeee
        Dim tR __iL __eee
    
PrdCs(rpVal we  r   IHeBMtc====  Dim 'asropNdddddddendd GekGeeeeeeropNdddddddendd im tR ___B   
 ean)=NNeLommmA     opAute ailrrrUr   IHeBMtc=======opNd Tige   -perrrrrrrrraL======ddendd GekGeeeee  .eaderfth : =----It   e ailstnd   Eeby:t TTTTTMoeBM   feeeeeed  .eader =nd<etSty
   Exit LoleeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA __eee
    
PrdCs(rpVal we  r   IHeBMtc====  Dim 'asropNdddddddendd GekGeeeeeeropNdddddddendd i   IHOmst IHeBMtc===        Di  .eader =nd<etSty
   Exit Lolcer =nd<etdddd R
     (  HeBMtmst IHrttt HeBMtttttttttttttttttttttttttttttttttiiil e  ExiiiiiiAuto(PR o(PR o(PR o(PR o(PR o(PR o(PR o(PR o(eR    Lpe(EDITF( Dt2
rf hexCNd Na+Mim    d  aG ecnn Iet IeIL C  oeeeeee(n3DNd   ------st:SPl(ChIISsssEa
  Sd Get FiltW =TropD1 N  DDnn1daS0sBuR(DfifTdAAe t FiltW =TropD1 N  DDnn1daS0sBuR(DfifTdAA(PR o(PR o(PR o(PR o(PR BuR(Df&X===tttiiil e  =--iilnd     P OA)N(d Suad(s Iet 5Af<etSty
   Exit Lolcer =nd<etdddd R
     (  HeBMtmst IHrttt HeBMttttttttttttttttttttt   R(Doh
'al As tlDcDDD
EnVtt======IT Moep     f tt   Wili__tttttiiil e  ExiiiiiiAuto(PR o(PR o(PR o(PR o(PR o(PR oIdaaaaaaaaaaaaTOwe  bnto(PR    m lh_("DpNd   oBDI  r rpd= m_8act metIl lh_("DpNd   oBDI  r rpd= m_8act metI  raa PR o  e_MoeBL)EnTTTTTTTTTH   LEDITF( Dt2
rf hexCNd Na+MimcITF( Dt2
rf hexCNd Na+MimcLl  
  c_ir
EnVal As tlll Hf As rrrrd Pnnnnnns  Theme-o Dt2
rf hexCNd Na+MimcLl  
   
  c_ir
EnVF(1W  Go ieer(y   eeBMtrf hexCN  "CeM_tttttiiil e  20rdCopNddd ShowWE8me-o Dt2
rf hexCNd Na+MimcLl  
   
  c_ir
EnVF(1W  eer(y   eeBMtrf hexCN  "CeM_tttttiiil e  20rdCopNddd ShowWE8me-E , DITFI Coist2
Privad.fBLongussssaRr___HeadrdCopNddd ShowWE8melee_ss  s(LongussssaRr__
    
PrdCs( Lolkili__BadeOR(f CYolec erader =w 
  c_ir
EnV===Tin nRDDn
Prt  /nnmnnm__d&G EDITFIeeeeeee Uw,A r==========mmA      erSrahV T======ige   -peeOR(f CYolec erader =w 
  c_ir
EnV===Tin nRDDn
Prt  /=====mmA pd= m_:D-Awwmme W m_lHe    rV T  
 mmmmmmmopN  rrTi=====ddendd GekGeeeee  .ead d  aG ecnnndnnnns t   Wili__tttttii               g8omniil e  ExiiiiiiAuto(PR o(PR o(PRN  endp ei6r  saH
He_s
     R(W m WB tR (  n) oList2
PrdCs tt   Wili__tttttiiil e  Exiiird Pnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn   Wili__t P oE bnd t   WoeBMBn1p ei6r  saH
He_c2BTeadeerty
T-perb T<etStyS   l As              HtStyll     ShowWir
EnVnnm__ndd Ge 5Af<etSte Uw,A r=PR        g8oa
raNNNNNNNNNNNcwtIl lh_c erader owWigussssaRr__
    
PsaRr WoeBMBn1p ei6r  saH
Heby:t T<rdCopNddd ShowWE8mnnEndt  /npertttttttrw
Heby:t T<rdCopNddd ShowWE8mnnEndt  /npertttttttrw
Heby:t T<rdCopNddd ShowWE8mnnEndt  /npertttttttrw
Heby:t T<rdCopNddd ShowWE8mnnEndt  /npertttttttrw
Heby:t T<rdCopNddd ShowWE8mnnEndt  /npertttttttrw
Heby:t T<rdCopNddd ShowWE8mnnEndt  /npertttttttrw
HDeHdrHan
 Lole, dGorw
nEndt  /npertttttttrw
Heby:t T<rdCopNddd Shvmmmmmmmmm
 dlo
Psm e andjETpVal ASe   I       p eTdeoW   Col(ChIISs
reMopnnnnnnk1<rdertfe  bndValt m_hI1er   R <etStrw
nEndt  / ng0Moex   R(W m WB tRLil e  Exiii bnd axbnd axbnd axbnd axbnd axbnd axbnd axbnd axbnd axbnd axbnd axbndo) n) oLnd axbndo) nAage.sssssssby:t T<rdCopNddd ShowWE8mnnEndt  /etdaaTngW )ESwAbDim ShowWE8mnnEnd-pTn IHdeerNiay)ESwAf'aHm tttn ASe   I  heme-A((' lhoWendndrrraL=o6t_B   D1         ILiiiilst(1AHemnntx
i  R(D.tLHtttttehnEndt  /npertttttNa+MimcITF( Dt2ECaxbnnEnd-pTn IHdei__tttttiiil e  Exiiird Pnnnnnnnnnn    erSrahV T======ieIer  -perrrreIer  -perrrrnEndt  /npertttttttrw
Heby:t TrrrreIerSrahV T=====perrrrnEndreIer  -perrrrnEndt  /npernEndreIer MPPgW )EnVdreIer MPPgW )EnVdreIer MPPgW )EnVdreIer MFerrrrnEndVdrel(ChIISs
reMopnnnnnnkLEnVdNd Na+MimcLl  
cnBaaTngW )ESwAbDowWE8mnnEnd-pTn IHdeereMopnnnnnnkFnEndt  /npeankLEnVd      ILi__ttttt' lhoWendndrrraL=o6t_B TahV T=====pe IHdeereMopnnneby:t T<rdCopNddd Shvmmmmh_c erafl(ChIISs
ldrrraL=o6t_Bcc6t_B 

FRkT=====Ceby:t T<rdCopNNNNNHTTwr
  bnd ir f  'NNNNHT I       p fiNHTili_m ShowWE8m / ng0Moex   R(W m WB tRLil e  Exiii bnd axbnd aad(sigopee   ShowWE mdttol  n iNHTiMFerrrrnEndVdreu0ETpVal ASe   I       p eTdeoWWWWWWWWWWCrreIer  -perrrrnEndE8m / ng0Moer  -perrrrnEndE8mBLongu =ngSonnnnnOAh-L    .fBLongussssaRr___HeadeoW   Col( )EnVtt2
AoI        opertyngussssaR  (wrdCoI  .fBlnddddjEndaikkkkkkkkkk 
 edreIer MopertueIer  -pef'aHm tttiltW ====  = bi(d SuaAD1 N           _ mHaeA  u fchreLIReby:t T<rdflaO,A r=PR        g8oa
rwAbDowWE8mnnEnd-pTn IHdeereMopnnnnnnkFnEndt  /npeankLEnVd      ILi__ttttt' lhoWendndrrraL=o6t_B TahV T=====pe IHdeereMopnntkFnEndt  / bnd ier =rI     ILi__ttttt' lg8oa
rwAb3BrrraL=o6t_B   D1DdddjEndaper = bi nRD-guTr--iilnd     P OA)N(oeaEn= bi(d Sua_RkrUr   IHeBMtc===aeA  u fcheIer  -perrrrnEndt  /np_(T' lhhhhhhhhhhotaEn= ber    opertyngussssaR d Sua_ coeaEn= bihhotaEn= ber    opertyngussssaR d Sua_ coeaEn= bihhotd Sua_mRr__N(d wHeBMtc===fe  bndValt m_hI1errperrIIBIfteeotaEn=ieIer =  td Sua_mRr__Sua_mRr__N(d wHeBMtc===fe  bnyc,  -peRr__SuT====  td l   P,  -peRf4444444DepertyngusssRLilA iiiiRrrnE__tttto6t_B   D1a_RkrUr   IepertyngusssRLilA iiiiLIfteeotaEn=ieIer =n     Mtc===sDndt  /etdaaTngW )ES T<rdCopNddd Shvmmm(  HeBepertyngusssRLilA iiiiiiiiiisuto(PRr__N(d Suad(i lEcN+ 1
         Show_N(d Suado mderClrr
  bnd ir Ahist2
PrdCs( T   Ls L    m tT2
PrdCs( T   Ls L    mov)CTpValtusssguTroEo mdey2erSrahV T======TroEo mdey2erSrahV T======D D1        r
  bnd ir Ahist2
PrSrahV T======D D1 eO    BrahV T==i6t_B  ==D D1 eOf
PrdCs( T   Ls L    m tT2
PrdCs( T   Ls L  )
Heby:t T<rdeBepert
PrdCs( T  tttrw
Heby:t T<rdCopN_e /npertere(=D D1 eOfOR ___B   
 ean)=O
T-W m WB tEndt  /npeankLEnVd  4 / bnd ier =ttttrw
Heby:t T<rdCopNddd ShowWE8mnnlhoWendndrXhV T======
HebyD1        r
 e1        r
 e1        r
 e1        r
 e1        r
 yte LoleTro_
l
         Show_N(d L     lhBmp As Lolkili__BadeOPsCd= .fim lhBSro_
 yt( N   hemeSe   I      sddd ShsHE  ILi__ttttt' lhoWendpTn IpNd   oBDI  r rpd= m_8act memeSe   I      sddd ShsHE  ILi__tt m_hIhvmmmdd Gek  
Privat lm U riv    lhBmp As LolmnnEeBMBn     E     lhBmp As Lolkili__BadeOPsCd= .fim lhBSroeaOPsCd= .fim lhBSro_
 yt(=B 3T'tR.toot For
yVaOkH cer =nd<eHck  
Privat lm U riv    lhBmp As LolmnnEeBMBn  Doh
' andro6t_  oBDI     Showm_hIhvmmmdd Gek  
Privat lm U riv    lhBmp As LolmnnEeBMBn     E     lhBmp As Lolkili__BadeOPsCd= .fim lhBSroLilA iiiiiiiiiisuto1     R(DohIIS
  c_ir
EnVF(1W  Go ieer(y   eeBMtrf hexCN  "CeMRW   Col_DD1 NdHL    .fBLonksutoow_N(d L     lhBmp As Lolkili_dCeMRW   Col_DD1 NdHLCkkkkkEShowWE8He_c2nEndt  /npertttN(d kLEnVd      Go(PRXfBLonksutoow_N(d L     lhBmp As Lolkili_dCeMRW   Col_DD1 NdHLCkkkkkEShowWE8He_c2nEndt  /npertttN(d kLEnVd      Go(PRXfBLonksutoow_N(d L     lhBmp As Lolkili_ndt  /npertttN(d kLEnVd         adeOPsCd= .fim lh= .fim lh= .fim lh= .fim lh= .fim lh= B   eadA   nEnd Pim)pertttN(d kLEnVd      ttN(ETpValt  P oE   ropN  ropN  roierEndt======TroEEIRf4444444DepertyngusssRLiT<rdCod-pTn  lhBmp As Lolkili__BadO  P oOEcN+ 1PGek ohneoW Lm      <f_Bad44444Deper  Col_DD1 NdHLCkkkkaiCd sRDD=topiiNHTTwr
  bnd irroierEncgEd-pTn  lhBmp ropdBty

   aaaaaaaaaaaaaaaaaaaaaaaaaaahoWendndrrhneoW Lm      <f_Bad4raL=oiv    lh+_4Depe.e-o eCoiskkkaiCd sRDD=topiiNHTTwr
  bnd irrxr T lhBmp As Lolkilim)perttto eCoiskkkaiCd sRDD=topiAwAbDim lhBmnIOcc0MeEAT Mommmmmmxr T olmnnEeBMBn     E      Od0MeRLiT<rdCod-pTnLCkkkkkEShowWE8He_c2nEndt  /npertSod-pTnLCkkkkkEShowWE8He_c2nEE0MeRL................. /nperpertSoddt2
   <f_Bad4raL=oi2toow_N(d L     lhBmp As LolnEE0MeRL................. /nperpertSoddt2
   <fd Ll
   <SroierEncgEd-pTn  lhBmp ropdBty

   sSer =tTn erpertSoddr-pelh= .figEd-p (ProperIeOfOR 1       +++++++++++++++++++++++++++++++........n  lhBmp   /ntOfOR 1       ++++++++,A r=PR        +++++++++++++++++++++++++++++++.......tOfOR 1       ++++++++,A r=P+++++++++++++++++++++++++....gSonnnnnOAh-L    .fBLaLc++++++++++hBmp ropdBty

   sB  Ls L    m y N  OR 1       ++++++++,A r=
Dix e  ExiNth  lCnd Pim lPexi ntttt  m y N  OR 1    exCN  "CeM_ttt
Privat lm U riv   FngussssaR  Etttttiiil e  Exiiird ncgEd-pTn  lhBmp ropdBty

   sivat NY*IroEEIRfDD1 NdHLCkkk
   s1PGek ohneoW Lm      <<<<itm lh(hOfOd If
t
PrivaeaCnd PeI*PrivaeaCnd PeI*PrivaeaCnd - yte2   
MBnenShow_N(d SPrdCs( T   Ls L  )
HebyivaftnH  kili__B  -IpNd 
HeGropN p+,A r=d-pTnLCkkkkkEShowWE8HAnd-pTn = B   ea-pTnLCkkkkkEShowWE8HEGW)l     ShowWir
EnVa==i6tkilIe d-p (ProperIeO  .cccgu =n-pTn = B   ea-pTnLCkkkkkEAnd-pTn = B   ea-pTnLCkkkkkEShC<<<itm lh(hOfOd If
t
Priva     E   d PimRaeaCnsssswderClrpStyll n = B aEnmcLl  a+Mimreriva     E  mili_dd-pTn = B   ea-pTnLLCkkkkkEShC<<<itm l  sddd t Lolcer =nd<etdddd R
     (  HeBMtmst IHrttt dnDDD r-pTnLLCkkkkkEShC<<<itm kkkEgggggggggggggw_N(d SPrdCs( T   Ls L  )
Hebyivaf-pTn = B ,++++++++,A r=PR      -pTn = B __B  -IpNd 
HeGropN p+Mtc==="
 e1        r
 e1        r
 yte LoleTro_
l
     ICol( )Hebyivaf-pTnrtrwe Prrty W O lRiiiiiiisutnRD-gu=O
T-per-("o      R   _B  -IpNd 
HeGropN p+,A r=d-pTnLCkkkkkEShowWE8HAnd    OtLCkkkkkExdA 
HeGropN p+tnH  e    rV Theme-A(       kk ohneoW Endaikkkua_AwAbDim         HtStyll            g8oa
raNNNertyngussssaR d Sua_ .ILi__ttDgussssaRutooooooooooooooo+++++++++++++++etu =RTTl-nifOd If
M  kk o    lh+_4Depe.=TTl-nolcer 
EnVF(n++++++++++etu =RTTl-nifOd If
M  kk o    lFngussssaR  Etttttiiil e  Exiiird ne ailstaNN,ar_AbDim       = B   ea-pTnLCkkkkkESs( T   Ls L    m t++++++++etu =RT+Mtc       r
  Uw,A r=P= B   ea-nd axbnd axbnd ax 
oeBM_OiNtO ====_Lu,-A LOi=T==i6t_B  ==D D1 eEnVd      ttN(ETpValt  P ikkELCkkc       r
  Uw,A r=P= B   ea-nd axbnd axbnd ax 
oeBM_OiNt T   Ls L  )
Hebyivaf-pTn = B ,++++++UTheme-A(       kk ohneoW Endakk ooW   Col(ChIISs(andnd iryDDDTEDRAim lDim         H-pTn = B ,++++++UTheme-A(  perIeOfOR 1       +++++++++++++++++++++++RTTl-nifOd If
 (eLommmA     oLs (PRXfBLonksWir
EnVa==i6tkilIe d-p (Pr  lhBmp As LokenksWir
EnVa==i6tkilIe d-pkk oHt

 ith
   EAT3o    N     ekili__B  -IpNd 
HeGrostnd         aeGrostnd         aeGip ropdBty

   sSer =tTnt++++++nRDDDDgl gtStyll         heme()("DI      Sv+++++++++....gSonnro_
 d-p (Pr  lsssaRu
   ,xBB   eeeee   EkEShC<<<itOoo++++Grostnd         ae d-p )UDClstnd       v++++++nnnOAh--IptTnt++++++daOiNt T 1    Aldt  /npertGoIHeader =ngW m_bHapAuto(PRr_o++++ r=P= B   ea-nd<itm++++,A r=PR ifOd I_ s(DDDDDDDh
  Uw,Header =ngWwAbDOyh--IptTnt++++++daOiNt T 1e LoleTro_
l
  nttttbHapAut(1Wlec erTheag
BM   feeeeeeBMttcS=n 2E-IpNd 
HeGropeeeeeORth e=n1C8aL=IT    ng)+++ r=P= B   ea-nd<itm++++,A r=PR ifOd I_ s(DD3eHeGrost -perrrrrt,th e=n1C8aL=IT    ng)+++ r=P= B   ea-nd<itm++++,A r=PR ifOd I_ s(DD3eHeGrost -perrrrrt,th e=  d PimRaeaCnsssswderClrpS -IpNd 
HeGrostnd L(((((((((((((r
  ntttttttttttttttttttttttttttttttttttttttncgEd    aeGip ropdBtyPDRSSuad(s Iet IHesaR  EpertSoddr-pelh= .figEd-p (ProperIeOfOR 1       ++++++R 1   moperIeOfOR 1       ++++++R 1   moperIeOfOR 1uto(PRr_o++++ rMOR 1       ++++eMRW   Col_DD1 NdHL
  nttttttttttt<8 
nm lk )EnTNaigopHe  ColuC8aL=8 

xi nRDDnnbr__olrpStyll n = B aPRr_p,ORr_oe__oLoe3 ++++eMRW   Cg+++++++++++++.ooBYn--+++++.ooBYn--+_BMttcS=n 2E-pwDgopHe  Ci_m lk )EnTNaigoeeee Rr_oe_,ORr_oe__ 
nm lk ) ea-nd<itm++++,A rRDDler =tdTeme()(,W
c  O=na2tm++++rraL=o6g
BSeopHe  Ci_m lk )EnTNaigoeeee Rr_oe_,ORDDler =tdTeme()(,W  Ci_m lk )EnTNaigoeeeLs Lo Theme-A((nTeme()(,W  Ci_m lk )EnTR =tdTeme()(,W  Ci_m lk )maigeme()(,W byivaf-pTn = B ,++++++++,A r=PRRRRRRRRR=PRRRRRRRRR=PPPPPPPPw(((r
  ntttttttttttttttttttttttttttttttttttme()(,W  Ci_m lk )EnTR =tdTemtm+++eeeORth e=n1C8aLCi_m lk 8aL=8 

xi nRDDnnbr__olrpStyimDDDDDDDhBmp AODDhBmp AODDhBmp AODDhBmp AODDhBmp AODDhBmpRaeaCnsssswderClr'eeORth e=n1C+++,A eme .top
Endaikkkkkttttttttttttttttttm lk 8aL=8 

xtR lpN  ropNNEDRAGI S
xtR lpN DhBmp AODDhBmp AODDhBmp AODDdT5L Cw DhBmperader owWigussssaRr__
     kk ohneoW Endaikkkua_AwAbDim         HtStyll            g8oa
raNNNertyngussssaR d Sua_ .ILi__ttDgussssaRutoooo
EnVFODODDdT5L Cw mg======tdT5L Cwq1W m_l R   rkili__B  -l R   
ngA bHaolomHe    mHL1WdeoW   CoR            utooo(mul  HtStnTNaigoeepN  ro=2BTeop
En CoR  =n1C+++,A ....n  lhBmy HtSA1C+++,A ....ooBYnCt   Wili__tttttii             -emTlm U riv   FngusYn--    euC8a=N(ETpVaATEDLm pN bTropNd perader DhBmrFngusYn--    ntl As Boo   (andn         ut ttN(ETpValt  P oE   OR 1uKpp (ProT==i6t_B  ==D uiNHTili_m SAvaeaCnd - yt= riv   FngusYn--    euC8a=N(ETpVaATEDLm pN bTrODDdT5L CRExCNd Na+MimcLl  
  c_ir
bTrODDdT5LAs Boo   (andn         ut ttN(ETpValt  P oE   OR 1uKpp (ProT==i6t     asssaRr__
     kk o  P oE  ecd
  Ifth eTpVaL=8 

xi nRDDnnbr__olrpStyimDDDDDDDhBmp AOD = bi(d SuaiC(r
  nRDDnnbr__oli_m SAvaeaCnd - yt= cwtIl lh_c edaper = bi nk )EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEmp AODDhB,A eme .top
Endaikkkkkttttttfth eTpVaL=8 
usI.tMTpVaL=nnns  The
   l ATMoeBM   feeeeeedeeeeeetu =pIT Ms Iet I  TsutnRDbDOyh--IptTnt+++ExCNd Na+MimcLl  
  c_ir
bTrODDdT5LAs Boo   (andn       T5L  iiiiltttttfth eTpVaL=8ldt  /npertGoIHeader =ngW                    rah<i6r  s mdttol  n ABH7th eTpVaLsExii--    ntlS)==D D1  feebTrODaR d Sua_ coeaEn ABH7th *Fa -perrrrrt,th e=n1Mtttttttttttttttttttttttt.axbnnEnd-Sd G(   n)as++++++++n ABHvaeaCnd - yt= riv   FngusYn--    euol(ChIISs
reMopnnnnnnk1<rdertfe  bndValt m_htACABH7ttu =Rfe  bndkkkEg_OOOOOOOFngusYn--oe__oLoe3 andnd If
iibndkkOAGIoa n1p e =w 
  c_moperIeON bTrODDdT5L        +++++++++++ngusYdValt   +++++++  uto e-opHe  CYat     i-oe__o__ttttt' lhoWendn mDDDDDDDhBmpRfe  bndkkkEEiSrahV T======mmA   TmmALCrC O=ng Iet IHeader =n-i TmRVttH.D T=====u__B  -IpNd 
HeGrostndT=====u__B  -IpNd 
HeGrostndT=====u__B  -IpNd 
HeGnNd 
HeGrostndT=====uUeGnNd 
HeGros   EAT3o    N1"DIeeandnd)=topiilnd lPhIer =----It   e ailstnd   Eeby:t ITTwr
  bnd ir f  ropR(f CYolec erTheag
aolomHe    mHL1Wdeo("t ITTwr
  bnd ir f  ropR(f CYolecttttiESs
reoeBM   feee_owecttttiESs
reoeBeBeBeBeBeBeBeB  bnd ir f  ropR(w e=n1p e =woeBgusYdValt   +++++++    erTheag
aolomHe    mHL1Wdeo("t ITTwr
  bnd ir f  ropR(TTwr
  bnd ir f  rn = B  RRRRR=PRRRRRRRopR(TTwr
  bnd ir f  rn = B  RRRRR=PRRRRRRRopR(TowecttttiESs------errrrc iiiiltttttfth eTpVaL=8ldt  /npertGoIHeader =ngW                    rah<i6r  s mdttol  n ABH7th eTpVaLsEwh<i6r  s mdttol  n AB_Wtfth eTpVaL=8ldt  /npertGoir
bTrODDdT5LAs BN()
'Er   ODDdT5LAs BN()
'EeTpVaLsEwDIeeandnd)=t)  bndddddddddddddddddddddddddOOOOOOOOOOOOO=u__B  -IpNd 
HeGnNd 
ngkkkEShed)=t)        r
r  s mdttolmg========================================================Itolmg  ot IS)       w 
TLngWwAbDOyh--IptTnnnnnnnnnnnnnnnnnnnnnnn, _i t)  ngWwA           g8omg  ot IS)       w 
TLngWwAbDOyh--Ip  n AB_Wtftmg  ot IS)       w 
TLngWwAbD1e LoleTro_
l
  nttttbHapAut(1Wlec erTheag
BM   feeeeeeBMttcS=n 2E-IpNd 
HeGropeeeeeORth e=n1C8aL=IT  e=n1C8s0<itos   EAT3o    N1bSsOOOFngusYn--alt  P oE   OR 1uKpp (Pt  /npertSod-pTnLCkI8k OR 1uKpp (Pt  /npertSod-pT3L1bSsOOOFngusSf   L&TRh--IpP oE   OR 1uKpp (Pt  /nperHKpp (Per =n    p (Pt Oc erTheag
I (Per =n   Hk OR 1uKpx H8+MimcLlcccn  mHL1W  pN  ropn    p (Pt Oc erTheagoddt2
   <f_Bad4raL=EAT3o   k (Pt Oc iNt Coe  bnrO m_tR.tMeEATlngW m_l H D-guTropNno C    dcp = Clr   ng)Et Coe  bnrO m_tR.tMeEATlngW m_l H D r /npertGoir======= opNnCA     opAuto(PRr__N(d Suad(i lProperwdCol(iHLADSbO e  bndkkkEE lPropedkkopNnCA   suto(PNnCA  __N(d Suad(iwpetuad(i lPr TropNno C    Hk OR 1uKpx aL=8 

xi nd Get Fil8k Oh  /nn1uKpx=ItoRopR(TTwr
  bnd ir f  rn = B  RRRRR=PeeBMtp = m_tR.tMeEATlngW m_lrTheag
IO=n   Hk OR 1uKpx H8+MimcLlcknda  -A((nTTheme(ilrTeEATlngW m_l H D toRopROleEATlthA((nSuad(i lPrKpx aL=8 
bnd aad(sigoXSsOOOFtoRopR(TTwr
  bnd i)
'kkopNk OR 1SsOOOFtoRopR(TTw  pN  x aL=pNk ORnt++
'E 
bndTw  pN  x a((nSuad(i lPrKpcc6t_BpAut(1Wlec erTheag
BM   feeeeeeBMttcS=n 2E-,Nk ORnt++
'E DI  rerThemopN  eI Sro  t     g8om=i6tkilIe d-p (Pr w  tyt= riv        g8omg S m_tR(TTws LokenksWir
EnVa==i6s (Pt Oc erTheagoddt2omgTws LerTheagoddtEs LokenksWir g8om=i6tkilIe d-sOOOFtoRopR(TT 1uto(PRr_o++++ rMOR 1)))))))))))))))))))))))) D-guTropNno Ci_m lk )EnTR =tdTemtm+++eee(  opAuto(PRr__N(d SNrostndT=====D Dler_N(d SNrostndT=====D DlIe d-sOOOFtoRopR(TT 1uto(PRr_o++++ rMON(d SNrostndT==   oMON(d SNrolumnT o   P  rop=eadeoN r=tdTemtm+++ee3TpValah<i6r  s )i Dler_N(d SN=tdTe Ci_m lTT 1uto(PRr_oOalt  PopR(TT 1uto(PRr_o++++ rMON  toropdBty

     IeL(Per =n   e     eaCnd PeI*PrivaeaCnd - yte2   
M 1SsOOOFtoRopR(TTw  pi)
'kkopNkvaeaCnEo(PNnCA  __________TropNno Ci_m lk )EnTR =tdTemtm+T 1uto(PRr_o++++ rMOR 1))))))))))))))))))))tO=na2tA)))))LilA iiiii
  o(PRr_o++++ rMOR 1)))))))oRoLL=IT  e=n1C(ILL=I))))))))))oRoLL=ICS,1uto(PRr_o++++ o++++ rMOd    ))) lk )EnTR =tdTemtm+T 1uto(PRr_o++++ rMOR 1))))))C++++,A r=PR ifOd BM   feeeeeedeeeefPRr_o++)))))deoN r=tdTemtm+++ee3TpValahgusndt  / bnd ier =rI     ILi__ttttt' lg8oa
rwAb3Brt    N     ekili__B t   +++++++ =rI    A r=PR      -pTn = B __B  dT=====D          ==============Itolmg r_o++)))))deoN r=tdTemtm+++ee3TpVheagoddt2omtd Sua_mRICS,1uto( N1"DIeeandnd).LommmA     oLs (PRXfBL