본문 바로가기

Windows/Windows API

트랙바 (trackbar)

Trackbar Control Reference


This section contains information about the programming elements used with trackbar controls.

Overviews

Trackbar Controls

A trackbar is a window that contains a slider and optional tick marks. When the user moves the slider, using either the mouse or the direction keys, the trackbar sends notification messages to indicate the change.

Messages

TBM_CLEARSEL

Clears the current selection range in a trackbar.

TBM_CLEARTICS

Removes the current tick marks from a trackbar. This message does not remove the first and last tick marks, which are created automatically by the trackbar.

TBM_GETBUDDY

Retrieves the handle to a trackbar control buddy window at a given location. The specified location is relative to the control's orientation (horizontal or vertical).

TBM_GETCHANNELRECT

Retrieves the size and position of the bounding rectangle for a trackbar's channel. (The channel is the area over which the slider moves. It contains the highlight when a range is selected.)

TBM_GETLINESIZE

Retrieves the number of logical positions the trackbar's slider moves in response to keyboard input from the arrow keys, such as the or keys. The logical positions are the integer increments in the trackbar's range of minimum to maximum slider positions.

TBM_GETNUMTICS

Retrieves the number of tick marks in a trackbar.

TBM_GETPAGESIZE

Retrieves the number of logical positions the trackbar's slider moves in response to keyboard input, such as the or keys, or mouse input, such as clicks in the trackbar's channel. The logical positions are the integer increments in the trackbar's range of minimum to maximum slider positions.

TBM_GETPOS

Retrieves the current logical position of the slider in a trackbar. The logical positions are the integer values in the trackbar's range of minimum to maximum slider positions.

TBM_GETPTICS

Retrieves the address of an array that contains the positions of the tick marks for a trackbar.

TBM_GETRANGEMAX

Retrieves the maximum position for the slider in a trackbar.

TBM_GETRANGEMIN

Retrieves the minimum position for the slider in a trackbar.

TBM_GETSELEND

Retrieves the ending position of the current selection range in a trackbar.

TBM_GETSELSTART

Retrieves the starting position of the current selection range in a trackbar.

TBM_GETTHUMBLENGTH

Retrieves the length of the slider in a trackbar.

TBM_GETTHUMBRECT

Retrieves the size and position of the bounding rectangle for the slider in a trackbar.

TBM_GETTIC

Retrieves the logical position of a tick mark in a trackbar. The logical position can be any of the integer values in the trackbar's range of minimum to maximum slider positions.

TBM_GETTICPOS

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

TBM_GETTOOLTIPS

Retrieves the handle to the ToolTip control assigned to the trackbar, if any.

TBM_GETUNICODEFORMAT

Retrieves the Unicode character format flag for the control.

TBM_SETBUDDY

Assigns a window as the buddy window for a trackbar control. Trackbar buddy windows are automatically displayed in a location relative to the control's orientation (horizontal or vertical).

TBM_SETLINESIZE

Sets the number of logical positions the trackbar's slider moves in response to keyboard input from the arrow keys, such as the or keys. The logical positions are the integer increments in the trackbar's range of minimum to maximum slider positions.

TBM_SETPAGESIZE

Sets the number of logical positions the trackbar's slider moves in response to keyboard input, such as the or keys, or mouse input, such as clicks in the trackbar's channel. The logical positions are the integer increments in the trackbar's range of minimum to maximum slider positions.

TBM_SETPOS

Sets the current logical position of the slider in a trackbar.

TBM_SETRANGE

Sets the range of minimum and maximum logical positions for the slider in a trackbar.

TBM_SETRANGEMAX

Sets the maximum logical position for the slider in a trackbar.

TBM_SETRANGEMIN

Sets the minimum logical position for the slider in a trackbar.

TBM_SETSEL

Sets the starting and ending positions for the available selection range in a trackbar.

TBM_SETSELEND

Sets the ending logical position of the current selection range in a trackbar. This message is ignored if the trackbar does not have the TBS_ENABLESELRANGE style.

TBM_SETSELSTART

Sets the starting logical position of the current selection range in a trackbar. This message is ignored if the trackbar does not have the TBS_ENABLESELRANGE style.

TBM_SETTHUMBLENGTH

Sets the length of the slider in a trackbar. This message is ignored if the trackbar does not have the TBS_FIXEDLENGTH style.

TBM_SETTIC

Sets a tick mark in a trackbar at the specified logical position.

TBM_SETTICFREQ

Sets the interval frequency for tick marks in a trackbar. For example, if the frequency is set to two, a tick mark is displayed for every other increment in the trackbar's range. The default setting for the frequency is one; that is, every increment in the range is associated with a tick mark.

TBM_SETTIPSIDE

Positions a ToolTip control used by a trackbar control. Trackbar controls that use the TBS_TOOLTIPS style display ToolTips.

TBM_SETTOOLTIPS

Assigns a ToolTip control to a trackbar control.

TBM_SETUNICODEFORMAT

Sets the Unicode character format flag for the control. This message allows you to change the character set used by the control at run time rather than having to re-create the control.

Notifications

NM_CUSTOMDRAW (trackbar)

Sent by a trackbar control to notify its parent windows about drawing operations. This notification is sent in the form of a WM_NOTIFY message.

NM_RELEASEDCAPTURE (trackbar)

Notifies a trackbar control's parent window that the control is releasing mouse capture. This notification is sent in the form of a WM_NOTIFY message.

Constants

Custom Draw Values

This section lists the values used to identify a Trackbar control's parts.

Trackbar Control Styles

This section contains information about the styles used with trackbar controls.



© 2003 Microsoft Corporation. All rights reserved.