Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
'Declare Function GetTextColor Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function SetTextColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
'DrawText() Format Flags
Const DT_CENTER = &H1
Const DT_RIGHT = &H2
Const DT_VCENTER = &H4
Const DT_BOTTOM = &H8
Const DT_SINGLELINE = &H20
Const DT_EXPANDTABS = &H40
Const DT_TABSTOP = &H80
Const DT_CALCRECT = &H400
Private Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
Private Declare Function DrawFrameControl Lib "user32" (ByVal hdc As Long, lpRect As RECT, ByVal un1 As Long, ByVal un2 As Long) As Long
'/* flags for DrawFrameControl */
Const DFC_BUTTON = 4
Const DFCS_BUTTONCHECK = &H0
Const DFCS_BUTTONRADIOIMAGE = &H1
Const DFCS_BUTTONRADIOMASK = &H2
Const DFCS_BUTTONRADIO = &H4
Const DFCS_BUTTON3STATE = &H8
Const DFCS_BUTTONPUSH = &H10
Const DFCS_INACTIVE = &H100
Const DFCS_PUSHED = &H200
Const DFCS_CHECKED = &H400
'#if(WINVER >= =&H0500)
Const DFCS_TRANSPARENT = &H800
Const DFCS_HOT = &H1000
'#endif /* WINVER >= =&H0500 */
Const DFCS_ADJUSTRECT = &H2000
Const DFCS_FLAT = &H4000
Const DFCS_MONO = &H8000
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function FillRect Lib "user32" (ByVal hdc As Long, lpRect As RECT, ByVal hBrush As Long) As Integer
Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Integer) As Long
Private Sub IPropOwnerDrawSink_PropCommitPending(sPropListName As String)
'Here we commit any pending values in
'owner-drawn items, if any. Set the
'Value property of the control to do
'this. The ValueChanged event will
'still fire.
End Sub
Private Sub IPropOwnerDrawSink_PropDrawItem(sPropListName As String, ByVal nIndex As Integer, ByVal bDrawActive As Boolean, ByVal DrawDC As Long, ByVal rctLeft As Long, ByVal rctTop As Long, ByVal rctRight As Long, ByVal rctBottom As Long)
'This method is called when an owner-drawn
'list item needs to be painted.
'The device context in DrawDC already has
'the required font and text color selected
'into it.
'NOTE: We must draw both the left and
'right columns. It is possible to draw over
'the center line separating the columns
'if need be.
'The only owner-drawn item we have is the
' Visible property, so we don't need to
' check for index...
Dim nMidPt As Long
Dim rct As RECT 'General-purpose RECT
Dim hBr As Long 'Handle to a brush
Dim CaptionToDraw As String, ValueToDraw As String
DrawText DrawDC, ValueToDraw, Len(ValueToDraw), rct, DT_SINGLELINE Or DT_VCENTER
End Sub
Private Sub IPropOwnerDrawSink_PropHideCtrls(sPropListName As String)
'The property list wants us to hide any
'controls that we may be using for
'owner-drawn items.
chkOD.Visible = False
End Sub
Private Sub IPropOwnerDrawSink_PropPlaceCtrl(sPropListName As String, ByVal nIndex As Integer, ByVal rctLeft As Long, ByVal rctTop As Long, ByVal rctWidth As Long, ByVal rctHeight As Long)
'The property list tells us exactly where to
'put a control if we want one for this
'owner-drawn item. Make it visible at this
'time as well.
chkOD.Caption = prp.Value(nIndex)
If chkOD.Caption = "1 - Visible" Then
chkOD.Value = 1
chkOD.Value = 0
End If
chkOD.Move rctLeft, rctTop, rctWidth, rctHeight
chkOD.Visible = True
End Sub
Private Sub prp_Browse(ByVal Name As String, ByVal Index As Integer, FillWith As String)
dlg.Flags = cdlOFNHideReadOnly Or cdlOFNFileMustExist Or _