MTblGetCellRectEx
nRet = MTblGetCellRectEx( hWndCol, nRow, nLeft, nTop, nRight, nBottom, nFlags )
Retrieves the rectangle of a cell in pixels, relative to the upper left corner of the table.
Parameters
hWndCol
Window Handle: Handle of the column
nRow
Number: Row number
nLeft
Receive Number: X-coordinate of the upper-left corner of the rectangle
nTop
Receive Number: Y-coordinate of the upper-left corner of the rectangle
nRight
Receive Number: X-coordinate of the lower-right corner of the rectangle
nBottom
Receive Number: Y-coordinate of the lower-right corner of the rectangle
nFlags
Number: Any combination of the following constants:
MTGR_VISIBLE_PART |
Retrieves only the visible part of the cell |
MTGR_INCLUDE_MERGED |
If set, the rectangle also includes the merged cells ( if any ) |
Return
Number: One of the following constants:
MTGR_RET_ERROR |
An error occured |
MTGR_RET_INVISIBLE |
No part of the cell is visible |
MTGR_RET_PARTLY_VISIBLE |
Only a part of the cell is visible |
MTGR_RET_VISIBLE |
The cell is visible |
Example
In this example the visible part of a cell the user clicked is filled blue:
On MTM_AreaLBtnDown
Set hWndCol = SalNumberToWindowHandle( wParam )
Set nRow = lParam
If hWndCol AND nRow != TBL_Error
If MTblGetCellRectEx( hWndCol, nRow, nLeft, nTop, nRight, nBottom, MTGR_VISIBLE_PART ) != MTGR_RET_ERROR
Set nDC = GetDC( hWndForm )
If nDC
Set nBrush = CreateSolidBrush( COLOR_Blue )
If nBrush
Call FillRect( nDC, nLeft, nTop, nRight + 1, nBottom + 1, nBrush )
Call DeleteObject( nBrush )
Call ReleaseDC( hWndForm, nDC )
See also
Size, location and hit test
Created with the Personal Edition of HelpNDoc: Effortlessly Edit and Export Markdown Documents