Table of Contents

Class WinUser

Namespace
Npp.DotNet.Plugin.Winforms
Assembly
Npp.DotNet.Plugin.dll
public static class WinUser
Inheritance
WinUser
Inherited Members

Remarks

Fields

COLOR_3DDKSHADOW

public const int COLOR_3DDKSHADOW = 21

Field Value

int

COLOR_3DFACE

public const int COLOR_3DFACE = 15

Field Value

int

COLOR_3DHIGHLIGHT

public const int COLOR_3DHIGHLIGHT = 20

Field Value

int

COLOR_3DHILIGHT

public const int COLOR_3DHILIGHT = 20

Field Value

int

COLOR_3DLIGHT

public const int COLOR_3DLIGHT = 22

Field Value

int

COLOR_3DSHADOW

public const int COLOR_3DSHADOW = 16

Field Value

int

COLOR_ACTIVEBORDER

public const int COLOR_ACTIVEBORDER = 10

Field Value

int

COLOR_ACTIVECAPTION

public const int COLOR_ACTIVECAPTION = 2

Field Value

int

COLOR_APPWORKSPACE

public const int COLOR_APPWORKSPACE = 12

Field Value

int

COLOR_BACKGROUND

public const int COLOR_BACKGROUND = 1

Field Value

int

COLOR_BTNFACE

public const int COLOR_BTNFACE = 15

Field Value

int

COLOR_BTNHIGHLIGHT

public const int COLOR_BTNHIGHLIGHT = 20

Field Value

int

COLOR_BTNHILIGHT

public const int COLOR_BTNHILIGHT = 20

Field Value

int

COLOR_BTNSHADOW

public const int COLOR_BTNSHADOW = 16

Field Value

int

COLOR_BTNTEXT

public const int COLOR_BTNTEXT = 18

Field Value

int

COLOR_CAPTIONTEXT

public const int COLOR_CAPTIONTEXT = 9

Field Value

int

COLOR_DESKTOP

public const int COLOR_DESKTOP = 1

Field Value

int

COLOR_GRADIENTACTIVECAPTION

public const int COLOR_GRADIENTACTIVECAPTION = 27

Field Value

int

COLOR_GRADIENTINACTIVECAPTION

public const int COLOR_GRADIENTINACTIVECAPTION = 28

Field Value

int

COLOR_GRAYTEXT

public const int COLOR_GRAYTEXT = 17

Field Value

int

COLOR_HIGHLIGHT

public const int COLOR_HIGHLIGHT = 13

Field Value

int

COLOR_HIGHLIGHTTEXT

public const int COLOR_HIGHLIGHTTEXT = 14

Field Value

int

COLOR_HOTLIGHT

public const int COLOR_HOTLIGHT = 26

Field Value

int

COLOR_INACTIVEBORDER

public const int COLOR_INACTIVEBORDER = 11

Field Value

int

COLOR_INACTIVECAPTION

public const int COLOR_INACTIVECAPTION = 3

Field Value

int

COLOR_INACTIVECAPTIONTEXT

public const int COLOR_INACTIVECAPTIONTEXT = 19

Field Value

int

COLOR_INFOBK

public const int COLOR_INFOBK = 24

Field Value

int

COLOR_INFOTEXT

public const int COLOR_INFOTEXT = 23

Field Value

int

COLOR_MENU

public const int COLOR_MENU = 4

Field Value

int

COLOR_MENUBAR

public const int COLOR_MENUBAR = 30

Field Value

int

COLOR_MENUHILIGHT

public const int COLOR_MENUHILIGHT = 29

Field Value

int

COLOR_MENUTEXT

public const int COLOR_MENUTEXT = 7

Field Value

int

COLOR_SCROLLBAR

public const int COLOR_SCROLLBAR = 0

Field Value

int

COLOR_WINDOW

public const int COLOR_WINDOW = 5

Field Value

int

COLOR_WINDOWFRAME

public const int COLOR_WINDOWFRAME = 6

Field Value

int

COLOR_WINDOWTEXT

public const int COLOR_WINDOWTEXT = 8

Field Value

int

CTLCOLOR_BTN

public const int CTLCOLOR_BTN = 3

Field Value

int

CTLCOLOR_DLG

public const int CTLCOLOR_DLG = 4

Field Value

int

CTLCOLOR_EDIT

public const int CTLCOLOR_EDIT = 1

Field Value

int

CTLCOLOR_LISTBOX

public const int CTLCOLOR_LISTBOX = 2

Field Value

int

CTLCOLOR_MAX

public const int CTLCOLOR_MAX = 7

Field Value

int

CTLCOLOR_MSGBOX

public const int CTLCOLOR_MSGBOX = 0

Field Value

int

CTLCOLOR_SCROLLBAR

public const int CTLCOLOR_SCROLLBAR = 5

Field Value

int

CTLCOLOR_STATIC

public const int CTLCOLOR_STATIC = 6

Field Value

int

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 IntPtr

A 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.WindowsCursor

The WinUser.WindowsCursor to load.

Returns

IntPtr

GetStandardIcon(WindowsIcon)

Convenience method for loading a predefined Windows icon.

public static IntPtr GetStandardIcon(WinUser.WindowsIcon iconID)

Parameters

iconID WinUser.WindowsIcon

The WinUser.WindowsIconto load.

Returns

IntPtr

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 IntPtr

A 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 string

The image to be loaded.

If hInst is not NULL and loadFlags omits LR_LOADFROMFILE, the name specifies the image resource in the hInst module.

If hInst is NULL and loadFlags omits LR_LOADFROMFILE and includes LR_SHARED, the name specifies the predefined image to load.

type WinUser.LoadImageType

The type of image to be loaded.

cx int

Width, in pixels, of the icon or cursor.

cy int

Height, in pixels, of the icon or cursor.

loadFlags WinUser.LoadImageFlag

One or more values of WinUser.LoadImageFlag.

Returns

IntPtr

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 IntPtr

A handle to the window whose DC is to be released.

hdc IntPtr

A 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.

Remarks