SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Returns the dimensions of the column header area.
C
void WINAPI SftTree_GetHeaderRect(HWND hwndCtl, int iCol, LPRECT lpRect); void WINAPI SftTreeSplit_GetHeaderRect(HWND hwndCtl, int iCol, LPRECT lpRect);
C++
void CSftTree::GetHeaderRect(int iCol, LPRECT lpRect) const; void CSftTreeSplit::GetHeaderRect(int iCol, LPRECT lpRect) const;
hwndCtl
The window handle of the tree control.
iCol
The zero-based column number whose location is to be retrieved. If -1 is specified, the location of the entire column header area is returned.
lpRect
A pointer to a RECT structure where the location of the requested column header is returned.
The GetHeaderRect function returns the dimensions of the column header area.
GetHeaderRect does not handle merged column headers. If cell or column merging is used, GetDisplayHeaderRect should be used instead.
An empty rectangle is returned if an invalid column number is specified or column headers are not shown (see SetShowHeader).
The coordinates returned in lpRect are coordinates relative to the tree control's client area (in pixels).
The row/column header area can be retrieved using GetRowColHeaderRect.
if (x < 0 && y < 0) // Shift+F10 or VK_APPS pressed (not used in this sample) return; pt.x = x; pt.y = y; MapWindowPoints(NULL, hwndTree, &pt, 1); // check if header right-clicked - we don't show the context menu there SftTree_GetHeaderRect(hwndTree, -1, &rect); if (PtInRect(&rect, pt)) return; // check if an item cell right-clicked index = SftTree_CalcIndexFromPointEx(hwndTree, &pt); if (index >= 0 && index < SftTree_GetCount(hwndTree)) { // on an item ShowItemMenu(hwndParent, hwndTree, index, x, y);
if (pt.x < 0 && pt.y < 0) // Shift+F10 or VK_APPS pressed (not used in this sample) return; ptTree = pt; ScreenToClient(&ptTree); // check if header right-clicked - we don't show the popup there m_Tree.GetHeaderRect(-1, &rect); if (PtInRect(&rect, ptTree)) return; // check if an item cell right-clicked index = m_Tree.CalcIndexFromPointEx(&ptTree); if (index >= 0 && index < m_Tree.GetCount()) { // on an item ShowItemMenu(index, pt);
See Also C/C++ API | Categories | Notifications