using System;
namespace Vanara.PInvoke
{
public static partial class User32
{
/// Static Control Messages
// https://docs.microsoft.com/en-us/windows/win32/controls/bumper-static-control-reference-messages
[PInvokeData("winuser.h")]
public enum StaticMessage : uint
{
///
/// An application sends the STM_SETICON message to associate an icon with an icon control.
///
/// -
/// wParam
/// Handle to the icon to associate with the icon control.
///
/// -
/// lParam
/// This parameter is not used.
///
/// -
/// Returns
///
/// The return value is a handle to the icon previously associated with the icon control, or zero if an error occurs.
///
///
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/stm-seticon
STM_SETICON = 0x0170,
///
/// An application sends the STM_GETICON message to retrieve a handle to the icon associated with a static control that
/// has the SS_ICON style.
///
/// -
/// wParam
/// Not used; must be zero.
///
/// -
/// lParam
/// Not used; must be zero.
///
/// -
/// Returns
///
/// The return value is a handle to the icon, or NULL if either the static control has no associated icon or if an error occurred.
///
///
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/stm-geticon
STM_GETICON = 0x0171,
///
/// An application sends an STM_SETIMAGE message to associate a new image with a static control.
///
/// -
/// wParam
///
/// Specifies the type of image to associate with the static control. This parameter can be one of the following values:
///
///
/// Value
/// Meaning
///
/// -
/// IMAGE_BITMAP
/// Bitmap.
///
/// -
/// IMAGE_CURSOR
/// Cursor.
///
/// -
/// IMAGE_ENHMETAFILE
/// Enhanced metafile.
///
/// -
/// IMAGE_ICON
/// Icon.
///
///
///
///
/// -
/// lParam
/// Handle to the image to associate with the static control.
///
/// -
/// Returns
///
/// The return value is a handle to the image previously associated with the static control, if any; otherwise, it is NULL.
///
///
///
///
///
///
/// To associate an image with a static control, the control must have the proper style. The following table shows the style
/// needed for each image type.
///
///
///
/// Image type
/// Static control style
///
/// -
/// IMAGE_BITMAP
/// SS_BITMAP
///
/// -
/// IMAGE_CURSOR
/// SS_ICON
///
/// -
/// IMAGE_ENHMETAFILE
/// SS_ENHMETAFILE
///
/// -
/// IMAGE_ICON
/// SS_ICON
///
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/stm-setimage
STM_SETIMAGE = 0x0172,
///
/// An application sends an STM_GETIMAGE message to retrieve a handle to the image (icon or bitmap) associated with a
/// static control.
///
/// -
/// wParam
/// Specifies the type of image to retrieve. This parameter can be one of the following values:
///
///
/// Value
/// Meaning
///
/// -
/// IMAGE_BITMAP
/// Bitmap.
///
/// -
/// IMAGE_CURSOR
/// Cursor.
///
/// -
/// IMAGE_ENHMETAFILE
/// Enhanced metafile.
///
/// -
/// IMAGE_ICON
/// Icon.
///
///
///
///
/// -
/// lParam
/// This parameter is not used.
///
/// -
/// Returns
/// The return value is a handle to the image, if any; otherwise, it is NULL.
///
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/stm-getimage
STM_GETIMAGE = 0x0173,
}
/// Static Control Notifications
// https://docs.microsoft.com/en-us/windows/win32/controls/bumper-static-control-reference-notifications
[PInvokeData("winuser.h")]
public enum StaticNotification : uint
{
///
///
/// The STN_CLICKED notification code is sent when the user clicks a static control that has the SS_NOTIFY style. The
/// parent window of the control receives this notification code through the WM_COMMAND message.
///
/// STN_CLICKED WPARAM wParam; LPARAM lParam;
///
/// -
/// wParam
///
/// The LOWORD contains the identifier of the static control. The HIWORD specifies the notification code.
///
///
/// -
/// lParam
/// Handle to the static control.
///
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/stn-clicked
STN_CLICKED = 0,
///
///
/// The STN_DBLCLK notification code is sent when the user double-clicks a static control that has the SS_NOTIFY style.
/// The parent window of the control receives this notification code through the WM_COMMAND message.
///
/// STN_DBLCLK WPARAM wParam; LPARAM lParam;
///
/// -
/// wParam
///
/// The LOWORD contains the identifier of the static control. The HIWORD specifies the notification code.
///
///
/// -
/// lParam
/// Handle to the static control.
///
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/stn-dblclk
STN_DBLCLK = 1,
///
///
/// The STN_ENABLE notification code is sent when a static control is enabled. The static control must have the SS_NOTIFY
/// style to receive this notification code. The parent window of the control receives this notification code through the
/// WM_COMMAND message.
///
///
/// STN_ENABLE WPARAM wParam; LPARAM lParam;
///
///
/// -
/// wParam
///
/// The LOWORD contains the identifier of the static control. The HIWORD specifies the notification code.
///
///
/// -
/// lParam
/// Handle to the static control.
///
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/stn-enable
STN_ENABLE = 2,
///
///
/// The STN_DISABLE notification code is sent when a static control is disabled. The static control must have the
/// SS_NOTIFY style to receive this notification code. The parent window of the control receives this notification code
/// through the WM_COMMAND message.
///
///
/// STN_DISABLE WPARAM wParam; LPARAM lParam;
///
///
/// -
/// wParam
///
/// The LOWORD contains the identifier of the static control. The HIWORD specifies the notification code.
///
///
/// -
/// lParam
/// Handle to the static control.
///
///
///
// https://docs.microsoft.com/en-us/windows/win32/controls/stn-disable
STN_DISABLE = 3,
}
///
/// To create a static control using the CreateWindow or CreateWindowEx function, specify the STATIC class,
/// appropriate window style constants, and a combination of the following static control styles.
///
///
/// To use a style which truncates words or strings with an ellipsis for multiline text, DrawThemeText or DrawText can
/// be used on a owner-draw control with formatting flags DT_WORDBREAK and DT_ENDELLIPSIS set.
///
// https://docs.microsoft.com/en-us/windows/win32/controls/static-control-styles
[PInvokeData("winuser.h")]
[Flags]
public enum StaticStyle : uint
{
///
/// A bitmap is to be displayed in the static control. The text is the name of a bitmap (not a filename) defined elsewhere in
/// the resource file. The style ignores the nWidth and nHeight parameters; the control automatically sizes itself to
/// accommodate the bitmap.
///
SS_BITMAP = 0x0000000E,
/// A box with a frame drawn in the same color as the window frames. This color is black in the default color scheme.
SS_BLACKFRAME = 0x00000007,
/// A rectangle filled with the current window frame color. This color is black in the default color scheme.
SS_BLACKRECT = 0x00000004,
///
/// A simple rectangle and centers the text in the rectangle. The text is formatted before it is displayed. Words that extend
/// past the end of a line are automatically wrapped to the beginning of the next centered line. Words that are longer than the
/// width of the control are truncated.
///
SS_CENTER = 0x00000001,
///
/// A bitmap is centered in the static control that contains it. The control is not resized, so that a bitmap too large for the
/// control will be clipped. If the static control contains a single line of text, the text is centered vertically in the client
/// area of the control.
///
SS_CENTERIMAGE = 0x00000200,
///
/// The static control duplicates the text-displaying characteristics of a multiline edit control. Specifically, the average
/// character width is calculated in the same manner as with an edit control, and the function does not display a partially
/// visible last line.
///
SS_EDITCONTROL = 0x00002000,
///
/// If the end of a string does not fit in the rectangle, it is truncated and ellipses are added. If a word that is not at the
/// end of the string goes beyond the limits of the rectangle, it is truncated without ellipses. Using this style will force the
/// control s text to be on one line with no word wrap. Compare with SS_PATHELLIPSIS and SS_WORDELLIPSIS.
///
SS_ENDELLIPSIS = 0x00004000,
///
/// An enhanced metafile is to be displayed in the static control. The text is the name of a metafile. An enhanced metafile
/// static control has a fixed size; the metafile is scaled to fit the static control's client area.
///
SS_ENHMETAFILE = 0x0000000F,
///
/// Draws the frame of the static control using the EDGE_ETCHED edge style. For more information, see the DrawEdge function.
///
SS_ETCHEDFRAME = 0x00000012,
///
/// Draws the top and bottom edges of the static control using the EDGE_ETCHED edge style. For more information, see the
/// DrawEdge function.
///
SS_ETCHEDHORZ = 0x00000010,
///
/// Draws the left and right edges of the static control using the EDGE_ETCHED edge style. For more information, see the
/// DrawEdge function.
///
SS_ETCHEDVERT = 0x00000011,
///
/// A box with a frame drawn with the same color as the screen background (desktop). This color is gray in the default color scheme.
///
SS_GRAYFRAME = 0x00000005,
/// A rectangle filled with the current screen background color. This color is gray in the default color scheme.
SS_GRAYRECT = 0x00000008,
///
/// An icon to be displayed in the dialog box. If the control is created as part of a dialog box, the text is the name of an
/// icon (not a filename) defined elsewhere in the resource file. If the control is created via CreateWindow or a related
/// function, the text is the name of an icon (not a filename) defined in the resource file associated with the module specified
/// by the hInstance parameter to CreateWindow.
/// The icon can be an animated cursor.
///
/// The style ignores the CreateWindow parameters nWidth and nHeight; the control automatically sizes itself to accommodate the
/// icon. As it uses the LoadIcon function, the SS_ICON style can load only icons of dimensions SM_CXICON and SM_CYICON. This
/// restriction can be bypassed by using the SS_REALSIZEIMAGE style in addition to SS_ICON.
///
///
/// If an icon cannot be loaded through LoadIcon, an attempt is made to load the specified resource as a cursor using
/// LoadCursor. If that too fails, an attempt is made to load from the device driver using LoadImage.
///
///
SS_ICON = 0x00000003,
///
/// A simple rectangle and left-aligns the text in the rectangle. The text is formatted before it is displayed. Words that
/// extend past the end of a line are automatically wrapped to the beginning of the next left-aligned line. Words that are
/// longer than the width of the control are truncated.
///
SS_LEFT = 0x00000000,
///
/// A simple rectangle and left-aligns the text in the rectangle. Tabs are expanded, but words are not wrapped. Text that
/// extends past the end of a line is clipped.
///
SS_LEFTNOWORDWRAP = 0x0000000C,
/// Prevents interpretation of any ampersand (&) characters in the control's text as accelerator prefix characters.
/// These are displayed with the ampersand removed and the next character in the string underlined. This static control style
/// may be included with any of the defined static controls. You can combine SS_NOPREFIX with other styles. This can be useful
/// when filenames or other strings that may contain an ampersand (&) must be displayed in a static control in a dialog box.
SS_NOPREFIX = 0x00000080,
///
/// Sends the parent window STN_CLICKED, STN_DBLCLK, STN_DISABLE, and STN_ENABLE notification codes when the user clicks or
/// double-clicks the control.
///
SS_NOTIFY = 0x00000100,
///
/// The owner of the static control is responsible for drawing the control. The owner window receives a WM_DRAWITEM message
/// whenever the control needs to be drawn.
///
SS_OWNERDRAW = 0x0000000D,
///
/// Replaces characters in the middle of the string with ellipses so that the result fits in the specified rectangle. If the
/// string contains backslash () characters, SS_PATHELLIPSIS preserves as much as possible of the text after the last backslash.
/// Using this style will force the control s text to be on one line with no word wrap. Compare with SS_ENDELLIPSIS and SS_WORDELLIPSIS.
///
SS_PATHELLIPSIS = 0x00008000,
///
/// Adjusts the bitmap to fit the size of the static control. For example, changing the locale can change the system font, and
/// thus controls might be resized. If a static control had a bitmap, the bitmap would no longer fit the control. This style bit
/// dictates automatic redimensioning of bitmaps to fit their controls.
///
/// If SS_CENTERIMAGE is specified, the bitmap or icon is centered (and clipped if needed). If SS_CENTERIMAGE is not specified,
/// the bitmap or icon is stretched or shrunk.
///
/// Note that the redimensioning in the two axes are independent, and the result may have a changed aspect ratio.
/// Compare with SS_REALSIZEIMAGE.
///
SS_REALSIZECONTROL = 0x00000040,
///
/// Specifies that the actual resource width is used and the icon is loaded using LoadImage. SS_REALSIZEIMAGE is always used in
/// conjunction with SS_ICON.
///
/// SS_REALSIZEIMAGE uses LoadImage, overriding the process normally followed under SS_ICON. It does not load cursors; if
/// LoadImage fails, no further attempts to load are made. It uses the actual resource width. The static control is resized
/// accordingly, but the icon remains aligned to the originally specified left and top edges of the control.
///
///
/// Note that if SS_CENTERIMAGE is also specified, the icon is centered within the control's space, which was specified using
/// the CreateWindow parameters nWidth and nHeight.
///
/// Compare with SS_REALSIZECONTROL.
///
SS_REALSIZEIMAGE = 0x00000800,
///
/// A simple rectangle and right-aligns the text in the rectangle. The text is formatted before it is displayed. Words that
/// extend past the end of a line are automatically wrapped to the beginning of the next right-aligned line. Words that are
/// longer than the width of the control are truncated.
///
SS_RIGHT = 0x00000002,
///
/// The lower right corner of a static control with the SS_BITMAP or SS_ICON style is to remain fixed when the control is
/// resized. Only the top and left sides are adjusted to accommodate a new bitmap or icon.
///
SS_RIGHTJUST = 0x00000400,
///
/// A simple rectangle and displays a single line of left-aligned text in the rectangle. The text line cannot be shortened or
/// altered in any way. Also, if the control is disabled, the control does not gray its text.
///
SS_SIMPLE = 0x0000000B,
/// Draws a half-sunken border around a static control.
SS_SUNKEN = 0x00001000,
///
/// A composite style bit that results from using the OR operator on SS_* style bits. Can be used to mask out valid SS_* bits
/// from a given bitmask. Note that this is out of date and does not correctly include all valid styles. Thus, you should not
/// use this style.
///
SS_TYPEMASK = 0x0000001F,
///
/// A box with a frame drawn with the same color as the window background. This color is white in the default color scheme.
///
SS_WHITEFRAME = 0x00000009,
/// A rectangle filled with the current window background color. This color is white in the default color scheme.
SS_WHITERECT = 0x00000006,
///
/// Truncates any word that does not fit in the rectangle and adds ellipses. Using this style will force the control s text to
/// be on one line with no word wrap.
/// Compare with SS_ENDELLIPSIS and SS_PATHELLIPSIS.
///
SS_WORDELLIPSIS = 0x0000C000,
}
}
}