
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.
Trackbar Control Updates in Internet Explorer
Trackbars are useful when you want the user to select a discrete value or a set of consecutive values in a range. For example, you might use a trackbar to allow the user to set the repeat rate of the keyboard by moving the slider to a given tick mark. The following illustration shows a typical trackbar.
The slider in a trackbar moves in increments that you specify when you create it. For example, if you specify that the trackbar should have a range from zero to five, the slider can occupy only six positions: a position at the left side of the trackbar and one position for each increment in the range. Typically, each of these positions is identified by a tick mark.
You create a trackbar by using the CreateWindowEx function, specifying the TRACKBAR_CLASS window class. After you have created a trackbar, you can use trackbar messages to set and retrieve many of its properties. Changes that you can make include setting the minimum and maximum positions for the slider, drawing tick marks, setting a selection range, and repositioning the slider.
An application can send messages to the trackbar to retrieve information about the window and to change its characteristics.
To retrieve the position of the slider (that is, the value the user has chosen), use the TBM_GETPOS message. To set the position of the slider, use the TBM_SETPOS message.
The range of a trackbar is the set of contiguous values that the trackbar can represent. Most applications use the TBM_SETRANGE message to set the range of a trackbar when it is first created. Applications can dynamically alter the range by using the TBM_SETRANGEMAX and TBM_SETRANGEMIN messages. An application that allows the range to be changed dynamically typically retrieves the final range settings when the user has finished working with the trackbar. To retrieve these settings, use the TBM_GETRANGEMAX and TBM_GETRANGEMIN messages.
A trackbar automatically displays tick marks at its beginning and end, unless you specify the TBS_NOTICKS style. You can use the TBS_AUTOTICKS style to automatically display additional tick marks at regular intervals along the trackbar. By default, a TBS_AUTOTICKS trackbar displays a tick mark at each increment of the trackbar's range. To specify a different interval for the automatic tick marks, send the TBM_SETTICFREQ message to the trackbar. For example, you could use this message to display only 10 tick marks in a range of 1 through 100.
To set the position of a single tick mark, send the TBM_SETTIC message. A trackbar maintains an array of DWORD values that stores the position of each tick mark. The array does not include the first and last tick marks that the trackbar creates automatically. You can specify an index in this array when you send the TBM_GETTIC message to get the position of the corresponding tick mark. Alternatively, you can send the TBM_GETPTICS message to get a pointer to the array. The number of elements in the array is equal to two less than the tick count returned by the TBM_GETNUMTICS message. This is because the count returned by TBM_GETNUMTICS includes the first and last tick marks that are not included in the array. To retrieve the physical position of a tick mark, in client coordinates of the trackbar's window, send the TBM_GETTICPOS message. The TBM_CLEARTICS message removes all but the first and last of a trackbar's tick marks.
A trackbar's line size determines how far the slider moves in response to keyboard input from the arrow keys, such as the RIGHT ARROW or DOWN ARROW key. To retrieve or set the line size, send the TBM_GETLINESIZE and TBM_SETLINESIZE messages. The trackbar also sends the TB_LINEUP and TB_LINEDOWN notification messages to its parent window when the user presses the arrow keys.
A trackbar's page size determines how far the slider moves in response to keyboard input, such as the PAGE UP or PAGE DOWN keys, or mouse input, such as clicks in the trackbar channel. To retrieve or set the page size, send the TBM_GETPAGESIZE and TBM_SETPAGESIZE messages. The trackbar also sends the TB_PAGEUP and TB_PAGEDOWN notification messages to its parent window when it receives keyboard or mouse input that scrolls the page. For more information, see Trackbar Notification Messages.
An application can send messages to retrieve the dimensions of a trackbar. The TBM_GETTHUMBRECT message retrieves the bounding rectangle for the slider. The TBM_GETTHUMBLENGTH message retrieves the length of the slider. The TBM_GETCHANNELRECT message retrieves the bounding rectangle for the trackbar's channel, which is the area over which the slider moves. It contains the highlight when a range is selected. If a trackbar has the TBS_FIXEDLENGTH style, you can send the TBM_SETTHUMBLENGTH message to change the length of the slider.
A trackbar with the TBS_ENABLESELRANGE style can indicate a selection range by highlighting a range of the trackbar's channel and displaying triangular tick marks at the start and end of the selection. When a trackbar has this style, you can send messages to set and retrieve the selection range. Typically, an application handles the trackbar notification messages and sets the trackbar's selection range according to the user's input. The TBM_SETSEL message sets the starting and ending positions of a selection. To set just the starting position or just the ending position of a selection, use the TBM_SETSELSTART or TBM_SETSELEND message. To retrieve the starting and ending positions of a selection range, send the TBM_GETSELSTART and TBM_GETSELEND messages. To clear a selection range, send the TBM_CLEARSEL message.
A trackbar notifies its parent window of user actions by sending the parent WM_HSCROLL or WM_VSCROLL messages. A trackbar with the TBS_HORZ style sends WM_HSCROLL messages. A trackbar with the TBS_VERT style sends WM_VSCROLL messages. The low-order word of the wParam parameter of WM_HSCROLL or WM_VSCROLL contains the notification code. For the TB_THUMBPOSITION and TB_THUMBTRACK notifications, the high-order word of the wParam parameter specifies the position of the slider. For all other notifications, the high-order word is zero; send the TBM_GETPOS message to determine the slider position. The lParam parameter is the handle of the trackbar.
The system sends the TB_BOTTOM, TB_LINEDOWN, TB_LINEUP, and TB_TOP notification messages only when the user interacts with a trackbar by using the keyboard. The TB_THUMBPOSITION and TB_THUMBTRACK notification messages are only sent when the user is using the mouse. The TB_ENDTRACK, TB_PAGEDOWN, and TB_PAGEUP notification messages are sent in both cases. The following table lists the trackbar notification messages and the events (virtual key codes or mouse events) that cause the notifications to be sent.
| Notification message | Reason sent |
| TB_BOTTOM | VK_END |
| TB_ENDTRACK | WM_KEYUP (the user released a key that sent a relevant virtual key code) |
| TB_LINEDOWN | VK_RIGHT or VK_DOWN |
| TB_LINEUP | VK_LEFT or VK_UP |
| TB_PAGEDOWN | VK_NEXT (the user clicked the channel below or to the right of the slider) |
| TB_PAGEUP | VK_PRIOR (the user clicked the channel above or to the left of the slider) |
| TB_THUMBPOSITION | WM_LBUTTONUP following a TB_THUMBTRACK notification message |
| TB_THUMBTRACK | Slider movement (the user dragged the slider) |
| TB_TOP | VK_HOME |
This section describes the window message processing performed by a trackbar.
| Message | Processing performed |
| WM_CAPTURECHANGED | Kills the timer if one was set during WM_LBUTTONDOWN processing and sends the TB_THUMBPOSITION notification message, if necessary. It always sends the TB_ENDTRACK notification message. |
| WM_CREATE | Performs additional initialization, such as setting the line size, page size, and tick mark frequency to default values. |
| WM_DESTROY | Frees resources. |
| WM_ENABLE | Repaints the trackbar window. |
| WM_ERASEBKGND | Erases the window background, using the current background color for the trackbar. |
| WM_GETDLGCODE | Returns the DLGC_WANTARROWS value. |
| WM_KEYDOWN | Processes the direction keys and sends the TB_TOP, TB_BOTTOM, TB_PAGEUP, TB_PAGEDOWN, TB_LINEUP, and TB_LINEDOWN notification messages, as appropriate. |
| WM_KEYUP | Sends the TB_ENDTRACK notification message if the key was one of the direction keys. |
| WM_KILLFOCUS | Repaints the trackbar window. |
| WM_LBUTTONDOWN | Sets the focus and the mouse capture to the trackbar. When necessary, it sets a timer that determines how quickly the slider moves toward the mouse cursor when the user holds down the mouse button in the window. |
| WM_LBUTTONUP | Releases the mouse capture and kills the timer if one was set during WM_LBUTTONDOWN processing. It sends the TB_THUMBPOSITION notification message, if necessary. It always sends the TB_ENDTRACK notification message. |
| WM_MOUSEMOVE | Moves the slider and sends the TB_THUMBTRACK notification message when tracking the mouse (see WM_TIMER). |
| WM_PAINT | Paints the trackbar. If the wParam parameter is non-NULL, the control assumes that the value is an HDC and paints using that device context. |
| WM_SETFOCUS | Repaints the trackbar window. |
| WM_SIZE | Sets the dimensions of the trackbar, removing the slider if there is not enough room to display it. |
| WM_TIMER | Retrieves the mouse position and updates the position of the slider. (It is received only when the user is dragging the slider.) |
| WM_WININICHANGE | Initializes slider dimensions. |
This section provides examples that demonstrate how to create a trackbar and process trackbar notification messages.
The following example shows how to create a trackbar with the TBS_AUTOTICKS and TBS_ENABLESELRANGE styles. When the trackbar is created, both its range and its selection range are initialized. The page size is also set at this time.
// CreateTrackbar - creates and initializes a trackbar.
//
// Global variable
// g_hinst - instance handle
HWND WINAPI CreateTrackbar(
HWND hwndDlg, // handle of dialog box (parent window)
UINT iMin, // minimum value in trackbar range
UINT iMax, // maximum value in trackbar range
UINT iSelMin, // minimum value in trackbar selection
UINT iSelMax) // maximum value in trackbar selection
{
InitCommonControls(); // loads common control's DLL
hwndTrack = CreateWindowEx(
0, // no extended styles
TRACKBAR_CLASS, // class name
"Trackbar Control", // title (caption)
WS_CHILD | WS_VISIBLE |
TBS_AUTOTICKS | TBS_ENABLESELRANGE, // style
10, 10, // position
200, 30, // size
hwndDlg, // parent window
ID_TRACKBAR, // control identifier
g_hinst, // instance
NULL // no WM_CREATE parameter
);
SendMessage(hwndTrack, TBM_SETRANGE,
(WPARAM) TRUE, // redraw flag
(LPARAM) MAKELONG(iMin, iMax)); // min. & max. positions
SendMessage(hwndTrack, TBM_SETPAGESIZE,
0, (LPARAM) 4); // new page size
SendMessage(hwndTrack, TBM_SETSEL,
(WPARAM) FALSE, // redraw flag
(LPARAM) MAKELONG(iSelMin, iSelMax);
SendMessage(hwndTrack, TBM_SETPOS,
(WPARAM) TRUE, // redraw flag
(LPARAM) iSelMin);
SetFocus(hwndTrack);
return hwndTrack;
}
The following example is a function that is called whenever a WM_HSCROLL message is received by the dialog box containing the trackbar. The trackbar has the TBS_ENABLESELRANGE style. The position of the slider is compared against the selection range, and the slider is moved to the starting or ending position of the selection range, when necessary.
A dialog containing a trackbar with the TBS_VERT style could use this function when it receives a WM_VSCROLL message.
// TBNotifications - handles trackbar notifications received
// in the wParam parameter of WM_HSCROLL. This function simply
// ensures that the slider remains within the selection range.
VOID WINAPI TBNotifications(
WPARAM wParam, // wParam of WM_HSCROLL message
HWND hwndTrack, // handle of trackbar window
UINT iSelMin, // minimum value of trackbar selection
UINT iSelMax) // maximum value of trackbar selection
{
DWORD dwPos; // current position of slider
switch (LOWORD(wParam)) {
case TB_ENDTRACK:
dwPos = SendMessage(hwndTrack, TBM_GETPOS, 0, 0);
if (dwPos > iSelMax)
SendMessage(hwndTrack, TBM_SETPOS,
(WPARAM) TRUE, // redraw flag
(LPARAM) iSelMax);
else if (dwPos < iSelMin)
SendMessage(hwndTrack, TBM_SETPOS,
(WPARAM) TRUE, // redraw flag
(LPARAM) iSelMin);
break;
default:
break;
}
}
Trackbar controls in Microsoft® Internet Explorer support the following new features.
This section contains information about the following programming elements used with trackbar controls.
| Notifications |
| NM_CUSTOMDRAW (trackbar) |
| NM_RELEASEDCAPTURE (trackbar) |
The following constant values are used with trackbar controls.
This section contains information about the styles used with trackbar controls.
| TBS_AUTOTICKS | The trackbar control will have a tick mark for each increment in its range of values. |
| TBS_BOTH | The trackbar control will display tick marks on both sides of the control. This will be both top and bottom when used with TBS_HORZ or both left and right if used with TBS_VERT. |
| TBS_BOTTOM | The trackbar control will display tick marks below the control. This style is only valid with TBS_HORZ. |
| TBS_ENABLESELRANGE | The trackbar control can display a selection range only. The tick marks at the starting and ending positions of a selection range are displayed as triangles (instead of vertical dashes), and the selection range is highlighted. |
| TBS_FIXEDLENGTH | The trackbar control allows the size of the slider to be changed with the TBM_SETTHUMBLENGTH message. |
| TBS_HORZ | The trackbar control will be oriented vertically. This is the default orientation. |
| TBS_LEFT | The trackbar control will display tick marks to the left of the control. This style is only valid with TBS_VERT. |
| TBS_NOTHUMB | The trackbar control does not display a slider. |
| TBS_NOTICKS | The trackbar control will not display any tick marks. |
| TBS_RIGHT | The trackbar control will display tick marks to the right of the control. This style is only valid with TBS_VERT. |
| TBS_TOOLTIPS | Version 4.70. The trackbar control will support tooltips. When a trackbar control is created using this style, it automatically creates a default tooltip control that displays the slider's current position. You can change where the tooltips are displayed by using the TBM_SETTIPSIDE message. |
| TBS_TOP | The trackbar control will display tick marks above the control. This style is only valid with TBS_HORZ. |
| TBS_VERT | The trackbar control will be oriented vertically. This is the default orientation. |
Trackbar controls use the following values to identify a control's parts. One of these values is specified in the dwItemSpec member of the NMCUSTOMDRAW structure.
| TBCD_CHANNEL | Identifies the channel that the trackbar control's thumb marker slides along. This is the part of the control that the user moves. |
| TBCD_THUMB | Identifies the trackbar control's thumb marker. |
| TBCD_TICS | Identifies the tick marks that are displayed along the trackbar control's edge. |
This section contains information about the messages used with trackbar controls.
TBM_CLEARSEL
wParam = (WPARAM) (BOOL) fRedraw;
lParam = 0;
Clears the current selection range in a trackbar.
A trackbar can have a selection range only if you specified the TBS_ENABLESELRANGE style when you created it.
See also TBM_SETSEL, TBM_SETSELEND, TBM_SETSELSTART
TBM_CLEARTICS
wParam = (WPARAM) (BOOL) fRedraw;
lParam = 0;
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
wParam = (WPARAM)(BOOL) fLocation;
lParam = 0;
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).
| TRUE | Retrieves the handle to the buddy to the left of the trackbar. If the trackbar control uses the TBS_VERT style, the message will retrieve the buddy above the trackbar. |
| FALSE | Retrieves the handle to the buddy to the right of the trackbar. If the trackbar control uses the TBS_VERT style, the message will retrieve the buddy below the trackbar. |
Version 4.70
TBM_GETCHANNELRECT
wParam = 0;
lParam = (LPARAM) (LPRECT) lprc;
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
wParam = 0;
lParam = 0;
Retrieves the number of logical positions the trackbar's slider moves in response to keyboard input from the arrow keys, such as the RIGHT ARROW or DOWN ARROW keys. The logical positions are the integer increments in the trackbar's range of minimum to maximum slider positions.
The default setting for the line size is 1.
The trackbar also sends the TB_LINEUP and TB_LINEDOWN notification messages to its parent window when the user presses the arrow keys.
See also TBM_SETLINESIZE
TBM_GETNUMTICS
wParam = 0;
lParam = 0;
Retrieves the number of tick marks in a trackbar.
The TBM_GETNUMTICS message counts all of the tick marks, including the first and last tick marks created by the trackbar.
TBM_GETPAGESIZE
wParam = 0;
lParam = 0;
Retrieves the number of logical positions the trackbar's slider moves in response to keyboard input, such as the PAGE UP or PAGE DOWN 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.
The trackbar also sends the TB_PAGEUP and TB_PAGEDOWN notification messages to its parent window when it receives keyboard or mouse input that scrolls the page.
See also TBM_SETPAGESIZE
TBM_GETPOS
wParam = 0;
lParam = 0;
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.
See also TBM_SETPOS
TBM_GETPTICS
wParam = 0;
lParam = 0;
Retrieves the address of an array that contains the positions of the tick marks for a trackbar.
The number of elements in the array is two less than the tick count returned by the TBM_GETNUMTICS message. Note that the values in the array may include duplicate positions and may not be in sequential order. The returned pointer is valid until you change the trackbar's tick marks.
TBM_GETRANGEMAX
wParam = 0;
lParam = 0;
Retrieves the maximum position for the slider in a trackbar.
See also TBM_GETRANGEMIN, TBM_SETRANGE, TBM_SETRANGEMAX
TBM_GETRANGEMIN
wParam = 0;
lParam = 0;
Retrieves the minimum position for the slider in a trackbar.
See also TBM_GETRANGEMAX, TBM_SETRANGE, TBM_SETRANGEMAX
TBM_GETSELEND
wParam = 0;
lParam = 0;
Retrieves the ending position of the current selection range in a trackbar.
A trackbar can have a selection range only if you specified the TBS_ENABLESELRANGE style when you created it.
See also TBM_GETSELSTART, TBM_SETSEL, TBM_SETSELEND, TBM_SETSELSTART
TBM_GETSELSTART
wParam = 0;
lParam = 0;
Retrieves the starting position of the current selection range in a trackbar.
A trackbar can have a selection range only if you specified the TBS_ENABLESELRANGE style when you created it.
See also TBM_GETSELEND, TBM_SETSEL, TBM_SETSELEND, TBM_SETSELSTART
TBM_GETTHUMBLENGTH
wParam = 0;
lParam = 0;
Retrieves the length of the slider in a trackbar.
See also TBM_GETTHUMBRECT, TBM_SETTHUMBLENGTH
TBM_GETTHUMBRECT
wParam = 0;
lParam = (LPARAM) (LPRECT) lprc;
Retrieves the size and position of the bounding rectangle for the slider in a trackbar.
TBM_GETTIC
wParam = (WPARAM) (WORD) iTic;
lParam = 0;
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
wParam = (WPARAM) (WORD) iTic;
lParam = 0;
Retrieves the current physical position of a tick mark in a trackbar.
TBM_GETTOOLTIPS
wParam = 0;
lParam = 0;
Retrieves the handle to the tooltip control assigned to the trackbar, if any.
Version 4.70
TBM_GETUNICODEFORMAT
wParam = 0;
lParam = 0;
Retrieves the UNICODE character format flag for the control.
See also TBM_SETUNICODEFORMAT
TBM_SETBUDDY
wParam = (WPARAM)(BOOL) fLocation;
lParam = (LPARAM)(HWND) hwndBuddy;
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).
| TRUE | The buddy will appear to the left of the trackbar if the trackbar control uses the TBS_HORZ style. If the trackbar uses the TBS_VERT style, the buddy appears above the trackbar control. |
| FALSE | The buddy will appear to the right of the trackbar if the trackbar control uses the TBS_HORZ style. If the trackbar uses the TBS_VERT style, the buddy appears below the trackbar control. |
Note Trackbar controls support up to two buddy windows. This can be useful when you must display text or images at each end of the control.
Version 4.70
TBM_SETLINESIZE
wParam = 0;
lParam = (LONG) lLineSize;
Sets the number of logical positions the trackbar's slider moves in response to keyboard input from the arrow keys, such as the RIGHT ARROW or DOWN ARROW keys. The logical positions are the integer increments in the trackbar's range of minimum to maximum slider positions.
The default setting for the line size is 1.
The trackbar also sends the TB_LINEUP and TB_LINEDOWN notification messages to its parent window when the user presses the arrow keys.
See also TBM_GETLINESIZE
TBM_SETPAGESIZE
wParam = 0;
lParam = (LONG) lPageSize;
Sets the number of logical positions the trackbar's slider moves in response to keyboard input, such as the PAGE UP or PAGE DOWN 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.
The trackbar also sends the TB_PAGEUP and TB_PAGEDOWN notification messages to its parent window when it receives keyboard or mouse input that scrolls the page.
See also TBM_GETPAGESIZE
TBM_SETPOS
wParam = (WPARAM) (BOOL) fPosition;
lParam = (LPARAM) (LONG) lPosition;
Sets the current logical position of the slider in a trackbar.
TBM_SETRANGE
wParam = (WPARAM) (BOOL) fRedraw;
lParam = (LPARAM) MAKELONG(lMinimum, lMaximum);
Sets the range of minimum and maximum logical positions for the slider in a trackbar.
If the current slider position is outside the new range, the TBM_SETRANGE message sets the slider position to the new maximum or minimum value.
See also TBM_SETRANGEMAX, TBM_SETRANGEMIN
TBM_SETRANGEMAX
wParam = (WPARAM) fRedraw;
lParam = (LPARAM) lMaximum;
Sets the maximum logical position for the slider in a trackbar.
If the current slider position is greater than the new maximum, the TBM_SETRANGEMAX message sets the slider position to the new maximum value.
See also TBM_SETRANGE, TBM_SETRANGEMIN
TBM_SETRANGEMIN
wParam = (WPARAM) fRedraw;
lParam = (LPARAM) lMinimum;
Sets the minimum logical position for the slider in a trackbar.
If the current slider position is less than the new minimum, the TBM_SETRANGEMIN message sets the slider position to the new minimum value.
See also TBM_SETRANGE, TBM_SETRANGEMAX
TBM_SETSEL
wParam = (WPARAM) (BOOL) fRedraw;
lParam = (LPARAM) MAKELONG(lMinimum, lMaximum);
Sets the starting and ending logical positions for the current selection range in a trackbar. This message is ignored if the trackbar does not have the TBS_ENABLESELRANGE style.
See also TBM_GETSELEND, TBM_GETSELSTART, TBM_SETSELEND, TBM_SETSELSTART
TBM_SETSELEND
wParam = (WPARAM) (BOOL) fRedraw;
lParam = (LPARAM) (LONG) lEnd;
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.
See also TBM_GETSELEND, TBM_GETSELSTART, TBM_SETSEL, TBM_SETSELSTART
TBM_SETSELSTART
wParam = (WPARAM) (BOOL) fRedraw;
lParam = (LPARAM) (LONG) lStart;
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.
See also TBM_GETSELEND, TBM_GETSELSTART, TBM_SETSEL, TBM_SETSELEND
TBM_SETTHUMBLENGTH
wParam = (WPARAM) (UINT) iLength;
lParam = 0;
Sets the length of the slider in a trackbar. This message is ignored if the trackbar does not have the TBS_FIXEDLENGTH style.
See also TBM_GETTHUMBLENGTH
TBM_SETTIC
wParam = 0;
lParam = (LPARAM) (LONG) lPosition;
Sets a tick mark in a trackbar at the specified logical position.
A trackbar creates its own first and last tick marks. Do not use this message to set the first and last tick marks.
See also TBM_GETPTICS, TBM_GETTIC
TBM_SETTICFREQ
wParam = (WPARAM) wFreq;
lParam = (LPARAM) 0;
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.
The trackbar must have the TBS_AUTOTICKS style to use this message.
TBM_SETTIPSIDE
wParam = (WPARAM)(int) fLocation;
lParam = 0;
Positions a tooltip control used by a trackbar control. Trackbar controls that use the TBS_TOOLTIPS style display tooltips.
| TBTS_TOP | The tooltip control will be positioned above the trackbar. This flag is for use with horizontal trackbars. |
| TBTS_LEFT | The tooltip control will be positioned to the left of the trackbar. This flag is for use with vertical trackbars. |
| TBTS_BOTTOM | The tooltip control will be positioned below the trackbar. This flag is for use with horizontal trackbars. |
| TBTS_RIGHT | The tooltip control will be positioned to the right of the trackbar. This flag is for use with vertical trackbars. |
Version 4.70
TBM_SETTOOLTIPS
wParam = (WPARAM)(HWND) hwndTT;
lParam = 0;
Assigns a tooltip control to a trackbar control.
When a trackbar control is created with the TBS_TOOLTIPS style, it creates a default tooltip control that appears next to the slider, displaying the slider's current position.
Version 4.70
TBM_SETUNICODEFORMAT
wParam = (WPARAM)(BOOL)fUnicode;
lParam = 0;
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.
See also TBM_GETUNICODEFORMAT
This section contains information about the notification messages used with trackbar controls.
NM_CUSTOMDRAW
lpNMCustomDraw = (LPNMCUSTOMDRAW) lParam;
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.
When dwDrawStage equals CDDS_PREPAINT:
|
When dwDrawStage equals CDDS_ITEMPREPAINT:
|
| TBCD_CHANNEL | Identifies the channel that the trackbar control's thumb marker slides along. |
| TBCD_THUMB | Identifies the trackbar control's thumb marker. This is the portion of the control that the user moves. |
| TBCD_TICS | Identifies the increment tick marks that appear along the edge of the trackbar control. |
Version 4.70
See also Using Custom Draw
NM_RELEASEDCAPTURE
lpnmh = (LPNMHDR) lParam;
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.
Version 4.71.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.