Rediger

Del via


TBM_GETTICPOS message

Retrieves the current physical position of a tick mark in a trackbar.

Parameters

wParam

Zero-based index identifying a tick mark. The positions of the first and last tick marks are not directly available via this message.

lParam

Must be zero.

Return value

Returns the distance, in client coordinates, from the left or top of the trackbar's client area to the specified tick mark. The return value is the x-coordinate of the tick mark for a horizontal trackbar or the y-coordinate for a vertical trackbar. If wParam is not a valid index, the return value is -1.

Remarks

Because the first and last tick marks are not available through this message, valid indexes are offset from their tick position on the trackbar. If the difference between TBM_GETRANGEMIN and TBM_GETRANGEMAX is less than two, then there is no valid index and this message will fail.

The following illustrates the relation between the ticks on a trackbar, the ticks available through this message, and their zero-based indexes.

0 1 2 3 4 5 6 7 8 9    // Tick positions seen on the trackbar.
  1 2 3 4 5 6 7 8      // Tick positions whose position can be identified.
  0 1 2 3 4 5 6 7      // Index numbers for the identifiable positions.

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Header
Commctrl.h