HeaderPane
Main
Hide
Share Link
Print

ItemRect

Returns an item's location in client area coordinates.

C

int WINAPI SftBox_GetItemRect(HWND hwndCtl, LONG indexItem, LPRECT lpRect);

C++

int CSftBox::GetItemRect(LONG indexItem, LPRECT lpRect) const;

Parameters

hwndCtl

The window handle of the combo box control.

indexItem

The zero-based index of the item in the dropdown portion for which the position is to be retrieved. Specify -1 to retrieve the position of the area used to display the selected item (the static portion or the edit control portion).

lpRect

A pointer to a RECT structure, where the coordinates will be returned.

Returns

GetItemRect returns 0 if the specified item is currently displayed and the RECT structure contains the coordinates of the item. -1 is returned if the item is not displayed or if an error occurred. In this case, the RECT structure is empty.

If indexItem is -1, GetItemRect always returns 0.

Comments

The GetItemRect function returns an item's location in client area coordinates.

If indexItem is -1, the coordinates returned are relative to the client area of the combo box control.

If indexItem is the index of an item, the coordinates returned describe the item's location in the dropdown portion and are relative to the client area of the dropdown portion's window (see GetHWNDDropDown). An item is not displayed if its parent item is collapsed or if it is scrolled out of view.

To retrieve the coordinates of a specific cell, see GetCellRect.

See Also C/C++ API | Categories | Notifications


Last Updated 11/21/2026 - (email)
© 2026 Softel vdm, Inc.