Class Win32
public class Win32
- Inheritance
-
Win32
- Inherited Members
Fields
FALSE
public static readonly NativeBool FALSE
Field Value
GWLP_HINSTANCE
public const int GWLP_HINSTANCE = -6
Field Value
GWLP_HWNDPARENT
public const int GWLP_HWNDPARENT = -8
Field Value
GWLP_ID
public const int GWLP_ID = -12
Field Value
GWLP_USERDATA
public const int GWLP_USERDATA = -21
Field Value
GWLP_WNDPROC
public const int GWLP_WNDPROC = -4
Field Value
GWL_EXSTYLE
public const int GWL_EXSTYLE = -20
Field Value
GWL_STYLE
public const int GWL_STYLE = -16
Field Value
MAX_PATH
public const int MAX_PATH = 260
Field Value
MFS_CHECKED
Checks the menu item. For more information about selected menu items, see the hbmpChecked member.
public const uint MFS_CHECKED = 8
Field Value
MFS_DEFAULT
Specifies that the menu item is the default. A menu can contain only one default menu item, which is displayed in bold.
public const uint MFS_DEFAULT = 4096
Field Value
MFS_DISABLED
Disables the menu item and grays it so that it cannot be selected. This is equivalent to MFS_GRAYED.
public const uint MFS_DISABLED = 3
Field Value
MFS_ENABLED
Enables the menu item so that it can be selected. This is the default state.
public const uint MFS_ENABLED = 0
Field Value
MFS_GRAYED
Disables the menu item and grays it so that it cannot be selected. This is equivalent to MFS_DISABLED.
public const uint MFS_GRAYED = 3
Field Value
MFS_HILITE
Highlights the menu item.
public const uint MFS_HILITE = 128
Field Value
MFS_UNCHECKED
Unchecks the menu item. For more information about clear menu items, see the hbmpChecked member.
public const uint MFS_UNCHECKED = 0
Field Value
MFS_UNHILITE
Removes the highlight from the menu item. This is the default state.
public const uint MFS_UNHILITE = 0
Field Value
MFT_BITMAP
Displays the menu item using a bitmap. The low-order word of the dwTypeData member is the bitmap handle, and the cch member is ignored.
public const uint MFT_BITMAP = 4
Field Value
MFT_MENUBARBREAK
Places the menu item on a new line (for a menu bar) or in a new column (for a drop-down menu, submenu, or shortcut menu). For a drop-down menu, submenu, or shortcut menu, a vertical line separates the new column from the old.
public const uint MFT_MENUBARBREAK = 32
Field Value
MFT_MENUBREAK
Places the menu item on a new line (for a menu bar) or in a new column (for a drop-down menu, submenu, or shortcut menu). For a drop-down menu, submenu, or shortcut menu, the columns are not separated by a vertical line.
public const uint MFT_MENUBREAK = 64
Field Value
MFT_OWNERDRAW
Assigns responsibility for drawing the menu item to the window that owns the menu. The window receives a WM_MEASUREITEM message before the menu is displayed for the first time, and a WM_DRAWITEM message whenever the appearance of the menu item must be updated. If this value is specified, the dwTypeData member contains an application-defined value.
public const uint MFT_OWNERDRAW = 256
Field Value
MFT_RADIOCHECK
Displays selected menu items using a radio-button mark instead of a check mark if the hbmpChecked member is Zero.
public const uint MFT_RADIOCHECK = 512
Field Value
MFT_RIGHTJUSTIFY
Right-justifies the menu item and any subsequent items. This value is valid only if the menu item is in a menu bar.
public const uint MFT_RIGHTJUSTIFY = 16384
Field Value
MFT_RIGHTORDER
Specifies that menus cascade right-to-left (the default is left-to-right). This is used to support right-to-left languages, such as Arabic and Hebrew.
public const uint MFT_RIGHTORDER = 8192
Field Value
MFT_SEPARATOR
Specifies that the menu item is a separator. A menu item separator appears as a horizontal dividing line. The dwTypeData and cch members are ignored. This value is valid only in a drop-down menu, submenu, or shortcut menu.
public const uint MFT_SEPARATOR = 2048
Field Value
MFT_STRING
Displays the menu item using a text string. The dwTypeData member is the pointer to a null-terminated string, and the cch member is the length of the string.
public const uint MFT_STRING = 0
Field Value
MF_BITMAP
Uses a bitmap as the menu item. The lpNewItem parameter contains a handle to the bitmap.
public const uint MF_BITMAP = 4
Field Value
MF_BYCOMMAND
Indicates that the uPosition
parameter gives the identifier of the menu item.
public const uint MF_BYCOMMAND = 0
Field Value
MF_BYPOSITION
Indicates that the uPosition
parameter gives the zero-based relative position of the menu item.
public const uint MF_BYPOSITION = 1024
Field Value
MF_CHECKED
Places a check mark next to the item. If your application provides check-mark bitmaps (see the SetMenuItemBitmaps function), this flag displays a selected bitmap next to the menu item.
public const uint MF_CHECKED = 8
Field Value
MF_DISABLED
Disables the menu item so that it cannot be selected, but this flag does not gray it.
public const uint MF_DISABLED = 2
Field Value
MF_ENABLED
Enables the menu item so that it can be selected and restores it from its grayed state.
public const uint MF_ENABLED = 0
Field Value
MF_GRAYED
Disables the menu item and grays it so that it cannot be selected.
public const uint MF_GRAYED = 1
Field Value
MF_MENUBARBREAK
Functions the same as the MF_MENUBREAK flag for a menu bar. For a drop-down menu, submenu, or shortcut menu, the new column is separated from the old column by a vertical line.
public const uint MF_MENUBARBREAK = 32
Field Value
MF_MENUBREAK
Places the item on a new line (for menu bars) or in a new column (for a drop-down menu, submenu, or shortcut menu) without separating columns.
public const uint MF_MENUBREAK = 64
Field Value
MF_OWNERDRAW
Specifies that the item is an owner-drawn item. Before the menu is displayed for the first time, the window that owns the menu receives a WM_MEASUREITEM message to retrieve the width and height of the menu item. The WM_DRAWITEM message is then sent to the window procedure of the owner window whenever the appearance of the menu item must be updated.
public const uint MF_OWNERDRAW = 256
Field Value
MF_POPUP
Specifies that the menu item opens a drop-down menu or submenu. The uIDNewItem
parameter specifies a handle to the drop-down menu or submenu. This flag is used to add a menu name to a
menu bar or a menu item that opens a submenu to a drop-down menu, submenu, or shortcut menu.
public const uint MF_POPUP = 16
Field Value
MF_SEPARATOR
Draws a horizontal dividing line. This flag is used only in a drop-down menu, submenu, or shortcut menu. The line cannot be grayed, disabled, or highlighted. The lpNewItem
and
uIDNewItem
parameters are ignored.
public const uint MF_SEPARATOR = 2048
Field Value
MF_STRING
Specifies that the menu item is a text string; the lpNewItem
parameter is a pointer to the string.
public const uint MF_STRING = 0
Field Value
MF_UNCHECKED
Does not place a check mark next to the item (the default). If your application supplies check-mark bitmaps (see the SetMenuItemBitmaps function), this flag displays a clear bitmap next to the menu item.
public const uint MF_UNCHECKED = 0
Field Value
MIIM_BITMAP
Retrieves or sets the hbmpItem member.
public const uint MIIM_BITMAP = 128
Field Value
MIIM_CHECKMARKS
Retrieves or sets the hbmpChecked and hbmpUnchecked members.
public const uint MIIM_CHECKMARKS = 8
Field Value
MIIM_DATA
Retrieves or sets the dwItemData member.
public const uint MIIM_DATA = 32
Field Value
MIIM_FTYPE
Retrieves or sets the fType member.
public const uint MIIM_FTYPE = 256
Field Value
MIIM_ID
Retrieves or sets the wID member.
public const uint MIIM_ID = 2
Field Value
MIIM_STATE
Retrieves or sets the fState member.
public const uint MIIM_STATE = 1
Field Value
MIIM_STRING
Retrieves or sets the dwTypeData member.
public const uint MIIM_STRING = 64
Field Value
MIIM_SUBMENU
Retrieves or sets the hSubMenu member.
public const uint MIIM_SUBMENU = 4
Field Value
MIIM_TYPE
Retrieves or sets the fType and dwTypeData members.
public const uint MIIM_TYPE = 16
Field Value
NULL
public static readonly IntPtr NULL
Field Value
SIZE_MAXHIDE
public const int SIZE_MAXHIDE = 4
Field Value
SIZE_MAXIMIZED
public const int SIZE_MAXIMIZED = 2
Field Value
SIZE_MAXSHOW
public const int SIZE_MAXSHOW = 3
Field Value
SIZE_MINIMIZED
public const int SIZE_MINIMIZED = 1
Field Value
SIZE_RESTORED
public const int SIZE_RESTORED = 0
Field Value
TRUE
public static readonly NativeBool TRUE
Field Value
WM_ACTIVATE
public const uint WM_ACTIVATE = 6
Field Value
WM_ACTIVATEAPP
public const uint WM_ACTIVATEAPP = 28
Field Value
WM_CLOSE
public const uint WM_CLOSE = 16
Field Value
WM_CREATE
public const uint WM_CREATE = 1
Field Value
WM_CTLCOLOR
public const uint WM_CTLCOLOR = 25
Field Value
WM_DESTROY
public const uint WM_DESTROY = 2
Field Value
WM_DEVMODECHANGE
public const uint WM_DEVMODECHANGE = 27
Field Value
WM_DRAWITEM
Sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed. See https://learn.microsoft.com/windows/win32/controls/wm-drawitem
public const uint WM_DRAWITEM = 43
Field Value
WM_ENABLE
public const uint WM_ENABLE = 10
Field Value
WM_ENDSESSION
public const uint WM_ENDSESSION = 22
Field Value
WM_ERASEBKGND
public const uint WM_ERASEBKGND = 20
Field Value
WM_GETTEXT
public const uint WM_GETTEXT = 13
Field Value
WM_GETTEXTLENGTH
public const uint WM_GETTEXTLENGTH = 14
Field Value
WM_HELP
public const int WM_HELP = 83
Field Value
WM_KILLFOCUS
public const uint WM_KILLFOCUS = 8
Field Value
WM_MEASUREITEM
Sent to the owner window of a combo box, list box, list-view control, or menu item when the control or menu is created. See https://learn.microsoft.com/windows/win32/controls/wm-measureitem
public const uint WM_MEASUREITEM = 44
Field Value
WM_MOVE
public const uint WM_MOVE = 3
Field Value
WM_NOTIFY
public const int WM_NOTIFY = 78
Field Value
WM_NULL
public const uint WM_NULL = 0
Field Value
WM_PAINT
public const uint WM_PAINT = 15
Field Value
WM_QUERYENDSESSION
public const uint WM_QUERYENDSESSION = 17
Field Value
WM_QUERYOPEN
public const uint WM_QUERYOPEN = 19
Field Value
WM_QUIT
public const uint WM_QUIT = 18
Field Value
WM_SETFOCUS
public const uint WM_SETFOCUS = 7
Field Value
WM_SETREDRAW
public const uint WM_SETREDRAW = 11
Field Value
WM_SETTEXT
public const uint WM_SETTEXT = 12
Field Value
WM_SHOWWINDOW
public const uint WM_SHOWWINDOW = 24
Field Value
WM_SIZE
public const uint WM_SIZE = 5
Field Value
WM_SYSCOLORCHANGE
public const uint WM_SYSCOLORCHANGE = 21
Field Value
WM_WININICHANGE
public const uint WM_WININICHANGE = 26
Field Value
WS_EX_ACCEPTFILES
public const long WS_EX_ACCEPTFILES = 16
Field Value
WS_EX_APPWINDOW
public const long WS_EX_APPWINDOW = 262144
Field Value
WS_EX_CLIENTEDGE
public const long WS_EX_CLIENTEDGE = 512
Field Value
WS_EX_COMPOSITED
public const long WS_EX_COMPOSITED = 33554432
Field Value
WS_EX_CONTEXTHELP
public const long WS_EX_CONTEXTHELP = 1024
Field Value
WS_EX_CONTROLPARENT
public const long WS_EX_CONTROLPARENT = 65536
Field Value
WS_EX_DLGMODALFRAME
public const long WS_EX_DLGMODALFRAME = 1
Field Value
WS_EX_LAYERED
public const long WS_EX_LAYERED = 524288
Field Value
WS_EX_LAYOUTRTL
public const long WS_EX_LAYOUTRTL = 4194304
Field Value
WS_EX_LEFT
public const long WS_EX_LEFT = 0
Field Value
WS_EX_LEFTSCROLLBAR
public const long WS_EX_LEFTSCROLLBAR = 16384
Field Value
WS_EX_LTRREADING
public const long WS_EX_LTRREADING = 0
Field Value
WS_EX_MDICHILD
public const long WS_EX_MDICHILD = 64
Field Value
WS_EX_NOACTIVATE
public const long WS_EX_NOACTIVATE = 134217728
Field Value
WS_EX_NOINHERITLAYOUT
public const long WS_EX_NOINHERITLAYOUT = 1048576
Field Value
WS_EX_NOPARENTNOTIFY
public const long WS_EX_NOPARENTNOTIFY = 4
Field Value
WS_EX_NOREDIRECTIONBITMAP
public const long WS_EX_NOREDIRECTIONBITMAP = 2097152
Field Value
WS_EX_OVERLAPPEDWINDOW
public const long WS_EX_OVERLAPPEDWINDOW = 768
Field Value
WS_EX_PALETTEWINDOW
public const long WS_EX_PALETTEWINDOW = 392
Field Value
WS_EX_RIGHT
public const long WS_EX_RIGHT = 4096
Field Value
WS_EX_RIGHTSCROLLBAR
public const long WS_EX_RIGHTSCROLLBAR = 0
Field Value
WS_EX_RTLREADING
public const long WS_EX_RTLREADING = 8192
Field Value
WS_EX_STATICEDGE
public const long WS_EX_STATICEDGE = 131072
Field Value
WS_EX_TOOLWINDOW
public const long WS_EX_TOOLWINDOW = 128
Field Value
WS_EX_TOPMOST
public const long WS_EX_TOPMOST = 8
Field Value
WS_EX_TRANSPARENT
public const long WS_EX_TRANSPARENT = 32
Field Value
WS_EX_WINDOWEDGE
public const long WS_EX_WINDOWEDGE = 256
Field Value
Methods
CheckMenuItem(IntPtr, int, uint)
public static extern uint CheckMenuItem(IntPtr hmenu, int uIDCheckItem, uint uCheck)
Parameters
Returns
DefWindowProc(IntPtr, uint, UIntPtr, IntPtr)
public static extern IntPtr DefWindowProc(IntPtr hWnd, uint Msg, UIntPtr wParam, IntPtr lParam)
Parameters
Returns
EnableMenuItem(IntPtr, int, uint)
public static extern bool EnableMenuItem(IntPtr hMenu, int uIDEnableItem, uint uEnable)
Parameters
Returns
GetACP()
public static extern uint GetACP()
Returns
GetMenu(IntPtr)
public static extern IntPtr GetMenu(IntPtr hWnd)
Parameters
hWnd
IntPtr
Returns
GetMenuItemInfo(IntPtr, int, bool, ref MenuItemInfo)
public static extern bool GetMenuItemInfo(IntPtr hmenu, int item, bool fByPosition, ref Win32.MenuItemInfo lpmii)
Parameters
hmenu
IntPtritem
intfByPosition
boollpmii
Win32.MenuItemInfo
Returns
GetPrivateProfileInt(string, string, int, string)
public static extern int GetPrivateProfileInt(string lpAppName, string lpKeyName, int nDefault, string lpFileName)
Parameters
Returns
GetPrivateProfileSection(string, byte[], int, string)
public static extern int GetPrivateProfileSection(string lpAppName, byte[] lpszReturnBuffer, int nSize, string lpFileName)
Parameters
Returns
GetScrollInfo(IntPtr, int, ref ScrollInfo)
public static extern bool GetScrollInfo(IntPtr hwnd, int nBar, ref Win32.ScrollInfo scrollInfo)
Parameters
hwnd
IntPtrHandle to a scroll bar control or a window with a standard scroll bar, depending on the value of the
nBar
parameter.nBar
intscrollInfo
Win32.ScrollInfoSee Win32.ScrollInfo
Returns
GetWindowLong(IntPtr, int)
public static extern IntPtr GetWindowLong(IntPtr hWnd, int nIndex)
Parameters
Returns
GetWindowLongPtr(IntPtr, int)
public static extern IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex)
Parameters
Returns
ModifyMenu(IntPtr, int, uint, UIntPtr, IntPtr)
public static extern bool ModifyMenu(IntPtr hMenu, int uPosition, uint uFlags, UIntPtr uIDNewItem, IntPtr lpNewItem = default)
Parameters
Returns
MsgBoxDialog(IntPtr, string, string, uint)
public static extern Win32.DlgResult MsgBoxDialog(IntPtr hWnd, string lpText, string lpCaption, uint uType)
Parameters
Returns
OutputDebugString(string)
public static extern void OutputDebugString(string lpOutputString)
Parameters
lpOutputString
string
SendMessage(IntPtr, SciMsg, uint, int)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, uint wParam, int lParam)
Parameters
Returns
SendMessage(IntPtr, SciMsg, uint, IntPtr)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, uint wParam, IntPtr lParam)
Parameters
Returns
SendMessage(IntPtr, SciMsg, uint, string)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, uint wParam, string lParam)
Parameters
Returns
SendMessage(IntPtr, SciMsg, uint, StringBuilder)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, uint wParam, StringBuilder lParam)
Parameters
hWnd
IntPtrMsg
SciMsgwParam
uintlParam
StringBuilder
Returns
SendMessage(IntPtr, SciMsg, UIntPtr, int)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, UIntPtr wParam, int lParam)
Parameters
Returns
SendMessage(IntPtr, SciMsg, UIntPtr, IntPtr)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, UIntPtr wParam, IntPtr lParam)
Parameters
Returns
SendMessage(IntPtr, uint)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, uint Msg)
Parameters
Returns
SendMessage(IntPtr, uint, uint)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, uint wParam)
Parameters
Returns
SendMessage(IntPtr, uint, uint, ref LangType)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, uint wParam, ref LangType lParam)
Parameters
Returns
SendMessage(IntPtr, uint, uint, MenuCmdId)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, uint wParam, MenuCmdId lParam)
Parameters
Returns
SendMessage(IntPtr, uint, uint, int)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, uint wParam, int lParam)
Parameters
Returns
SendMessage(IntPtr, uint, uint, out int)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, uint wParam, out int lParam)
Parameters
Returns
SendMessage(IntPtr, uint, uint, IntPtr)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, uint wParam, IntPtr lParam)
Parameters
Returns
SendMessage(IntPtr, uint, uint, string)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, uint wParam, string lParam)
Parameters
Returns
SendMessage(IntPtr, uint, uint, StringBuilder)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, uint wParam, StringBuilder lParam)
Parameters
hWnd
IntPtrMsg
uintwParam
uintlParam
StringBuilder
Returns
SendMessage(IntPtr, uint, UIntPtr, int)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, UIntPtr wParam, int lParam)
Parameters
Returns
SendMessage(IntPtr, uint, UIntPtr, IntPtr)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, UIntPtr wParam, IntPtr lParam)
Parameters
Returns
SendMessage(IntPtr, uint, UIntPtr, out IntPtr)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, UIntPtr wParam, out IntPtr lParam)
Parameters
Returns
SendMessage(IntPtr, uint, UIntPtr, string)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, UIntPtr wParam, string lParam)
Parameters
Returns
SendMessage(IntPtr, uint, UIntPtr, StringBuilder)
You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
ScintillaGateway or NotepadPPGateway.
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, UIntPtr wParam, StringBuilder lParam)
Parameters
hWnd
IntPtrMsg
uintwParam
UIntPtrlParam
StringBuilder
Returns
SetMenuItemInfo(IntPtr, int, bool, MenuItemInfo)
public static extern bool SetMenuItemInfo(IntPtr hmenu, int item, bool fByPosition, Win32.MenuItemInfo lpmii)
Parameters
hmenu
IntPtritem
intfByPosition
boollpmii
Win32.MenuItemInfo
Returns
SetWindowLong(IntPtr, int, IntPtr)
public static extern IntPtr SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong)
Parameters
Returns
SetWindowLongPtr(IntPtr, int, IntPtr)
public static extern IntPtr SetWindowLongPtr(IntPtr hWnd, int nIndex, IntPtr dwNewLong)
Parameters
Returns
WritePrivateProfileSection(string, string, string)
public static extern long WritePrivateProfileSection(string section, string val, string filePath)
Parameters
Returns
WritePrivateProfileString(string, string, string, string)
public static extern bool WritePrivateProfileString(string lpAppName, string lpKeyName, string lpString, string lpFileName)