using System.Runtime.InteropServices;
using static Vanara.PInvoke.User32;
namespace Vanara.PInvoke
{
public static partial class ComCtl32
{
private const int TRBN_FIRST = -1501;
/// Custom Draw values, for example, are specified in the dwItemSpec member of the NMCUSTOMDRAW structure.
[PInvokeData("Commctrl.h", MSDNShortId = "bb760143")]
public enum TrackBarCustomDraw
{
/// Identifies the channel that the trackbar control's thumb marker slides along.
TBCD_CHANNEL = 0x0003,
/// Identifies the trackbar control's thumb marker. This is the part of the control that the user moves.
TBCD_THUMB = 0x0002,
/// Identifies the tick marks that are displayed along the trackbar control's edge.
TBCD_TICS = 0x0001,
}
/// Messages for trackbar.
[PInvokeData("Commctrl.h", MSDNShortId = "ff486075")]
public enum TrackBarMessage
{
///
/// 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.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
/// Must be zero.
/// Returns
/// Returns a 32-bit value that specifies the current logical position of the trackbar's slider.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getpos
TBM_GETPOS = WindowMessage.WM_USER,
/// Retrieves the minimum position for the slider in a trackbar.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
/// Must be zero.
/// Returns
/// Returns a 32-bit value that specifies the minimum position in the trackbar's range of minimum to maximum slider positions.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getrangemin
TBM_GETRANGEMIN = WindowMessage.WM_USER + 1,
/// Retrieves the maximum position for the slider in a trackbar.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
/// Must be zero.
/// Returns
/// Returns a 32-bit value that specifies the maximum position in the trackbar's range of minimum to maximum slider positions.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getrangemax
TBM_GETRANGEMAX = WindowMessage.WM_USER + 2,
///
/// 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.
/// Parameters
/// wParam
///
/// Zero-based index identifying a tick mark. Valid indexes are in the range from zero to two less than the tick count returned
/// by the TBM_GETNUMTICS message.
///
/// lParam
/// Must be zero.
/// Returns
/// Returns the logical position of the specified tick mark, or -1 if wParam does not specify a valid index.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-gettic
TBM_GETTIC = WindowMessage.WM_USER + 3,
/// Sets a tick mark in a trackbar at the specified logical position.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
///
/// Position of the tick mark. This parameter can be any of the integer values in the trackbar's range of minimum to maximum
/// slider positions.
///
/// Returns
/// Returns TRUE if the tick mark is set, or FALSE otherwise.
///
///
/// A trackbar creates its own first and last tick marks. Do not use this message to set the first and last tick marks.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-settic
TBM_SETTIC = WindowMessage.WM_USER + 4,
/// Sets the current logical position of the slider in a trackbar.
/// Parameters
/// wParam
///
/// Redraw flag. If this parameter is TRUE, the message redraws the control with the slider at the position given by
/// lParam. If this parameter is FALSE, the message does not redraw the slider at the new position. Note that the message
/// sets the value of the slider position (as returned by the TBM_GETPOS message) regardless of the wParam parameter.
///
/// lParam
///
/// New logical position of the slider. Valid logical positions are the integer values in the trackbar's range of minimum to
/// maximum slider positions. If this value is outside the control's maximum and minimum range, the position is set to the
/// maximum or minimum value.
///
/// Returns
/// No return value.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-setpos
TBM_SETPOS = WindowMessage.WM_USER + 5,
/// Sets the range of minimum and maximum logical positions for the slider in a trackbar.
/// Parameters
/// wParam
///
/// Redraw flag. If this parameter is TRUE, the trackbar is redrawn after the range is set. If this parameter is
/// FALSE, the message sets the range but does not redraw the trackbar.
///
/// lParam
/// The LOWORD specifies the minimum position for the slider, and the HIWORD specifies the maximum position.
/// Returns
/// No return value.
///
///
///
/// 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.
///
///
/// Because this message takes two 16-bit unsigned integer values, the maximum range that this message can specify is from 0 to
/// 65,535. To specify larger range values, use the TBM_SETRANGEMIN and TBM_SETRANGEMAX messages.
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-setrange
TBM_SETRANGE = WindowMessage.WM_USER + 6,
/// Sets the minimum logical position for the slider in a trackbar.
/// Parameters
/// wParam
///
/// Redraw flag. If this parameter is TRUE, the message redraws the trackbar after the range is set. If this parameter is
/// FALSE, the message sets the range but does not redraw the trackbar.
///
/// lParam
/// Minimum position for the slider.
/// Returns
/// No return value.
///
///
/// If the current slider position is less than the new minimum, the TBM_SETRANGEMIN message sets the slider position to
/// the new minimum value.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-setrangemin
TBM_SETRANGEMIN = WindowMessage.WM_USER + 7,
/// Sets the maximum logical position for the slider in a trackbar.
/// Parameters
/// wParam
///
/// Redraw flag. If this parameter is TRUE, the trackbar is redrawn after the range is set. If this parameter is
/// FALSE, the message sets the range but does not redraw the trackbar.
///
/// lParam
/// Maximum position for the slider.
/// Returns
/// No return value.
///
///
/// If the current slider position is greater than the new maximum, the TBM_SETRANGEMAX message sets the slider position
/// to the new maximum value.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-setrangemax
TBM_SETRANGEMAX = WindowMessage.WM_USER + 8,
///
/// 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.
/// Parameters
/// wParam
///
/// Redraw flag. If this parameter is TRUE, the trackbar is redrawn after the tick marks are cleared. If this parameter is
/// FALSE, the message clears the tick marks but does not redraw the trackbar.
///
/// lParam
/// Must be zero.
/// Returns
/// No return value.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-cleartics
TBM_CLEARTICS = WindowMessage.WM_USER + 9,
/// Sets the starting and ending positions for the available selection range in a trackbar.
/// Parameters
/// wParam
///
/// Redraw flag. If this parameter is TRUE, the message redraws the trackbar after the selection range is set. If this
/// parameter is FALSE, the message sets the selection range but does not redraw the trackbar.
///
/// lParam
///
/// The LOWORD specifies the starting logical position for the selection range, and the HIWORD specifies the ending
/// logical position.
///
/// Returns
/// No return value.
///
///
/// This message is ignored if the trackbar does not have the TBS_ENABLESELRANGE style.
/// TBM_SETSEL allows you to restrict the pointer to only a portion of the range available to the progress bar.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-setsel
TBM_SETSEL = WindowMessage.WM_USER + 10,
///
/// 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.
/// Parameters
/// wParam
///
/// Redraw flag. If this parameter is TRUE, the message redraws the trackbar after the selection range is set. If this
/// parameter is FALSE, the message sets the selection range but does not redraw the trackbar.
///
/// lParam
/// Starting position of the selection range.
/// Returns
/// No return value.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-setselstart
TBM_SETSELSTART = WindowMessage.WM_USER + 11,
///
/// 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.
/// Parameters
/// wParam
///
/// Redraw flag. If this parameter is TRUE, the message redraws the trackbar after the selection range is set. If this
/// parameter is FALSE, the message sets the selection range but does not redraw the trackbar.
///
/// lParam
/// Ending logical position of the selection range.
/// Returns
/// No return value.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-setselend
TBM_SETSELEND = WindowMessage.WM_USER + 12,
/// Retrieves the address of an array that contains the positions of the tick marks for a trackbar.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
/// Must be zero.
/// Returns
///
/// Returns the address of an array of DWORD values. The elements of the array specify the logical positions of the
/// trackbar's tick marks, not including the first and last tick marks created by the trackbar. The logical positions can be any
/// of the integer values in the trackbar's range of minimum to maximum slider positions.
///
///
///
/// 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.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getptics
TBM_GETPTICS = WindowMessage.WM_USER + 14,
/// 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.
/// Returns
///
/// 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.
///
///
///
///
/// 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.
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getticpos
TBM_GETTICPOS = WindowMessage.WM_USER + 15,
/// Retrieves the number of tick marks in a trackbar.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
/// Must be zero.
/// Returns
///
/// If no tick flag is set, it returns 2 for the beginning and ending ticks. If TBS_NOTICKS is set, it returns zero.
/// Otherwise, it takes the difference between the range minimum and maximum, divides by the tick frequency, and adds 2.
///
///
///
/// The TBM_GETNUMTICS message counts all of the tick marks, including the first and last tick marks created by the trackbar.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getnumtics
TBM_GETNUMTICS = WindowMessage.WM_USER + 16,
/// Retrieves the starting position of the current selection range in a trackbar.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
/// Must be zero.
/// Returns
/// Returns a 32-bit value that specifies the starting position of the current selection range.
///
///
/// A trackbar can have a selection range only if you specified the TBS_ENABLESELRANGE style when you created it.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getselstart
TBM_GETSELSTART = WindowMessage.WM_USER + 17,
/// Retrieves the ending position of the current selection range in a trackbar.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
/// Must be zero.
/// Returns
/// Returns a 32-bit value that specifies the ending position of the current selection range.
///
///
/// A trackbar can have a selection range only if you specified the TBS_ENABLESELRANGE style when you created it.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getselend
TBM_GETSELEND = WindowMessage.WM_USER + 18,
/// Clears the current selection range in a trackbar.
/// Parameters
/// wParam
/// Redraw flag. If this parameter is TRUE, the trackbar is redrawn after the selection is cleared.
/// lParam
/// Must be zero.
/// Returns
/// No return value.
///
///
/// A trackbar can have a selection range only if you specified the TBS_ENABLESELRANGE style when you created it.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-clearsel
TBM_CLEARSEL = WindowMessage.WM_USER + 19,
///
/// 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.
/// Parameters
/// wParam
/// Frequency of the tick marks.
/// lParam
/// Must be zero.
/// Returns
/// No return value.
///
/// The trackbar must have the TBS_AUTOTICKS style to use this message.
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-setticfreq
TBM_SETTICFREQ = WindowMessage.WM_USER + 20,
///
/// 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.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
/// New page size.
/// Returns
/// Returns a 32-bit value that specifies the previous page size.
///
///
/// The trackbar also sends a WM_HSCROLL or WM_VSCROLL message with the TB_PAGEUP and TB_PAGEDOWN notification
/// codes to its parent window when it receives keyboard or mouse input that scrolls the page.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-setpagesize
TBM_SETPAGESIZE = WindowMessage.WM_USER + 21,
///
/// 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.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
/// Must be zero.
/// Returns
/// Returns a 32-bit value that specifies the page size for the trackbar.
///
///
/// The trackbar also sends a WM_HSCROLL or WM_VSCROLL message with the TB_PAGEUP and TB_PAGEDOWN notification
/// codes to its parent window when it receives keyboard or mouse input that scrolls the page.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getpagesize
TBM_GETPAGESIZE = WindowMessage.WM_USER + 22,
///
/// 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.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
/// New line size.
/// Returns
/// Returns a 32-bit value that specifies the previous line size.
///
///
/// The default setting for the line size is 1.
///
/// The trackbar also sends a WM_HSCROLL or WM_VSCROLL message with the TB_LINEUP and TB_LINEDOWN notification
/// codes to its parent window when the user presses the arrow keys.
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-setlinesize
TBM_SETLINESIZE = WindowMessage.WM_USER + 23,
///
/// 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.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
/// Must be zero.
/// Returns
/// Returns a 32-bit value that specifies the line size for the trackbar.
///
///
/// The default setting for the line size is 1.
///
/// The trackbar also sends a WM_HSCROLL or WM_VSCROLL message with the TB_LINEUP and TB_LINEDOWN notification
/// codes to its parent window when the user presses the arrow keys.
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getlinesize
TBM_GETLINESIZE = WindowMessage.WM_USER + 24,
/// Retrieves the size and position of the bounding rectangle for the slider in a trackbar.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
///
/// Pointer to a RECT structure. The message fills this structure with the bounding rectangle of the trackbar's slider in
/// client coordinates of the trackbar's window.
///
/// Returns
/// No return value.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getthumbrect
TBM_GETTHUMBRECT = WindowMessage.WM_USER + 25,
///
/// 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.)
/// Parameters
/// wParam
/// Must be zero.
/// lParam
///
/// Pointer to a RECT structure. The message fills this structure with the channel's bounding rectangle, in client
/// coordinates of the trackbar's window.
///
/// Returns
/// No return value.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getchannelrect
TBM_GETCHANNELRECT = WindowMessage.WM_USER + 26,
///
/// Sets the length of the slider in a trackbar. This message is ignored if the trackbar does not have the TBS_FIXEDLENGTH style.
/// Parameters
/// wParam
/// Length, in pixels, of the slider.
/// lParam
/// Must be zero.
/// Returns
/// No return value.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-setthumblength
TBM_SETTHUMBLENGTH = WindowMessage.WM_USER + 27,
/// Retrieves the length of the slider in a trackbar.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
/// Must be zero.
/// Returns
/// Returns the length, in pixels, of the slider.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getthumblength
TBM_GETTHUMBLENGTH = WindowMessage.WM_USER + 28,
/// Assigns a tooltip control to a trackbar control.
/// Parameters
/// wParam
/// Handle to an existing tooltip control.
/// lParam
/// Must be zero.
/// Returns
/// The return value for this message is not used.
///
///
/// 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.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-settooltips
TBM_SETTOOLTIPS = WindowMessage.WM_USER + 29,
/// Retrieves the handle to the tooltip control assigned to the trackbar, if any.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
/// Must be zero.
/// Returns
///
/// Returns the handle to the tooltip control assigned to the trackbar, or NULL if tooltips are not in use. If the
/// trackbar control does not use the TBS_TOOLTIPS style, the return value is NULL.
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-gettooltips
TBM_GETTOOLTIPS = WindowMessage.WM_USER + 30,
///
/// Positions a tooltip control used by a trackbar control. Trackbar controls that use the TBS_TOOLTIPS style display tooltips.
/// Parameters
/// wParam
/// Value representing the location at which to display the tooltip control. This value can be one of the following:
///
///
/// Value
/// Meaning
///
/// -
/// 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.
///
///
/// lParam
/// Must be zero.
/// Returns
///
/// Returns a value that represents the tooltip control's previous location. The return value equals one of the possible values
/// for wParam.
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-settipside
TBM_SETTIPSIDE = WindowMessage.WM_USER + 31,
///
/// 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).
/// Parameters
/// wParam
/// Value specifying the location at which to display the buddy window. This value can be one of the following:
///
///
/// Value
/// Meaning
///
/// -
/// 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.
///
///
///
/// lParam
/// Handle to the window that will be set as the trackbar control's buddy.
/// Returns
/// Returns the handle to the window that was previously assigned to the control at that location.
///
///
/// 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.
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-setbuddy
TBM_SETBUDDY = WindowMessage.WM_USER + 32,
///
/// 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).
/// Parameters
/// wParam
/// Value indicating which buddy window handle will be retrieved, by relative location. This value can be one of the following:
///
///
/// Value
/// Meaning
///
/// -
/// 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.
///
///
///
/// lParam
/// Must be zero.
/// Returns
///
/// Returns the handle to the buddy window at the location specified by wParam, or NULL if no buddy window exists at that location.
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getbuddy
TBM_GETBUDDY = WindowMessage.WM_USER + 33,
/// Sets the current logical position of the slider in a trackbar.
/// Parameters
/// wParam
/// wParam is unused.
/// lParam
///
/// New logical position of the slider. Valid logical positions are the integer values in the trackbar's range of minimum to
/// maximum slider positions. If this value is outside the control's maximum and minimum range, the position is set to the
/// maximum or minimum value.
///
/// Returns
/// No return value.
///
///
/// Calling TBM_SETPOSNOTIFY will set the trackbar slider location like TBM_SETPOS would, but it will also cause
/// the trackbar to notify its parent of a move via a WM_HSCROLL or WM_VSCROLL message.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-setposnotify
TBM_SETPOSNOTIFY = WindowMessage.WM_USER + 34,
///
/// 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.
/// Parameters
/// wParam
///
/// Determines the character set that is used by the control. If this value is nonzero, the control will use Unicode characters.
/// If this value is zero, the control will use ANSI characters.
///
/// lParam
/// Must be zero.
/// Returns
/// Returns the previous Unicode format flag for the control.
///
/// See the remarks for CCM_SETUNICODEFORMAT for a discussion of this message.
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-setunicodeformat
TBM_SETUNICODEFORMAT = CommonControlMessage.CCM_SETUNICODEFORMAT,
/// Retrieves the Unicode character format flag for the control.
/// Parameters
/// wParam
/// Must be zero.
/// lParam
/// Must be zero.
/// Returns
///
/// Returns the Unicode format flag for the control. If this value is nonzero, the control is using Unicode characters. If this
/// value is zero, the control is using ANSI characters.
///
///
/// See the remarks for CCM_GETUNICODEFORMAT for a discussion of this message.
// https://docs.microsoft.com/en-us/windows/win32/controls/tbm-getunicodeformat
TBM_GETUNICODEFORMAT = CommonControlMessage.CCM_GETUNICODEFORMAT
}
/// Notification messages for trackbar.
[PInvokeData("Commctrl.h", MSDNShortId = "bb760172")]
public enum TrackBarNotification
{
///
///
/// Notifies that the thumb position on a trackbar is changing. This notification code is sent in the form of a WM_NOTIFY message.
///
///
/// TRBN_THUMBPOSCHANGING lpNMTrbThumbPosChanging = (NMTRBTHUMBPOSCHANGING*) lParam;
///
/// Parameters
/// lParam
///
/// Pointer to a NMTRBTHUMBPOSCHANGING structure. The caller is responsible for allocating this structure and setting its
/// members, including the members of the contained NMHDR structure.
///
/// Returns
/// Return TRUE to prevent the thumb from moving to the specified position.
///
/// Send this notification to clients that do not listen for WM_HSCROLL or WM_VSCROLL messages.
// https://docs.microsoft.com/en-us/windows/win32/controls/trbn-thumbposchanging
TRBN_THUMBPOSCHANGING = TRBN_FIRST
}
/// A notification code that indicates the user's interaction with the trackbar.
[PInvokeData("Commctrl.h", MSDNShortId = "bb760153")]
public enum TrackBarScrollNotification
{
/// The user pressed the LEFT ARROW (VK_LEFT) or UP ARROW (VK_UP) key.
TB_LINEUP = 0,
/// The user pressed the RIGHT ARROW (VK_RIGHT) or DOWN ARROW (VK_DOWN) key.
TB_LINEDOWN = 1,
/// The user clicked the channel above or to the left of the slider (VK_PRIOR).
TB_PAGEUP = 2,
/// The user clicked the channel below or to the right of the slider (VK_NEXT).
TB_PAGEDOWN = 3,
/// The trackbar received WM_LBUTTONUP following a TB_THUMBTRACK notification code.
TB_THUMBPOSITION = 4,
/// The user dragged the slider.
TB_THUMBTRACK = 5,
/// The user pressed the HOME key (VK_HOME).
TB_TOP = 6,
/// The user pressed the END key (VK_END).
TB_BOTTOM = 7,
/// The trackbar received WM_KEYUP, meaning that the user released a key that sent a relevant virtual key code.
TB_ENDTRACK = 8,
}
/// The styles used with trackbar controls.
[PInvokeData("Commctrl.h", MSDNShortId = "bb760147")]
public enum TrackBarStyle
{
/// The trackbar control has a tick mark for each increment in its range of values.
TBS_AUTOTICKS = 0x0001,
/// The trackbar control is oriented vertically.
TBS_VERT = 0x0002,
/// The trackbar control is oriented horizontally. This is the default orientation.
TBS_HORZ = 0x0000,
/// The trackbar control displays tick marks above the control. This style is valid only with TBS_HORZ.
TBS_TOP = 0x0004,
/// The trackbar control displays tick marks below the control. This style is valid only with TBS_HORZ.
TBS_BOTTOM = 0x0000,
/// The trackbar control displays tick marks to the left of the control. This style is valid only with TBS_VERT.
TBS_LEFT = 0x0004,
/// The trackbar control displays tick marks to the right of the control. This style is valid only with TBS_VERT.
TBS_RIGHT = 0x0000,
///
/// The trackbar control displays 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_BOTH = 0x0008,
/// The trackbar control does not display any tick marks.
TBS_NOTICKS = 0x0010,
///
/// The trackbar control displays 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_ENABLESELRANGE = 0x0020,
/// The trackbar control allows the size of the slider to be changed with the TBM_SETTHUMBLENGTH message.
TBS_FIXEDLENGTH = 0x0040,
/// The trackbar control does not display a slider.
TBS_NOTHUMB = 0x0080,
///
/// The trackbar control supports 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_TOOLTIPS = 0x0100,
///
/// This style bit is used for "reversed" trackbars, where a smaller number indicates "higher" and a larger number indicates
/// "lower." It has no effect on the control; it is simply a label that can be checked to determine whether a trackbar is normal
/// or reversed.
///
TBS_REVERSED = 0x0200,
///
/// By default, the trackbar control uses down equal to right and up equal to left. Use the TBS_DOWNISLEFT style to reverse the
/// default, making down equal left and up equal right.
///
TBS_DOWNISLEFT = 0x0400,
/// TrackBar should notify parent before repositioning the slider due to user action (enables snapping).
TBS_NOTIFYBEFOREMOVE = 0x0800,
/// Background is painted by the parent via the WM_PRINTCLIENT message.
TBS_TRANSPARENTBKGND = 0x1000
}
/// Value representing the location at which to display the tooltip control.
[PInvokeData("Commctrl.h", MSDNShortId = "bb760414")]
public enum TrackBarTipSide
{
/// The tooltip control will be positioned above the trackbar. This flag is for use with horizontal trackbars.
TBTS_TOP,
/// The tooltip control will be positioned to the left of the trackbar. This flag is for use with vertical trackbars.
TBTS_LEFT,
/// The tooltip control will be positioned below the trackbar. This flag is for use with horizontal trackbars.
TBTS_BOTTOM,
/// The tooltip control will be positioned to the right of the trackbar. This flag is for use with vertical trackbars.
TBTS_RIGHT,
}
/// Contains information about a trackbar change notification. This message is sent with the TRBN_THUMBPOSCHANGING notification.
[PInvokeData("Commctrl.h", MSDNShortId = "bb760153")]
[StructLayout(LayoutKind.Sequential)]
public struct NMTRBTHUMBPOSCHANGING
{
/// Position on trackbar.
public uint dwPos;
/// A NMHDR structure that describes the notification.
public NMHDR hdr;
///
/// Type of movement as one of the following values: TB_LINEUP, TB_LINEDOWN, TB_PAGEUP, TB_PAGEDOWN, TB_THUMBPOSITION,
/// TB_THUMBTRACK, TB_TOP, TB_BOTTOM, or TB_ENDTRACK.
///
public TrackBarScrollNotification nReason;
}
}
}