TopBarMenu

TopBarHitTest

Find the menu bar item at a screen position

Syntax

Signature
int         TopBarHitTest( const TopBarMenu *topBar, int row, int col );

Arguments

topBar the top bar menu.

row, col the screen row and column to test.

Return value

The one-based position of the first matching item, or HTNOWHERE if the coordinates miss every item or the object is NULL.

Description

The hit region includes the spaces around the caption. Disabled items can still be hit. If items overlap near the right edge, the result is the earliest matching item in menu order. The bar uses a single row, so results are limited to item positions and `HTNOWHERE`.

See also