bOk = MTblGetOwnerDrawnItem( hWndTbl, nID, cODI )

Gets the data of an ownerdrawn item.

Parameters
hWndTbl
Window Handle: Handle of the table

nID
Number: The ID of the ownerdrawn item ( = lParam of message MTM_DrawItem )

cODI
fcMTblODI: UDV to retrieve the data

Return
Boolean: TRUE if successful or FALSE if not

Example
In this example we get the ODI data on MTM_DrawItem and draw something:
On MTM_DrawItem
  If MTblGetOwnerDrawnItem( hWndForm, lParam, odi )
    If odi.Type = MTBL_ODI_CELL
      ! Draw green background
      Set nColor = COLOR_Green
      Set nBrush = CreateSolidBrush( nColor )
      Set nOldBrush = SelectObject( odi.DC, nBrush )
      Call FillRect( odi.DC, odi.Left, odi.Top, odi.Right, odi.Bottom, nBrush )
      Call SelectObject( odi.DC, nOldBrush )
      Call DeleteObject( nBrush )

Remarks
Call this funcion only on MTM_DrawItem!

See also
Ownerdrawn items

Created with the Personal Edition of HelpNDoc: Produce Kindle eBooks easily