home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Final_-_vh207433772007.psc / clsFilterMenu.cls < prev   
Text File  |  2007-07-07  |  28KB  |  764 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "clsFilterMenu"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = False
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = True
  14. Option Explicit
  15.  
  16. Implements GXISubclass
  17.  
  18. Private Const BM_TRANSPARENT                    As Long = &H1
  19.  
  20. Private Const DT_CENTER                         As Long = &H1&
  21. Private Const DT_VCENTER                        As Long = &H4&
  22. Private Const DT_SINGLELINE                     As Long = &H20&
  23. Private Const DT_RTLREADING                     As Long = &H20000
  24.  
  25. Private Const FW_NORMAL                         As Long = 400
  26. Private Const FW_BOLD                           As Long = 700
  27.  
  28. Private Const HWND_TOP                          As Long = 0
  29.  
  30. Private Const LF_ANTIALIASED_QUALITY            As Long = 4
  31.  
  32. Private Const LOGPIXELSY                        As Long = 90
  33.  
  34. Private Const MOUSEEVENTF_MOVE                  As Long = &H1
  35. Private Const MOUSEEVENTF_LEFTDOWN              As Long = &H2
  36. Private Const MOUSEEVENTF_LEFTUP                As Long = &H4
  37.  
  38. Private Const QS_ALLINPUT                       As Double = _
  39.     (&H1 Or &H2 Or &H4 Or &H8 Or &H10 Or &H20 Or &H40 Or &H80)
  40.  
  41. Private Const SS_OWNERDRAW                      As Long = &HD
  42.  
  43. Private Const SWP_NOSIZE                        As Long = &H1
  44. Private Const SWP_NOMOVE                        As Long = &H2
  45. Private Const SWP_NOZORDER                      As Long = &H4
  46. Private Const SWP_NOACTIVATE                    As Long = &H10
  47. Private Const SWP_SHOWWINDOW                    As Long = &H40
  48. Private Const SWP_NOOWNERZORDER                 As Long = &H200
  49.  
  50. Private Const WS_TABSTOP                        As Long = &H10000
  51. Private Const WS_CLIPCHILDREN                   As Long = &H2000000
  52. Private Const WS_CLIPSIBLINGS                   As Long = &H4000000
  53. Private Const WS_CHILD                          As Long = &H40000000
  54.  
  55. Private Const WS_EX_TOOLWINDOW                  As Long = &H80
  56.  
  57. Public Enum EFTTransition
  58.     eftNone = 0&
  59.     eftSlide = 1&
  60.     eftInflate = 2&
  61. End Enum
  62.  
  63. Public Enum EFSPosition
  64.     RightBottom = 0&
  65.     RightCenter = 1&
  66.     RightTop = 2&
  67.     LeftBottom = 3&
  68.     LeftCenter = 4&
  69.     LeftTop = 5&
  70. End Enum
  71.  
  72. Private Type RECT
  73.     left                                        As Long
  74.     top                                         As Long
  75.     Right                                       As Long
  76.     Bottom                                      As Long
  77. End Type
  78.  
  79. Private Type POINTAPI
  80.     x                                           As Long
  81.     y                                           As Long
  82. End Type
  83.  
  84. Private Type VERSIONINFO
  85.     dwOSVersionInfoSize                         As Long
  86.     dwMajorVersion                              As Long
  87.     dwMinorVersion                              As Long
  88.     dwBuildNumber                               As Long
  89.     dwPlatformId                                As Long
  90.     szCSDVersion                                As String * 128
  91. End Type
  92.  
  93. Private Type LOGFONT
  94.     lfHeight                                    As Long
  95.     lfWidth                                     As Long
  96.     lfEscapement                                As Long
  97.     lfOrientation                               As Long
  98.     lfWeight                                    As Long
  99.     lfItalic                                    As Byte
  100.     lfUnderline                                 As Byte
  101.     lfStrikeOut                                 As Byte
  102.     lfCharSet                                   As Byte
  103.     lfOutPrecision                              As Byte
  104.     lfClipPrecision                             As Byte
  105.     lfQuality                                   As Byte
  106.     lfPitchAndFamily                            As Byte
  107.     lfFaceName(32)                              As Byte
  108. End Type
  109.  
  110. Private Type DRAWITEMSTRUCT
  111.     CtlType                                     As Long
  112.     CtlID                                       As Long
  113.     itemID                                      As Long
  114.     itemAction                                  As Long
  115.     itemState                                   As Long
  116.     hwndItem                                    As Long
  117.     hdc                                         As Long
  118.     rcItem                                      As RECT
  119.     itemData                                    As Long
  120. End Type
  121.  
  122.  
  123. Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersion As VERSIONINFO) As Long
  124.  
  125. Private Declare Function CreateWindowExA Lib "user32" (ByVal dwExStyle As Long, _
  126.                                                        ByVal lpClassName As String, _
  127.                                                        ByVal lpWindowName As String, _
  128.                                                        ByVal dwStyle As Long, _
  129.                                                        ByVal x As Long, _
  130.                                                        ByVal y As Long, _
  131.                                                        ByVal nWidth As Long, _
  132.                                                        ByVal nHeight As Long, _
  133.                                                        ByVal hWndParent As Long, _
  134.                                                        ByVal hMenu As Long, _
  135.                                                        ByVal hInstance As Long, _
  136.                                                        lpParam As Any) As Long
  137.  
  138. Private Declare Function CreateWindowExW Lib "user32" (ByVal dwExStyle As Long, _
  139.                                                        ByVal lpClassName As Long, _
  140.                                                        ByVal lpWindowName As Long, _
  141.                                                        ByVal dwStyle As Long, _
  142.                                                        ByVal x As Long, _
  143.                                                        ByVal y As Long, _
  144.                                                        ByVal nWidth As Long, _
  145.                                                        ByVal nHeight As Long, _
  146.                                                        ByVal hWndParent As Long, _
  147.                                                        ByVal hMenu As Long, _
  148.                                                        ByVal hInstance As Long, _
  149.                                                        lpParam As Any) As Long
  150.  
  151. Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
  152.  
  153. Private Declare Sub SetWindowPos Lib "user32" (ByVal hwnd As Long, _
  154.                                                ByVal hWndInsertAfter As Long, _
  155.                                                ByVal x As Long, _
  156.                                                ByVal y As Long, _
  157.                                                ByVal cx As Long, _
  158.                                                ByVal cy As Long, _
  159.                                                ByVal wFlags As Long)
  160.  
  161. Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
  162.  
  163. Private Declare Function GetDesktopWindow Lib "user32" () As Long
  164.  
  165. Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, _
  166.                                                    ByVal hObject As Long) As Long
  167.  
  168. Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
  169.  
  170. Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
  171.  
  172. Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
  173.  
  174. Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
  175.  
  176. Private Declare Function CopyRect Lib "user32" (lpDestRect As RECT, _
  177.                                                 lpSourceRect As RECT) As Long
  178.  
  179. Private Declare Function DrawTextA Lib "user32" (ByVal hdc As Long, _
  180.                                                  ByVal lpStr As String, _
  181.                                                  ByVal nCount As Long, _
  182.                                                  lpRect As RECT, _
  183.                                                  ByVal wFormat As Long) As Long
  184.  
  185. Private Declare Function DrawTextW Lib "user32" (ByVal hdc As Long, _
  186.                                                  ByVal lpStr As Long, _
  187.                                                  ByVal nCount As Long, _
  188.                                                  lpRect As RECT, _
  189.                                                  ByVal wFormat As Long) As Long
  190.  
  191. Private Declare Function FillRect Lib "user32" (ByVal hdc As Long, _
  192.                                                 lpRect As RECT, _
  193.                                                 ByVal hBrush As Long) As Long
  194.  
  195. Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, _
  196.                                                 ByVal nBkMode As Long) As Long
  197.  
  198. Private Declare Function CreateDc Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName As String, _
  199.                                                                  lpDeviceName As Any, _
  200.                                                                  lpOutput As Any, _
  201.                                                                  lpInitData As Any) As Long
  202.  
  203. Private Declare Function CreateFontIndirectA Lib "gdi32" (lpLogFont As LOGFONT) As Long
  204.  
  205. Private Declare Function CreateFontIndirectW Lib "gdi32" (lpLogFont As LOGFONT) As Long
  206.  
  207. Private Declare Function MulDiv Lib "kernel32" (ByVal nNumber As Long, _
  208.                                                 ByVal nNumerator As Long, _
  209.                                                 ByVal nDenominator As Long) As Long
  210.  
  211. Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, _
  212.                                                     ByVal nIndex As Long) As Long
  213.  
  214. Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, _
  215.                                                 ByVal nWidth As Long, _
  216.                                                 ByVal crColor As Long) As Long
  217.  
  218. Private Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, _
  219.                                                ByVal x As Long, _
  220.                                                ByVal y As Long, _
  221.                                                lpPoint As POINTAPI) As Long
  222.  
  223. Private Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, _
  224.                                              ByVal x As Long, _
  225.                                              ByVal y As Long) As Long
  226.  
  227. Private Declare Function SetTextColor Lib "gdi32" (ByVal hdc As Long, _
  228.                                                    ByVal crColor As Long) As Long
  229. Private Declare Function SetFocus Lib "user32" (ByVal hwnd As Long) As Long
  230.  
  231.  
  232. Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpDst As Any, _
  233.                                                                      lpSrc As Any, _
  234.                                                                      ByVal Length As Long)
  235.  
  236. Private Declare Function InflateRect Lib "user32" (lpRect As RECT, _
  237.                                                    ByVal x As Long, _
  238.                                                    ByVal y As Long) As Long
  239.  
  240. Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  241.  
  242.  
  243. Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, _
  244.                                                      lpRect As RECT) As Long
  245.  
  246. Private Declare Function PtInRect Lib "user32" (lpRect As RECT, _
  247.                                                 ByVal ptX As Long, _
  248.                                                 ByVal ptY As Long) As Long
  249.  
  250. Private Declare Function MsgWaitForMultipleObjects Lib "user32" (ByVal nCount As Long, _
  251.                                                                  pHandles As Long, _
  252.                                                                  ByVal fWaitAll As Long, _
  253.                                                                  ByVal dwMilliseconds As Long, _
  254.                                                                  ByVal dwWakeMask As Long) As Long
  255.  
  256. Private Declare Function GetTickCount Lib "kernel32" () As Long
  257.  
  258. Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, _
  259.                                               ByVal dx As Long, _
  260.                                               ByVal dy As Long, _
  261.                                               ByVal cButtons As Long, _
  262.                                               ByVal dwExtraInfo As Long)
  263.  
  264. Private Declare Function GetMessageExtraInfo Lib "user32" () As Long
  265.  
  266.  
  267. Private Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, _
  268.                                                       lpPoint As POINTAPI) As Long
  269.  
  270. Public Event FilterIndex(ByVal lIndex As Long)
  271. Public Event DestroyMe()
  272.  
  273. Private m_bIsNt                                 As Boolean
  274. Private m_bIsActive                             As Boolean
  275. Private m_bGradient                             As Boolean
  276. Private m_bXPColors                             As Boolean
  277. Private m_bShadow                               As Boolean
  278. Private m_bShowing                              As Boolean
  279. Private m_bDestroy                              As Boolean
  280. Private m_bUseUnicode                           As Boolean
  281. Private m_bFontRightLeading                     As Boolean
  282. Private m_bFilterHideExact                      As Boolean
  283. Private m_lTitleColor                           As Long
  284. Private m_lTransparency                         As Long
  285. Private m_lSafeTimer                            As Long
  286. Private m_lTransition                           As Long
  287. Private m_lFilterMenuHwnd                       As Long
  288. Private m_lColorOffset                          As Long
  289. Private m_lhTitleFont                           As Long
  290. Private m_lhTextFont                            As Long
  291. Private m_lPosition                             As Long
  292. Private m_lBackColor                            As Long
  293. Private m_lForeColor                            As Long
  294. Private m_lParentHwnd                           As Long
  295. Private m_lCtrlHwnd                             As Long
  296. Private m_lWidth                                As Long
  297. Private m_lHeight                               As Long
  298. Private m_lControlColor                         As Long
  299. Private m_lControlForeColor                     As Long
  300. Private m_lThemeIndex                           As Long
  301. Private m_sTitle                                As String
  302. Private m_sListItems()                          As String
  303. Private m_tRWnd                                 As RECT
  304. Private m_oTextFont                             As StdFont
  305. Private m_oTitleFont                            As StdFont
  306. Private m_cList                                 As clsODControl
  307. Private WithEvents m_cFilter                    As clsODControl
  308. Attribute m_cFilter.VB_VarHelpID = -1
  309. Private WithEvents m_cClose                     As clsODControl
  310. Attribute m_cClose.VB_VarHelpID = -1
  311. Private WithEvents m_cExact                     As clsODControl
  312. Attribute m_cExact.VB_VarHelpID = -1
  313. Private m_cFilterMenuDc                         As clsStoreDc
  314. Private m_cRender                               As clsRender
  315. Private m_SBSubclass                            As GXMSubclass
  316.  
  317.  
  318. Private Sub Class_Initialize()
  319.  
  320.     m_bIsNt = CompatabilityCheck
  321.     Set m_SBSubclass = New GXMSubclass
  322.     Set m_cRender = New clsRender
  323.     Set m_cFilterMenuDc = New clsStoreDc
  324.     m_lWidth = 150
  325.     m_lBackColor = GetSysColor(&H80000018 And &H1F)
  326.     m_lForeColor = &H343434
  327.     m_lTitleColor = &HFEFEFE
  328.     m_lColorOffset = &HCACACA
  329.     Set m_cList = New clsODControl
  330.     Set m_cFilter = New clsODControl
  331.     Set m_cClose = New clsODControl
  332.     Set m_cExact = New clsODControl
  333.     ReDim m_sListItems(0)
  334.     m_lTransparency = -1
  335.     m_lControlColor = -1
  336.  
  337. End Sub
  338.  
  339. Private Sub m_cClose_Click()
  340.     m_bDestroy = True
  341. End Sub
  342.  
  343. Private Sub m_cFilter_Click()
  344.  
  345. Dim lCt As Long
  346.  
  347.     With m_cList
  348.         For lCt = 0 To (.ListCount - 1)
  349.             If .SelectedItem(lCt) Then
  350.                 RaiseEvent FilterIndex(lCt)
  351.             End If
  352.         Next lCt
  353.     End With
  354.     
  355. End Sub
  356.  
  357. Public Property Get BackColor() As Long
  358.     BackColor = m_lBackColor
  359. End Property
  360.  
  361. Public Property Let BackColor(ByVal PropVal As Long)
  362.     If m_bXPColors Then
  363.         m_lBackColor = m_cRender.XPShift(PropVal)
  364.     Else
  365.         m_lBackColor = PropVal
  366.     End If
  367. End Property
  368.  
  369. Public Property Get Checked() As Boolean
  370.     Checked = m_cExact.Checked
  371. End Property
  372.  
  373. Public Property Get ColorOffset() As Long
  374.     ColorOffset = m_lColorOffset
  375. End Property
  376.  
  377. Public Property Let ColorOffset(ByVal PropVal As Long)
  378.     If m_bXPColors Then
  379.         m_lColorOffset = m_cRender.XPShift(PropVal)
  380.     Else
  381.         m_lColorOffset = PropVal
  382.     End If
  383. End Property
  384.  
  385. Public Property Get ControlColor() As Long
  386.     ControlColor = m_lControlColor
  387. End Property
  388.  
  389. Public Property Let ControlColor(ByVal PropVal As Long)
  390.     m_lControlColor = PropVal
  391. End Property
  392.  
  393. Public Property Get ControlForeColor() As Long
  394.     ControlForeColor = m_lControlForeColor
  395. End Property
  396.  
  397. Public Property Let ControlForeColor(ByVal PropVal As Long)
  398.     m_lControlForeColor = PropVal
  399. End Property
  400.  
  401. Public Property Get FilterHideExact() As Boolean
  402.     FilterHideExact = m_bFilterHideExact
  403. End Property
  404.  
  405. Public Property Let FilterHideExact(ByVal PropVal As Boolean)
  406.     m_bFilterHideExact = PropVal
  407. End Property
  408.  
  409. Public Property Get FontRightLeading() As Boolean
  410. '/* [get] right align fonts
  411.     FontRightLeading = m_bFontRightLeading
  412. End Property
  413.  
  414. Public Property Let FontRightLeading(ByVal PropvVal As Boolean)
  415. '/* [let] right align fonts
  416.     m_bFontRightLeading = PropvVal
  417. End Property
  418.  
  419. Public Property Get ForeColor() As Long
  420.     ForeColor = m_lForeColor
  421. End Property
  422.  
  423. Public Property Let ForeColor(ByVal PropVal As Long)
  424.     m_lForeColor = PropVal
  425. End Property
  426.  
  427. Public Property Get Gradient() As Boolean
  428.     Gradient = m_bGradient
  429. End Property
  430.  
  431. Public Property Let Gradient(ByVal PropVal As Boolean)
  432.     m_bGradient = PropVal
  433. End Property
  434.  
  435. Public Property Get Height() As Long
  436.     Height = m_lHeight
  437. End Property
  438.  
  439. Public Property Let Height(ByVal PropVal As Long)
  440.     m_lHeight = PropVal
  441. End Property
  442.  
  443. Public Property Get hwnd() As Long
  444.     hwnd = m_lFilterMenuHwnd
  445. End Property
  446.  
  447. Public Property Get Position() As EFSPosition
  448.     Position = m_lPosition
  449. End Property
  450.  
  451. Public Property Let Position(ByVal PropVal As EFSPosition)
  452.     m_lPosition = PropVal
  453. End Property
  454.  
  455. Public Property Get Shadow() As Boolean
  456.     Shadow = m_bShadow
  457. End Property
  458.  
  459. Public Property Let Shadow(ByVal PropVal As Boolean)
  460.     m_bShadow = PropVal
  461. End Property
  462.  
  463. Public Property Get Title() As String
  464.     Title = m_sTitle
  465. End Property
  466.  
  467. Public Property Let Title(ByVal PropVal As String)
  468.     m_sTitle = PropVal
  469. End Property
  470.  
  471. Public Property Get TitleColor() As Long
  472.     TitleColor = m_lTitleColor
  473. End Property
  474.  
  475. Public Property Let TitleColor(ByVal PropVal As Long)
  476.     m_lTitleColor = PropVal
  477. End Property
  478.  
  479. Public Property Get TextFont() As StdFont
  480.     Set TextFont = m_oTextFont
  481. End Property
  482.  
  483. Public Property Set TextFont(ByVal PropVal As StdFont)
  484.     Set m_oTextFont = PropVal
  485. End Property
  486.  
  487. Public Property Get TitleFont() As StdFont
  488.     Set TitleFont = m_oTitleFont
  489. End Property
  490.  
  491. Public Property Set TitleFont(ByVal PropVal As StdFont)
  492.     Set m_oTitleFont = PropVal
  493. End Property
  494.  
  495. Public Property Get ThemeIndex() As Long
  496.     ThemeIndex = m_lThemeIndex
  497. End Property
  498.  
  499. Public Property Let ThemeIndex(ByVal PropVal As Long)
  500.     m_lThemeIndex = PropVal
  501. End Property
  502.  
  503. Public Property Get Transparency() As Long
  504.     Transparency = m_lTransparency
  505. End Property
  506.  
  507. Public Property Let Transparency(ByVal PropVal As Long)
  508.  
  509.     If (PropVal < 70) Then
  510.         PropVal = 70
  511.     ElseIf (PropVal > 255) Then
  512.         PropVal = 254
  513.     End If
  514.     m_lTransparency = PropVal
  515.     
  516. End Property
  517.  
  518. Public Property Get Transition() As EFTTransition
  519.     Transition = m_lTransition
  520. End Property
  521.  
  522. Public Property Let Transition(ByVal PropVal As EFTTransition)
  523.     m_lTransition = PropVal
  524. End Property
  525.  
  526. Public Property Get UseUnicode() As Boolean
  527.     UseUnicode = m_bUseUnicode
  528. End Property
  529.  
  530. Public Property Let UseUnicode(ByVal PropVal As Boolean)
  531.     m_bUseUnicode = PropVal
  532. End Property
  533.  
  534. Public Property Get Width() As Long
  535.     Width = m_lWidth
  536. End Property
  537.  
  538. Public Property Let Width(ByVal PropVal As Long)
  539.     m_lWidth = PropVal
  540. End Property
  541.  
  542. Public Property Get XPColors() As Boolean
  543.     XPColors = m_bXPColors
  544. End Property
  545.  
  546. Public Property Let XPColors(ByVal PropVal As Boolean)
  547.     m_bXPColors = PropVal
  548. End Property
  549.  
  550.  
  551. Private Sub ActivateList()
  552.  
  553. Dim tPcd    As POINTAPI
  554. Dim tRect   As RECT
  555.  
  556.     GetWindowRect m_cList.hwnd, tRect
  557.     CopyMemory tPcd, tRect, Len(tPcd)
  558.     ScreenToClient m_lFilterMenuHwnd, tPcd
  559.     With tPcd
  560.         mouse_event MOUSEEVENTF_MOVE, (.x + 7), (.y + 7), 0&, GetMessageExtraInfo()
  561.     End With
  562.     mouse_event MOUSEEVENTF_LEFTDOWN, 0&, 0&, 0&, GetMessageExtraInfo()
  563.     mouse_event MOUSEEVENTF_LEFTUP, 0&, 0&, 0&, GetMessageExtraInfo()
  564.     
  565. End Sub
  566.  
  567. Public Sub AddItem(ByVal lIndex As Long, _
  568.                    ByVal sItem As String)
  569.  
  570. On Error GoTo Handler
  571.  
  572.     If UBound(m_sListItems) < lIndex Then
  573.         ReDim Preserve m_sListItems(0 To lIndex)
  574.     End If
  575.     m_sListItems(lIndex) = sItem
  576.  
  577. Handler:
  578.  
  579. End Sub
  580.  
  581. Private Function CompatabilityCheck() As Boolean
  582.  
  583. Dim tVer As VERSIONINFO
  584.  
  585.     tVer.dwOSVersionInfoSize = Len(tVer)
  586.     GetVersionEx tVer
  587.     If tVer.dwMajorVersion >= 5 Then
  588.         CompatabilityCheck = True
  589.     End If
  590.  
  591. End Function
  592.  
  593. Private Sub CreateControls()
  594.  
  595. Dim lBtm As Long
  596.  
  597.     With m_cList
  598.         If Not (m_lControlColor = -1) Then
  599.             .BackColor = m_lControlColor
  600.         Else
  601.             .BackColor = m_lBackColor
  602.         End If
  603.         If Not (m_lControlForeColor = -1) Then
  604.             .ForeColor = m_lControlForeColor
  605.         Else
  606.             .ForeColor = m_lForeColor
  607.         End If
  608.         .UseUnicode = m_bUseUnicode
  609.         .BorderStyle ecbsThin
  610.         If Not m_bFilterHideExact Then
  611.             lBtm = 49
  612.         Else
  613.             lBtm = 12
  614.         End If
  615.         .Create m_lFilterMenuHwnd, 5, 19, (m_tRWnd.Right - 12), (m_tRWnd.Bottom - lBtm), ecsListBox
  616.         .HFont = m_lhTextFont
  617.         .BorderStyle ecbsThin
  618.     End With
  619.     
  620.     With m_cClose
  621.         If Not (m_lControlColor = -1) Then
  622.             .ThemeColor = m_lBackColor
  623.         End If
  624.         If Not (m_lControlForeColor = -1) Then
  625.             .ForeColor = m_lControlForeColor
  626.         Else
  627.             .ForeColor = m_lForeColor
  628.         End If
  629.         .Name = "Close"
  630.         .UseUnicode = m_bUseUnicode
  631.         .Create m_lFilterMenuHwnd, (m_tRWnd.Right - 19), 4, 12, 12, ecsCommandButton
  632.         .HFont = m_lhTextFont
  633.         .Text = "-"
  634.     End With
  635.     
  636.     If Not m_bFilterHideExact Then
  637.         With m_cExact
  638.             If Not (m_lControlColor = -1) Then
  639.                 .ThemeColor = m_lBackColor
  640.             End If
  641.             If Not (m_lControlColor = -1) Then
  642.                 .BackColor = m_lControlColor
  643.             Else
  644.                 .BackColor = m_lBackColor
  645.             End If
  646.             If Not (m_lControlForeColor = -1) Then
  647.                 .ForeColor = m_lControlForeColor
  648.             Else
  649.                 .ForeColor = m_lForeColor
  650.             End If
  651.             .Name = "Exact"
  652.             .UseUnicode = m_bUseUnicode
  653.             .Create m_lFilterMenuHwnd, 5, (m_tRWnd.Bottom - 25), 50, 14, ecsCheckBox
  654.             .HFont = m_lhTextFont
  655.             .AutoBackColor = True
  656.             .Text = "Exact"
  657.         End With
  658.     End If
  659.     
  660.     With m_cFilter
  661.         If Not (m_lControlColor = -1) Then
  662.             .ThemeColor = m_lBackColor
  663.         End If
  664.         If Not (m_lControlColor = -1) Then
  665.             .BackColor = m_lControlColor
  666.         Else
  667.             .BackColor = m_lBackColor
  668.         End If
  669.         If Not (m_lControlForeColor = -1) Then
  670.             .ForeColor = m_lControlForeColor
  671.         Else
  672.             .ForeColor = m_lForeColor
  673.         End If
  674.         .HiliteColor = &HDCDCDC
  675.         .Name = "Filter"
  676.         .UseUnicode = m_bUseUnicode
  677.         .Create m_lFilterMenuHwnd, (m_tRWnd.Right - 45), (m_tRWnd.Bottom - 25), 40, 18, ecsCommandButton
  678.         .HFont = m_lhTextFont
  679.         .Text = "Filter"
  680.     End With
  681.  
  682. End Sub
  683.  
  684. Private Function CreateFont(ByVal oFont As StdFont, _
  685.                             Optional ByVal bTitle As Boolean) As Long
  686. '*/ change list font
  687.  
  688. Dim lChar       As Long
  689. Dim lHdc        As Long
  690. Dim tLF         As LOGFONT
  691. Dim bteFont()   As Byte
  692.  
  693. On Error GoTo Handler
  694.     
  695.     lHdc = CreateDc("DISPLAY", ByVal 0&, ByVal 0&, ByVal 0&)
  696.     With tLF
  697.         bteFont = StrConv(oFont.Name, vbFromUnicode)
  698.         For lChar = 0 To UBound(bteFont)
  699.             .lfFaceName(lChar) = bteFont(lChar)
  700.         Next lChar
  701.         If bTitle Then
  702.             oFont.Bold = True
  703.             oFont.Size = 9
  704.         End If
  705.         .lfHeight = -MulDiv(oFont.Size, GetDeviceCaps(lHdc, LOGPIXELSY), 72)
  706.         .lfItalic = oFont.Italic
  707.         .lfWeight = IIf(oFont.Bold, FW_BOLD, FW_NORMAL)
  708.         .lfUnderline = oFont.Underline
  709.         .lfStrikeOut = oFont.Strikethrough
  710.         .lfCharSet = 4
  711.         .lfQuality = LF_ANTIALIASED_QUALITY
  712.     End With
  713.     DeleteDC lHdc
  714.     
  715.     If m_bUseUnicode Then
  716.         CreateFont = CreateFontIndirectW(tLF)
  717.     Else
  718.         CreateFont = CreateFontIndirectA(tLF)
  719.     End If
  720.  
  721. On Error GoTo 0
  722. Exit Function
  723.  
  724. Handler:
  725.  
  726. End Function
  727.  
  728. Private Sub CreateSortMenu()
  729.  
  730. Dim bOnDesktop  As Boolean
  731. Dim lTTStyle    As Long
  732.  
  733.     m_lParentHwnd = GetParent(m_lCtrlHwnd)
  734.     bOnDesktop = (m_lParentHwnd = GetDesktopWindow())
  735.     lTTStyle = WS_CHILD Or WS_CLIPCHILDREN Or WS_CLIPHILDREN O
  736.     lT   m_lTrOr WS_CLIPCHILDREN Or WS_CLIPHILDREN O
  737.     lT   m_lTrOr WS_CLIPCHILDREN Or WS_CLIPHILDREN O
  738.     lT   m_lTrOr WS_CLIPCHILDREN Or WS_CLIPHILDREN O
  739.     lT   m_lTrOr WS_CLIPCHILDREN Or WS_CLIPHILDREN O
  740.     lT   m_lTrOr WS_CLIPCHILDREN Or WS_CLIPHILDREN O
  741.     lT h IIfUiact.Che_CLIPHILPm End If
  742.         If en
  743.         CompatabilityC
  744.     Else
  745.         CreateFont = CreateFontIndirectA(tLF)
  746.     Es"Mfction
  747. aldcateFont, 
  748.         .Or WS_CLIPCHILDREN Or WS_CLIPHILDREN O
  749.     lT h IIfUiact.Che_CLIPHILPm End If
  750.       .Fore   m_lT& oFont.St)   .Or WS_CLIPCHICLIPHILDREN O
  751.     lT h IIfUiact.Ch&) AseLDREN O
  752.     lT h IIfAseLDREN O     BDREN Or WS_CLIPHILDPN O     BDREN Or AseThen
  753.         CreateFont = CreateFontIndirectW(tLom= GetDE(oryCreateFontIndirectW(tLom= GetDE(oryCreateFryCreateFontIndirectW(tLom= GetDE(oryCrbteFontong
  754. Private ngDPN O I  lT h IIfAseLDREN O     BDRENont = CreatAseLDREN O     BDRENont = CreatAseLe_CLIPHILPm End If
  755.       .Forep(2, 12, ecsCommandButton
  756.    )CRreateF
  757.  
  758. PublicButtousageEx                FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFm_lBackCoperty
  759. o areateFFFFFm_oelControlForeColor = -1) Then
  760.             .ForeColor = m_lControlForeColor
  761.      They      .ForBf       .ForeColor = m_lControlForeColor
  762.     m_lBuControlForeColorEseLD,Crep(2, ackCopertCckCopertCckCAs >dgeEx                           s Lonrep(ByVal PropVal As Long)
  763.     m_lForeColor = hrSet etDE(orColor =ForeColyCreateFonreColorlBackColor          )r
  764.     m_r