GFOwnerDraw/GFOwnerDrawfrm.frm
VERSION 5.00
Begin VB.Form GFOwnerDrawfrm
BorderStyle = 0 'Kein
Caption = "GFOwnerDrawfrm"
ClientHeight = 90
ClientLeft = 0
ClientTop = 0
ClientWidth = 90
Enabled = 0 'False
LinkTopic = "Form2"
ScaleHeight = 90
ScaleWidth = 90
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows‑Standard
Visible = 0 'False
End
Attribute VB_Name = "GFOwnerDrawfrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'(c)2002 by Louis
'GFSubClassWindowProc
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
'GFSubClassWindowProc
Private Const WM_DRAWITEM = &H2B
'Owner draw control types
Private Const ODT_MENU = 1
Private Const ODT_LISTBOX = 2
Private Const ODT_COMBOBOX = 3
Private Const ODT_BUTTON = 4
Private Const ODT_STATIC = 5
Private Const ODT_HEADER = 100
Private Const ODT_TAB = 101
Private Const ODT_LISTVIEW = 102
Public Sub GFSubClassWindowProc(ByVal SourceDescription As String, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long, ByRef ReturnValue As Long, ByRef ReturnValueUsedFlag As Boolean)
On Error Resume Next
Dim ControlStructIndex As Integer
'begin
Select Case Msg
Case WM_DRAWITEM
ControlStructIndex = GetODStructIndex(SourceDescription)
If (ControlStructIndex) Then 'verify
Dim DRAWITEMSTRUCTVar As DRAWITEMSTRUCT
Call CopyMemory(DRAWITEMSTRUCTVar, ByVal lParam, Len(DRAWITEMSTRUCTVar))
Select Case DRAWITEMSTRUCTVar.CtlType
Case ODT_LISTBOX
Call OD_DrawListBox(DRAWITEMSTRUCTVar, ControlStructIndex)
ReturnValueUsedFlag = True
ReturnValue = True
End Select
End If
End Select
End Sub
[END OF FILE]