ListBox

ListBoxHitTest

Identify the list box part at a screen position

Syntax

Signature
int          ListBoxHitTest( const ListBox *listBox, int row, int col );

Arguments

listBox the list box.

row, col the screen row and column to test.

Return value

A positive one-based item position on a visible item, a hit constant for a control part, or HTNOWHERE outside the hit regions or if the object is NULL.

Description

The caption takes priority and gives `HTCAPTION`. The drop-down button gives `HTDROPBUTTON`, and the rest of the drop-down's current-choice row gives `HTCLIENT`. Empty rows in the open item area also give `HTCLIENT`.

In the open item area, the attached scroll bar is tested before the frame and can return any result described by `ScrollBarHitTest()`. A frame edge or corner gives `HTTOPLEFT`, `HTTOP`, `HTTOPRIGHT`, `HTRIGHT`, `HTBOTTOMRIGHT`, `HTBOTTOM`, `HTBOTTOMLEFT` or `HTLEFT`. A closed drop-down has active hit regions for its caption and current-choice row.

See also