Class WinUser
public static class WinUser
- Inheritance
-
WinUser
- Inherited Members
Remarks
Fields
COLOR_3DDKSHADOW
public const int COLOR_3DDKSHADOW = 21
Field Value
COLOR_3DFACE
public const int COLOR_3DFACE = 15
Field Value
COLOR_3DHIGHLIGHT
public const int COLOR_3DHIGHLIGHT = 20
Field Value
COLOR_3DHILIGHT
public const int COLOR_3DHILIGHT = 20
Field Value
COLOR_3DLIGHT
public const int COLOR_3DLIGHT = 22
Field Value
COLOR_3DSHADOW
public const int COLOR_3DSHADOW = 16
Field Value
COLOR_ACTIVEBORDER
public const int COLOR_ACTIVEBORDER = 10
Field Value
COLOR_ACTIVECAPTION
public const int COLOR_ACTIVECAPTION = 2
Field Value
COLOR_APPWORKSPACE
public const int COLOR_APPWORKSPACE = 12
Field Value
COLOR_BACKGROUND
public const int COLOR_BACKGROUND = 1
Field Value
COLOR_BTNFACE
public const int COLOR_BTNFACE = 15
Field Value
COLOR_BTNHIGHLIGHT
public const int COLOR_BTNHIGHLIGHT = 20
Field Value
COLOR_BTNHILIGHT
public const int COLOR_BTNHILIGHT = 20
Field Value
COLOR_BTNSHADOW
public const int COLOR_BTNSHADOW = 16
Field Value
COLOR_BTNTEXT
public const int COLOR_BTNTEXT = 18
Field Value
COLOR_CAPTIONTEXT
public const int COLOR_CAPTIONTEXT = 9
Field Value
COLOR_DESKTOP
public const int COLOR_DESKTOP = 1
Field Value
COLOR_GRADIENTACTIVECAPTION
public const int COLOR_GRADIENTACTIVECAPTION = 27
Field Value
COLOR_GRADIENTINACTIVECAPTION
public const int COLOR_GRADIENTINACTIVECAPTION = 28
Field Value
COLOR_GRAYTEXT
public const int COLOR_GRAYTEXT = 17
Field Value
COLOR_HIGHLIGHT
public const int COLOR_HIGHLIGHT = 13
Field Value
COLOR_HIGHLIGHTTEXT
public const int COLOR_HIGHLIGHTTEXT = 14
Field Value
COLOR_HOTLIGHT
public const int COLOR_HOTLIGHT = 26
Field Value
COLOR_INACTIVEBORDER
public const int COLOR_INACTIVEBORDER = 11
Field Value
COLOR_INACTIVECAPTION
public const int COLOR_INACTIVECAPTION = 3
Field Value
COLOR_INACTIVECAPTIONTEXT
public const int COLOR_INACTIVECAPTIONTEXT = 19
Field Value
COLOR_INFOBK
public const int COLOR_INFOBK = 24
Field Value
COLOR_INFOTEXT
public const int COLOR_INFOTEXT = 23
Field Value
COLOR_MENU
public const int COLOR_MENU = 4
Field Value
COLOR_MENUBAR
public const int COLOR_MENUBAR = 30
Field Value
COLOR_MENUHILIGHT
public const int COLOR_MENUHILIGHT = 29
Field Value
COLOR_MENUTEXT
public const int COLOR_MENUTEXT = 7
Field Value
COLOR_SCROLLBAR
public const int COLOR_SCROLLBAR = 0
Field Value
COLOR_WINDOW
public const int COLOR_WINDOW = 5
Field Value
COLOR_WINDOWFRAME
public const int COLOR_WINDOWFRAME = 6
Field Value
COLOR_WINDOWTEXT
public const int COLOR_WINDOWTEXT = 8
Field Value
CTLCOLOR_BTN
public const int CTLCOLOR_BTN = 3
Field Value
CTLCOLOR_DLG
public const int CTLCOLOR_DLG = 4
Field Value
CTLCOLOR_EDIT
public const int CTLCOLOR_EDIT = 1
Field Value
CTLCOLOR_LISTBOX
public const int CTLCOLOR_LISTBOX = 2
Field Value
CTLCOLOR_MAX
public const int CTLCOLOR_MAX = 7
Field Value
CTLCOLOR_MSGBOX
public const int CTLCOLOR_MSGBOX = 0
Field Value
CTLCOLOR_SCROLLBAR
public const int CTLCOLOR_SCROLLBAR = 5
Field Value
CTLCOLOR_STATIC
public const int CTLCOLOR_STATIC = 6
Field Value
Methods
GetDC(IntPtr)
Retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen.
public static extern IntPtr GetDC(IntPtr hWnd)
Parameters
hWnd
IntPtrA handle to the window whose DC is to be retrieved. If this value is NULL., GetDC retrieves the DC for the entire screen.
Returns
- IntPtr
If the function succeeds, the return value is a handle to the DC for the specified window's client area. If the function fails, the return value is NULL.
GetStandardCursor(WindowsCursor)
Convenience method for loading a predefined Windows cursor.
public static IntPtr GetStandardCursor(WinUser.WindowsCursor cursorID)
Parameters
cursorID
WinUser.WindowsCursorThe WinUser.WindowsCursor to load.
Returns
GetStandardIcon(WindowsIcon)
Convenience method for loading a predefined Windows icon.
public static IntPtr GetStandardIcon(WinUser.WindowsIcon iconID)
Parameters
iconID
WinUser.WindowsIconThe WinUser.WindowsIconto load.
Returns
LoadImage(IntPtr, string, LoadImageType, int, int, LoadImageFlag)
Loads an icon, cursor, animated cursor, or bitmap.
public static extern IntPtr LoadImage(IntPtr hInst, string name, WinUser.LoadImageType type, int cx, int cy, WinUser.LoadImageFlag loadFlags)
Parameters
hInst
IntPtrA handle to the module of either a DLL or executable (.exe) that contains the image to be loaded. To load a predefined image or a standalone resource (icon, cursor, or bitmap file), set this parameter to NULL.
name
stringThe image to be loaded.
IfhInst
is not NULL andloadFlags
omits LR_LOADFROMFILE, the name specifies the image resource in thehInst
module.
IfhInst
is NULL andloadFlags
omits LR_LOADFROMFILE and includes LR_SHARED, the name specifies the predefined image to load.type
WinUser.LoadImageTypeThe type of image to be loaded.
cx
intWidth, in pixels, of the icon or cursor.
cy
intHeight, in pixels, of the icon or cursor.
loadFlags
WinUser.LoadImageFlagOne or more values of WinUser.LoadImageFlag.
Returns
Remarks
ReleaseDC(IntPtr, IntPtr)
Releases a device context (DC), freeing it for use by other applications.
public static extern int ReleaseDC(IntPtr hWnd, IntPtr hdc)
Parameters
hWnd
IntPtrA handle to the window whose DC is to be released.
hdc
IntPtrA handle to the DC to be released.
Returns
- int
If the DC was released, the return value is 1. If the DC was not released, the return value is zero.