Expand description
Windows API and GUI in safe, idiomatic Rust.
Crate • GitHub • Docs (stable) • Docs (master branch) • Examples
WinSafe has:
- low-level Win32 API constants, functions and structs;
- high-level structs to build native Win32 GUI applications.
If you’re looking for a comprehensive Win32 coverage, take a look at winapi or windows crates, which are unsafe, but have everything.
Usage
Add the dependency in your Cargo.toml
:
[dependencies]
winsafe = { version = "0.0.15", features = [] }
Then you must enable the Cargo features you want to be included – these modules are named after native Windows DLL and library names, mostly.
The following Cargo features are available so far:
Feature | Description |
---|---|
comctl | ComCtl32.dll, for Common Controls |
comdlg | ComDlg32.dll, for the old Common Dialogs |
dshow | DirectShow |
dxgi | DirectX Graphics Infrastructure |
gdi | Gdi32.dll, the Windows GDI |
gui | The WinSafe high-level GUI abstractions |
kernel | Kernel32.dll, Advapi32.dll and Ktmw32.dll – all others will include it |
msimg | Msimg32.dll |
ole | OLE and basic COM support |
oleaut | OLE Automation |
shell | Shell32.dll and Shlwapi.dll, the COM-based Windows Shell |
user | User32.dll, the basic Windows GUI support |
uxtheme | UxTheme.dll, extended window theming |
version | Version.dll, to manipulate *.exe version info |
Note that a Cargo feature may depend on other features, which will be enabled automatically.
The GUI API
WinSafe features idiomatic bindings for the Win32 API, but on top of that,
it features a set of high-level GUI structs, which scaffolds the boilerplate
needed to build native Win32 GUI applications, event-oriented. Unless you’re
doing something really specific, these high-level wrappers are highly
recommended – you’ll usually start with the
WindowMain
.
One of the greatest strenghts of the GUI API is supporting the use of resource files, which can be created with a WYSIWYG resource editor.
GUI structs can be found in module gui
.
Native function calls
The best way to understand the idea behind WinSafe bindings is comparing them to the correspondent C code.
For example, take the following C code:
HWND hwnd = GetDesktopWindow();
SetFocus(hwnd);
This is equivalent to:
use winsafe::prelude::*;
use winsafe::HWND;
let hwnd = HWND::GetDesktopWindow();
hwnd.SetFocus();
Note how GetDesktopWindow
is a static method of HWND
, and
SetFocus
is an instance method
called directly upon hwnd
. All native handles (HWND
,
HDC
, HINSTANCE
, etc.) are structs,
thus:
- native Win32 functions that return a handle are static methods in WinSafe;
- native Win32 functions whose first parameter is a handle are instance methods.
Now this C code:
PostQuitMessage(0);
Is equivalent to:
use winsafe::prelude::*;
use winsafe::PostQuitMessage;
PostQuitMessage(0);
Since PostQuitMessage
is a free function, it’s
simply at the root of the crate.
Also note that some functions which require a cleanup routine – like
BeginPaint
, for example – will
return the resource wrapped in a guard, which will perform
the cleanup automatically. You’ll never have to manually call
EndPaint
.
Native constants
All native Win32 constants can be found in the co
module.
They’re all typed, what means that different constant types cannot be
mixed (unless you explicitly say so).
Technically, each constant type is simply a newtype with a couple implementations, including those allowing bitflag operations. Also, all constant values can be converted to its underlying integer type.
The name of the constant type is often its prefix. For example, constants of
MessageBox
function, like
MB_OKCANCEL
, belong to a type called MB
.
For example, take the following C code:
let hwnd = GetDesktopWindow();
MessageBox(hwnd, "Hello, world", "My hello", MB_OKCANCEL | MB_ICONINFORMATION);
This is equivalent to:
use winsafe::prelude::*;
use winsafe::{co::MB, HWND};
let hwnd = HWND::GetDesktopWindow();
hwnd.MessageBox("Hello, world", "Title", MB::OKCANCEL | MB::ICONINFORMATION)?;
The method MessageBox
, like most
functions that can return errors, will return
SysResult
, which can contain an
ERROR
constant.
Native structs
WinSafe implements native Win32 structs in a very restricted way. First off,
fields which control the size of the struct – often named cbSize
– are
private and automatically set when the struct is instantiated.
Pointer fields are also private, and they can be set and retrieved only
through getter and setter methods. In particular, when setting a string
pointer field, you need to pass a reference to a WString
buffer, which will keep the actual string contents.
For example, the following C code:
WNDCLASSEX wcx = {0};
wcx.cbSize = sizeof(WNDCLASSEX);
wcx.lpszClassName = "MY_WINDOW";
if (RegisterClassEx(&wcx) == 0) {
DWORD err = GetLastError();
// handle error...
}
Is equivalent to:
use winsafe::prelude::*;
use winsafe::{RegisterClassEx, WNDCLASSEX, WString};
let mut wcx = WNDCLASSEX::default();
let mut buf = WString::from_str("MY_WINDOW");
wcx.set_lpszClassName(Some(&mut buf));
if let Err(err) = RegisterClassEx(&wcx) {
// handle error...
}
Note how you don’t need to call GetLastError
to
retrieve the error code: it’s returned by the method itself in the
SysResult
.
Text encoding
Windows natively uses Unicode UTF-16.
WinSafe uses Unicode UTF-16 internally but exposes idiomatic UTF-8,
performing conversions automatically when needed, so you don’t have to worry
about OsString
or any low-level conversion.
However, there are cases where a string conversion is still needed, like
when dealing with native Win32 structs. In such cases, you can use the
WString
struct, which is also capable of working as a
buffer to receive text from Win32 calls.
Errors and result aliases
WinSafe declares a few
Result
aliases
which are returned by its functions and methods:
Alias | Error | Used for |
---|---|---|
SysResult | ERROR | Standard system errors. |
HrResult | HRESULT | COM errors. |
AnyResult | Box<dyn Error + Send + Sync> | Holding different error types. All other Result aliases can be converted into it. |
Utilities
Beyond the GUI API, WinSafe features a few high-level abstractions to deal with some particularly complex Win32 topics. Unless you need something specific, prefer using these over the raw, native calls:
Utility | Used for |
---|---|
Encoding | String encodings. |
File | File read/write and other operations. |
FileMapped | Memory-mapped file operations. |
Ini | Managing key/value pairs of a .ini file. |
path | File path operations. |
ResourceInfo | Retrieve embedded data from executables or DLLs. |
task_dlg | Various dialog prompts. |
WString | Managing native wide strings. |
Modules
- Native constants.
- RAII implementation for various resources, which automatically perform cleanup routines when the object goes out of scope.
- gui
gui
High-level GUI abstractions for user windows and native controls. They can be created programmatically or by loading resources from a.res
file. These files can be created with a WYSIWYG resource editor. - Parameters of window messages.
- path
kernel
File path utilities. - The WinSafe prelude.
- task_dlg
comctl
andole
Provides high-level abstractions toTaskDialogIndirect
andHWND::TaskDialog
functions. - Virtual tables of COM interfaces.
Macros
- Generates sequential
u16
constants starting from the given value.
Structs
- ACCEL
user
ACCEL
struct. - ACL
kernel
ACL
struct. - ALTTABINFO
user
ALTTABINFO
struct. - AM_MEDIA_TYPE
dshow
AM_MEDIA_TYPE
struct. - ATOM
user
ATOM
returned byRegisterClassEx
. - Variant parameter for:
- BITMAP
gdi
BITMAP
struct. BITMAPFILEHEADER
struct.- BITMAPINFO
gdi
BITMAPINFO
struct. BITMAPINFOHEADER
struct.- BSTR
oleaut
A string data type used with COM automation. - BUTTON_IMAGELIST
comctl
BUTTON_IMAGELIST
struct. - BUTTON_SPLITINFO
comctl
BUTTON_SPLITINFO
struct. BY_HANDLE_FILE_INFORMATION
struct.- CHOOSECOLOR
comdlg
CHOOSECOLOR
struct. COAUTHIDENTITY
struct.- COAUTHINFO
ole
COAUTHINFO
struct. - COLORREF
user
COLORREF
struct. - COLORSCHEME
comctl
COLORSCHEME
struct. - COMBOBOXINFO
user
COMBOBOXINFO
struct. - COMDLG_FILTERSPEC
shell
COMDLG_FILTERSPEC
struct. COMPAREITEMSTRUCT
struct.CONSOLE_READCONSOLE_CONTROL
struct.- COSERVERINFO
ole
COSERVERINFO
struct. - CREATESTRUCT
user
CREATESTRUCT
struct. - ComPtr
ole
A pointer to pointer to a COM virtual table. - DATETIMEPICKERINFO
comctl
DATETIMEPICKERINFO
struct. - DELETEITEMSTRUCT
user
DELETEITEMSTRUCT
struct. - DEVMODE
user
DEVMODE
struct. - DISPLAY_DEVICE
user
DISPLAY_DEVICE
struct. - DRAWITEMSTRUCT
user
DRAWITEMSTRUCT
struct. - DVINFO
dshow
DVINFO
struct. DVTARGETDEVICE
struct.DXGI_ADAPTER_DESC
struct.DXGI_FRAME_STATISTICS
struct.DXGI_GAMMA_CONTROL
struct.DXGI_GAMMA_CONTROL_CAPABILITIES
struct.- DXGI_RGB
dxgi
DXGI_RGB
struct. - EDITBALLOONTIP
comctl
EDITBALLOONTIP
struct. - FILETIME
kernel
FILETIME
struct. - FILTER_INFO
dshow
FILTER_INFO
struct. - FORMATETC
ole
FORMATETC
struct. - File
kernel
Manages anHFILE
handle, which provides file read/write and other operations. It is closed automatically when the object goes out of scope. - FileMapped
kernel
Manages anHFILEMAP
handle, which provides memory-mapped file operations, including read/write through slices. It is closed automatically when the object goes out of scope. - GUID
kernel
GUID
struct. - GUITHREADINFO
user
GUITHREADINFO
struct. - HACCEL
user
Handle to an accelerator table. - HACCESSTOKEN
kernel
Handle to an access token. Originally just aHANDLE
. - HARDWAREINPUT
user
HARDWAREINPUT
struct. - HBITMAP
user
Handle to a bitmap. - HBRUSH
user
Handle to a brush. - HCURSOR
user
Handle to a cursor. - HDC
user
Handle to a device context. - HDESK
user
Handle to a desktop. - HDHITTESTINFO
comctl
HDHITTESTINFO
struct. - HDITEM
comctl
HDITEM
struct. - HDLAYOUT
comctl
HDLAYOUT
struct. - HDROP
shell
Handle to an internal drop structure. - HDWP
user
Handle to a deferred window position. - HEAPLIST32
kernel
HEAPLIST32
struct. - HELPINFO
user
HELPINFO
struct. - HEVENT
kernel
Handle to an event. Originally just aHANDLE
. - HFILE
kernel
Handle to a file. Originally just aHANDLE
. - HFILEMAP
kernel
Handle to a file mapping. Originally just aHANDLE
. - HFILEMAPVIEW
kernel
Address of a mapped view. Originally just anLPVOID
. - HFINDFILE
kernel
Handle to a file search. Originally just aHANDLE
. - HFONT
gdi
Handle to a font. - HGLOBAL
kernel
Handle to a global memory block. Originally just aHANDLE
. - HHEAPMEM
kernel
Handle to a heap memory block. Originally just aHANDLE
. - HHEAPOBJ
kernel
Handle to a heap object. Originally just aHANDLE
. - HHOOK
user
Handle to a hook. - HICON
user
Handle to an icon. - HIMAGELIST
comctl
Handle to an image list. - HINSTANCE
kernel
Handle to an instance, same asHMODULE
. - HKEY
kernel
Handle to a registry key. - HLOCAL
kernel
Handle to a local memory block. - HMENU
user
Handle to a menu. - HMONITOR
user
Handle to a display monitor. - HPALETTE
gdi
Handle to a palette. - HPEN
gdi
Handle to a pen GDI object. - HPIPE
kernel
Handle to an anonymous pipe. Originally just aHANDLE
. - HPROCESS
kernel
Handle to a process. Originally just aHANDLE
. - HPROCESSLIST
kernel
Handle to a process list snapshot. Originally just aHANDLE
. - HRGN
user
Handle to a region GDI object. - HRSRC
kernel
Handle to a resource. Originally just aHANDLE
. - HRSRCMEM
kernel
Handle to a resource memory block. Originally just anHGLOBAL
. - HSTD
kernel
Handle to a standard device. Originally just aHANDLE
. - HTHEME
uxtheme
Handle to a theme. - HTHREAD
kernel
Handle to a thread. Originally just aHANDLE
. - HTRANSACTION
kernel
Handle to a transaction. Originally just aHANDLE
. - HTREEITEM
comctl
Handle to a tree view item. - HUPDATERSRC
kernel
Handle to an updateable resource. Originally just aHANDLE
. - HWND
user
Handle to a window. - IBaseFilter
dshow
IBaseFilter
COM interface overIBaseFilterVT
. - IBindCtx
ole
IBindCtx
COM interface overIBindCtxVT
. - IDXGIAdapter
dxgi
IDXGIAdapter
COM interface overIDXGIAdapterVT
. - IDXGIFactory
dxgi
IDXGIFactory
COM interface overIDXGIFactoryVT
. - IDXGIObject
dxgi
IDXGIObject
COM interface overIDXGIObjectVT
. - IDXGIOutput
dxgi
IDXGIOutput
COM interface overIDXGIOutputVT
. - IDataObject
ole
IDataObject
COM interface overIDataObjectVT
. - IDispatch
oleaut
IDispatch
COM interface overIDispatchVT
. - IDropTarget
ole
IDropTarget
COM interface overIDropTargetVT
. - IEnumFilters
dshow
IEnumFilters
COM interface overIEnumFiltersVT
. - IEnumMediaTypes
dshow
IEnumMediaTypes
COM interface overIEnumMediaTypesVT
. - IEnumPins
dshow
IEnumPins
COM interface overIEnumPinsVT
. - IEnumShellItems
shell
IEnumShellItems
COM interface overIEnumShellItemsVT
. - IFileDialog
shell
IFileDialog
COM interface overIFileDialogVT
. - IFileOpenDialog
shell
IFileOpenDialog
COM interface overIFileOpenDialogVT
. - IFileSaveDialog
shell
IFileSaveDialog
COM interface overIFileSaveDialogVT
. - IFileSinkFilter
dshow
IFileSinkFilter
COM interface overIFileSinkFilterVT
. - IFilterGraph
dshow
IFilterGraph
COM interface overIFilterGraphVT
. - IFilterGraph2
dshow
IFilterGraph2
COM interface overIFilterGraph2VT
. - IGraphBuilder
dshow
IGraphBuilder
COM interface overIGraphBuilderVT
. - IMAGELISTDRAWPARAMS
comctl
andgdi
IMAGELISTDRAWPARAMS
struct. - IMFGetService
dshow
IMFGetService
COM interface overIMFGetServiceVT
. IMFVideoDisplayControl
COM interface overIMFVideoDisplayControlVT
.- IMediaControl
dshow
IMediaControl
COM interface overIMediaControlVT
. - IMediaFilter
dshow
IMediaFilter
COM interface overIMediaFilterVT
. - IMediaSeeking
dshow
- IModalWindow
shell
IModalWindow
COM interface overIModalWindowVT
. - IMoniker
ole
IMoniker
COM interface overIMonikerVT
. - INITCOMMONCONTROLSEX
comctl
INITCOMMONCONTROLSEX
struct - INPUT
user
INPUT
struct. - IPersist
ole
IPersist
COM interface overIPersistVT
. IPersistStream
COM interface overIPersistStreamVT
.- IPicture
ole
IPicture
COM interface overIPictureVT
. - IPin
dshow
- IPropertyStore
oleaut
IPropertyStore
COM interface overIPropertyStoreVT
. ISequentialStream
COM interface overISequentialStreamVT
.- IShellItem
shell
IShellItem
COM interface overIShellItemVT
. - IShellItem2
shell
IShellItem2
COM interface overIShellItem2VT
. - IShellItemArray
shell
IShellItemArray
COM interface overIShellItemArrayVT
. - IShellLink
shell
IShellLink
COM interface overIShellLinkVT
. - IStream
ole
- ITaskbarList
shell
ITaskbarList
COM interface overITaskbarListVT
. - ITaskbarList2
shell
ITaskbarList2
COM interface overITaskbarList2VT
. - ITaskbarList3
shell
ITaskbarList3
COM interface overITaskbarList3VT
. - ITaskbarList4
shell
ITaskbarList4
COM interface overITaskbarList4VT
. - ITypeInfo
oleaut
ITypeInfo
COM interface overITypeInfoVT
. - IUnknown
ole
IUnknown
COM interface overIUnknownVT
. It’s the base to all COM interfaces. - Ini
kernel
High-level abstraction to load, manage and serialize sections and key/value pairs of a.ini
file. - IniEntry
kernel
A single key/value pair of anIniSection
of anIni
. - IniSection
kernel
A single section of anIni
. - KEYBDINPUT
user
KEYBDINPUT
struct. - LANGID
kernel
LANGID
language identifier. - LCID
kernel
LCID
locale identifier. - LITEM
comctl
LITEM
struct. - LOGBRUSH
gdi
LOGBRUSH
struct. - LOGFONT
gdi
LOGFONT
struct. - LOGPALETTE
gdi
LOGPALETTE
struct. - LOGPEN
gdi
LOGPEN
struct. - LUID
kernel
LUID
identifier. - LVBKIMAGE
comctl
LVBKIMAGE
struct. - LVCOLUMN
comctl
LVCOLUMN
struct. - LVFINDINFO
comctl
LVFINDINFO
struct. - LVFOOTERINFO
comctl
LVFOOTERINFO
struct. - LVFOOTERITEM
comctl
LVFOOTERITEM
struct. - LVGROUP
comctl
LVGROUP
struct. - LVGROUPMETRICS
comctl
LVGROUPMETRICS
struct. - LVHITTESTINFO
comctl
LVHITTESTINFO
struct. - LVINSERTGROUPSORTED
comctl
LVINSERTGROUPSORTED
struct. - LVINSERTMARK
comctl
LVINSERTMARK
struct. - LVITEM
comctl
LVITEM
struct. - LVITEMINDEX
comctl
LVITEMINDEX
struct. - LVSETINFOTIP
comctl
LVSETINFOTIP
struct. - LVTILEINFO
comctl
LVTILEINFO
struct. - LVTILEVIEWINFO
comctl
LVTILEVIEWINFO
struct. - MCGRIDINFO
comctl
MCGRIDINFO
struct. - MCHITTESTINFO
comctl
MCHITTESTINFO
struct. - MEMORYSTATUSEX
kernel
MEMORYSTATUSEX
struct. - MENUBARINFO
user
MENUBARINFO
struct. - MENUINFO
user
MENUINFO
struct. - MENUITEMINFO
user
MENUITEMINFO
struct. MFVideoNormalizedRect
struct.- MINMAXINFO
user
MINMAXINFO
struct. - MODULEENTRY32
kernel
MODULEENTRY32
struct. - MONITORINFOEX
user
MONITORINFOEX
struct. - MONTHDAYSTATE
comctl
MONTHDAYSTATE
struct. - MOUSEINPUT
user
MOUSEINPUT
struct. - MSG
user
MSG
struct. - MULTI_QI
ole
MULTI_QI
struct. NCCALCSIZE_PARAMS
struct.- NMBCDROPDOWN
comctl
NMBCDROPDOWN
struct. - NMBCHOTITEM
comctl
NMBCHOTITEM
struct. - NMCHAR
comctl
NMCHAR
struct. - NMCUSTOMDRAW
comctl
NMCUSTOMDRAW
struct. - NMDATETIMECHANGE
comctl
NMDATETIMECHANGE
struct. - NMDATETIMEFORMAT
comctl
NMDATETIMEFORMAT
struct. - NMDATETIMEFORMATQUERY
comctl
NMDATETIMEFORMATQUERY
struct. - NMDATETIMESTRING
comctl
NMDATETIMESTRING
struct. - NMDATETIMEWMKEYDOWN
comctl
NMDATETIMEWMKEYDOWN
struct. - NMDAYSTATE
comctl
NMDAYSTATE
struct. - NMHDR
comctl
NMHDR
struct. - NMIPADDRESS
comctl
NMIPADDRESS
struct. - NMITEMACTIVATE
comctl
NMITEMACTIVATE
struct. - NMLINK
comctl
NMLINK
struct. - NMLISTVIEW
comctl
NMLISTVIEW
struct. - NMLVCACHEHINT
comctl
NMLVCACHEHINT
struct. - NMLVCUSTOMDRAW
comctl
NMLVCUSTOMDRAW
struct. - NMLVDISPINFO
comctl
NMLVDISPINFO
struct. - NMLVEMPTYMARKUP
comctl
NMLVEMPTYMARKUP
struct. - NMLVFINDITEM
comctl
NMLVFINDITEM
struct. - NMLVGETINFOTIP
comctl
NMLVGETINFOTIP
struct. - NMLVKEYDOWN
comctl
NMLVKEYDOWN
struct. - NMLVLINK
comctl
NMLVLINK
struct. - NMLVODSTATECHANGE
comctl
NMLVODSTATECHANGE
struct. - NMLVSCROLL
comctl
NMLVSCROLL
struct. - NMMOUSE
comctl
NMMOUSE
struct. - NMOBJECTNOTIFY
comctl
andole
NMOBJECTNOTIFY
struct. - NMSELCHANGE
comctl
NMSELCHANGE
struct. - NMTCKEYDOWN
comctl
NMTCKEYDOWN
struct. - NMTRBTHUMBPOSCHANGING
comctl
NMTRBTHUMBPOSCHANGING
struct. - NMTREEVIEW
comctl
NMTREEVIEW
struct. - NMTVASYNCDRAW
comctl
andgdi
NMTVASYNCDRAW
struct. - NMTVCUSTOMDRAW
comctl
NMTVCUSTOMDRAW
stuct. - NMTVITEMCHANGE
comctl
NMTVITEMCHANGE
struct. - NMUPDOWN
comctl
NMUPDOWN
struct. - NMVIEWCHANGE
comctl
NMVIEWCHANGE
struct. NONCLIENTMETRICS
struct.- NOTIFYICONDATA
shell
NOTIFYICONDATA
struct. - OSVERSIONINFOEX
kernel
OSVERSIONINFOEX
struct. - OVERLAPPED
kernel
OVERLAPPED
struct. - PAINTSTRUCT
user
PAINTSTRUCT
struct. - PALETTEENTRY
gdi
PALETTEENTRY
struct. - PBRANGE
comctl
PBRANGE
struct. - PIN_INFO
dshow
PIN_INFO
struct. - POINT
user
POINT
struct. - PROCESSENTRY32
kernel
PROCESSENTRY32
struct. - PROCESSOR_NUMBER
kernel
PROCESSOR_NUMBER
struct. - PROCESS_HEAP_ENTRY
kernel
PROCESS_HEAP_ENTRY
struct. - PROCESS_HEAP_ENTRY_Block
kernel
PROCESS_HEAP_ENTRY
(crate::PROCESS_HEAP_ENTRY)
Block`. PROCESS_HEAP_ENTRY
(crate::PROCESS_HEAP_ENTRY)
Region`.- PROCESS_INFORMATION
kernel
PROCESS_INFORMATION
struct. - PROPERTYKEY
oleaut
PROPERTYKEY
struct. - PROPVARIANT
oleaut
PROPVARIANT
struct. - RECT
user
RECT
struct. - RGBQUAD
gdi
RGBQUAD
struct. - ResourceInfo
version
Retrieves data from an embedded resource, which can be read from an EXE or a DLL file. - ResourceInfoBlock
version
An language block ofResourceInfo
, composed of a language ID and a code page. - SCROLLINFO
user
SCROLLINFO
struct. - SECURITY_ATTRIBUTES
kernel
SECURITY_ATTRIBUTES
struct. - SECURITY_DESCRIPTOR
kernel
SECURITY_DESCRIPTOR
struct. - SHFILEINFO
shell
SHFILEINFO
struct. - SHFILEOPSTRUCT
shell
SHFILEOPSTRUCT
struct. - SHSTOCKICONINFO
shell
SHSTOCKICONINFO
struct. - SID
kernel
SID
struct. - SID_IDENTIFIER_AUTHORITY
kernel
SID_IDENTIFIER_AUTHORITY
struct. - SIZE
user
SIZE
struct. - STARTUPINFO
kernel
STARTUPINFO
struct. - STYLESTRUCT
user
STYLESTRUCT
struct. - SYSTEMTIME
kernel
SYSTEMTIME
struct. - SYSTEM_INFO
kernel
SYSTEM_INFO
struct. - TASKDIALOGCONFIG
comctl
andole
TASKDIALOGCONFIG
struct. - TASKDIALOG_BUTTON
comctl
andole
TASKDIALOG_BUTTON
struct. - TBADDBITMAP
comctl
TBADDBITMAP
struct. - TBBUTTON
comctl
TBBUTTON
struct. - TBBUTTONINFO
comctl
TBBUTTONINFO
struct. - TBINSERTMARK
comctl
TBINSERTMARK
struct. - TBMETRICS
comctl
TBMETRICS
struct. - TBREPLACEBITMAP
comctl
TBREPLACEBITMAP
struct. - TBSAVEPARAMS
comctl
TBSAVEPARAMS
struct. - TCHITTESTINFO
comctl
TCHITTESTINFO
struct. - TCITEM
comctl
TCITEM
struct. - TEXTMETRIC
gdi
TEXTMETRIC
struct. - THREADENTRY32
kernel
THREADENTRY32
struct. - TIME_ZONE_INFORMATION
kernel
TIME_ZONE_INFORMATION
struct. - TITLEBARINFOEX
user
TITLEBARINFOEX
struct. - TRACKMOUSEEVENT
user
TRACKMOUSEEVENT
struct. - TVHITTESTINFO
comctl
TVHITTESTINFO
struct. - TVINSERTSTRUCT
comctl
TVINSERTSTRUCT
struct. - TVITEM
comctl
TVITEM
struct. - TVITEMEX
comctl
TVITEMEX
struct. - TVSORTCB
comctl
TVSORTCB
struct. - UDACCEL
comctl
UDACCEL
struct. - VALENT
kernel
VALENT
struct. - VARIANT
oleaut
VARIANT
struct. - VS_FIXEDFILEINFO
version
VS_FIXEDFILEINFO
struct. - WIN32_FIND_DATA
kernel
WIN32_FIND_DATA
struct. - WINDOWINFO
user
WINDOWINFO
struct. - WINDOWPLACEMENT
user
WINDOWPLACEMENT
struct. - WINDOWPOS
user
WINDOWPOS
struct. - WNDCLASSEX
user
WNDCLASSEX
struct. - WString
kernel
Stores a[u16]
buffer for a null-terminated Unicode UTF-16 wide string natively used by Windows.
Enums
- AccelMenuCtrl
user
Variant parameter for: - AtomStr
user
Variant parameter used in window class functions: - BmpIcon
user
Variant parameter for: - BmpIconCurMeta
comctl
Variant parameter for: - BmpIdbRes
comctl
Variant parameter for: - BmpInstId
comctl
Variant parameter for: - BmpPtrStr
user
Variant parameter for: - DispfNup
user
Variant parameter for: - Encoding
kernel
String encodings. - FileAccess
kernel
Access types forFile::open
andFileMapped::open
. - GmidxEnum
user
Variant parameter for: - HwKbMouse
user
Variant parameter for: - HwndFocus
user
Variant parameter for: - HwndHmenu
user
Variant parameter for: - HwndPlace
user
Variant parameter for: - HwndPointId
user
Variant parameter for: - IconId
comctl
andole
Variant parameter for: - IconIdTdicon
comctl
andole
Variant parameter for: - IdIdcStr
user
Variant parameter for: - IdIdiStr
user
Variant parameter for: - IdMenu
user
Variant parameter used in menu methods: - IdObmStr
gdi
Variant parameter for: - IdOcrStr
gdi
Variant parameter for: - IdOicStr
gdi
Variant parameter for: - IdPos
user
Variant parameter for: - IdStr
kernel
A resource identifier. - IdTdiconStr
comctl
andole
Variant parameter for: - IdxCbNone
comctl
Variant type for: - IdxStr
comctl
Variant parameter for: - MenuEnum
user
Variant parameter for: - NccspRect
user
Variant parameter for: - PtIdx
comctl
Variant parameter for: - RegistryValue
kernel
Registry value types. - ResStrs
comctl
Variant parameter for: - RtStr
kernel
A predefined resource identifier. - TreeitemTvi
comctl
Variant parameter for:
Functions
AdjustWindowRectEx
function.- AllocateAndInitializeSid
kernel
AllocateAndInitializeSid
function. AllowSetForegroundWindow
function- AnyPopup
user
AnyPopup
function. AttachThreadInput
function.BroadcastSystemMessage
function.CLSIDFromProgID
function.CLSIDFromProgIDEx
function.CLSIDFromString
function.ChangeDisplaySettings
function.ChangeDisplaySettingsEx
function.- ChooseColor
comdlg
ChooseColor
function. - ClipCursor
user
ClipCursor
function. CoCreateInstance
function.CoCreateInstanceEx
function.CoInitializeEx
function, which initializes the COM library. When succeeding, returns an informational error code.CoLockObjectExternal
function.- CoTaskMemAlloc⚠
ole
CoTaskMemAlloc
function. CoTaskMemFree
function.- CoTaskMemRealloc⚠
ole
CoTaskMemRealloc
function. - CommDlgExtendedError
comdlg
CommDlgExtendedError
function. - CommandLineToArgv
shell
CommandLineToArgv
function. - ConvertSidToStringSid
kernel
ConvertSidToStringSid
function. - ConvertStringSidToSid
kernel
ConvertStringSidToSid
function. - CopyFile
kernel
CopyFile
function. - CopySid
kernel
CopySid
function. CreateClassMoniker
function.CreateDXGIFactory
function.CreateFileMoniker
function.CreateItemMoniker
function.CreateObjrefMoniker
function.CreatePointerMoniker
function.- CreateWellKnownSid
kernel
CreateWellKnownSid
function. - DecryptFile
kernel
DecryptFile
function. - DeleteFile
kernel
DeleteFile
function. - DispatchMessage⚠
user
DispatchMessage
function. - EmptyClipboard
user
EmptyClipboard
function. - EncryptFile
kernel
EncryptFile
function. - EncryptionDisable
kernel
EncryptionDisable
function. - EndMenu
user
EndMenu
function. EnumDisplayDevices
function.EnumDisplaySettings
function.EnumDisplaySettingsEx
function.- EnumWindows
user
EnumWindows
function. - EqualDomainSid
kernel
EqualDomainSid
function. - EqualPrefixSid
kernel
EqualPrefixSid
function. - EqualSid
kernel
EqualSid
function. - ExitProcess
kernel
ExitProcess
function. - ExitThread
kernel
ExitThread
function. - ExpandEnvironmentStrings
kernel
ExpandEnvironmentStrings
function. - FileTimeToSystemTime
kernel
FileTimeToSystemTime
function. - FlushProcessWriteBuffers
kernel
FlushProcessWriteBuffers
function. - FormatMessage⚠
kernel
FormatMessage
function. - GdiFlush
gdi
GdiFlush
function. GdiGetBatchLimit
function.GdiSetBatchLimit
function.- GetAsyncKeyState
user
GetAsyncKeyState
function. - GetBinaryType
kernel
GetBinaryType
function. - GetClipCursor
user
GetClipCursor
function. - GetClipboardData⚠
user
GetClipboardData
function. GetClipboardSequenceNumber
function.- GetCommandLine
kernel
GetCommandLine
function. - GetComputerName
kernel
GetComputerName
function. - GetCurrentDirectory
kernel
GetCurrentDirectory
function. - GetCurrentProcessId
kernel
GetCurrentProcessId
function. - GetCurrentThreadId
kernel
GetCurrentThreadId
function. - GetCursorPos
user
GetCursorPos
function. GetDialogBaseUnits
function.GetDoubleClickTime
function.- GetDriveType
kernel
GetDriveType
function. - GetEnvironmentStrings
kernel
GetEnvironmentStrings
function. - GetFileAttributes
kernel
GetFileAttributes
function. - GetFileVersionInfo
version
GetFileVersionInfo
function. - GetFileVersionInfoSize
version
GetFileVersionInfoSize
function. - GetFirmwareType
kernel
GetFirmwareType
function. - GetGUIThreadInfo
user
GetGUIThreadInfo
function. - GetLargePageMinimum
kernel
GetLargePageMinimum
function. - GetLastError
kernel
GetLastError
function. - GetLengthSid
kernel
GetLengthSid
function. - GetLocalTime
kernel
GetLocalTime
function. - GetLogicalDriveStrings
kernel
GetLogicalDriveStrings
function. - GetLogicalDrives
kernel
GetLogicalDrives
function. GetMenuCheckMarkDimensions
function.- GetMessage
user
GetMessage
function. - GetMessagePos
user
GetMessagePos
function. - GetNativeSystemInfo
kernel
GetNativeSystemInfo
function. - GetQueueStatus
user
GetQueueStatus
function. - GetSidLengthRequired
kernel
GetSidLengthRequired
function. - GetStartupInfo
kernel
GetStartupInfo
function. - GetSysColor
user
GetSysColor
function. - GetSystemDirectory
kernel
GetSystemDirectory
function. - GetSystemFileCacheSize
kernel
GetSystemFileCacheSize
function. - GetSystemInfo
kernel
GetSystemInfo
function. - GetSystemMetrics
user
GetSystemMetrics
function. GetSystemMetricsForDpi
function.- GetSystemTime
kernel
GetSystemTime
function. - GetSystemTimeAsFileTime
kernel
GetSystemTimeAsFileTime
function. GetSystemTimePreciseAsFileTime
function.- GetSystemTimes
kernel
GetSystemTimes
function. - GetTempPath
kernel
GetTempPath
function. - GetTickCount64
kernel
GetTickCount64
function. - GetUserName
kernel
GetUserName
function. - GetVolumeInformation
kernel
GetVolumeInformation
function. GetWindowsAccountDomainSid
function.- GlobalMemoryStatusEx
kernel
GlobalMemoryStatusEx
function. - HIBYTE
kernel
HIBYTE
function. Originally a macro. - HIDWORD
kernel
Returns the high-orderu32
of anu64
. - HIWORD
kernel
HIWORD
function. Originally a macro. - InSendMessage
user
InSendMessage
function. - InflateRect
user
InflateRect
function. - InitCommonControls
comctl
InitCommonControls
function. - InitCommonControlsEx
comctl
InitCommonControlsEx
function. - InitMUILanguage
comctl
InitMUILanguage
function. InitializeSecurityDescriptor
function.- IntersectRect
user
IntersectRect
function. - IsAppThemed
uxtheme
IsAppThemed
static method. - IsCompositionActive
uxtheme
IsCompositionActive
static method. - IsDebuggerPresent
kernel
IsDebuggerPresent
function. - IsGUIThread
user
IsGUIThread
function. - IsNativeVhdBoot
kernel
IsNativeVhdBoot
function. - IsRectEmpty
user
IsRectEmpty
function. - IsThemeActive
uxtheme
IsThemeActive
static method. IsValidSecurityDescriptor
function.- IsValidSid
kernel
IsValidSid
function. - IsWellKnownSid
kernel
IsWellKnownSid
function. - IsWindows7OrGreater
kernel
IsWindows7OrGreater
function. - IsWindows8OrGreater
kernel
IsWindows8OrGreater
function. IsWindows8Point1OrGreater
function.- IsWindows10OrGreater
kernel
IsWindows10OrGreater
function. - IsWindowsServer
kernel
IsWindowsServer
function. IsWindowsVersionOrGreater
function.- IsWindowsVistaOrGreater
kernel
IsWindowsVistaOrGreater
function. - IsWow64Message
user
IsWow64Message
function. - LOBYTE
kernel
LOBYTE
function. Originally a macro. - LODWORD
kernel
Returns the low-orderu32
of anu64
. - LOWORD
kernel
LOWORD
function. Originally a macro. LockSetForegroundWindow
function.- LookupAccountName
kernel
LookupAccountName
function. - LookupAccountSid
kernel
LookupAccountSid
function. - MAKEDWORD
kernel
- MAKEQWORD
kernel
Similar toMAKEDWORD
, but foru64
. - MAKEWORD
kernel
MAKEWORD
function. Originally a macro. - MoveFile
kernel
MoveFile
function. - MulDiv
kernel
MulDiv
function. - MultiByteToWideChar
kernel
MultiByteToWideChar
function. - OffsetRect
user
OffsetRect
function. - OutputDebugString
kernel
OutputDebugString
function. - PSGetNameFromPropertyKey
oleaut
PSGetNameFromPropertyKey
function. - PathCombine
shell
PathCombine
function. - PathCommonPrefix
shell
PathCommonPrefix
function. - PathSkipRoot
shell
PathSkipRoot
function. - PathStripPath
shell
PathStripPath
function. - PathUndecorate
shell
PathUndecorate
function. - PathUnquoteSpaces
shell
PathUnquoteSpaces
function. - PeekMessage
user
PeekMessage
function. - PostQuitMessage
user
PostQuitMessage
function. PostThreadMessage
function.- PtInRect
user
PtInRect
function. - QueryPerformanceCounter
kernel
QueryPerformanceCounter
function. QueryPerformanceFrequency
function.- RegisterClassEx⚠
user
RegisterClassEx
function. RegisterWindowMessage
function.- ReplaceFile
kernel
ReplaceFile
function. - SHAddToRecentDocs⚠
shell
SHAddToRecentDocs
function. SHCreateItemFromParsingName
function.- SHCreateMemStream
shell
SHCreateMemStream
function. - SHFileOperation
shell
SHFileOperation
function. - SHGetFileInfo
shell
SHGetFileInfo
function. - SHGetKnownFolderPath
shell
SHGetKnownFolderPath
function. - SHGetStockIconInfo
shell
SHGetStockIconInfo
function. - SendInput
user
SendInput
function. SetCaretBlinkTime
function.- SetCaretPos
user
SetCaretPos
function. - SetClipboardData⚠
user
SetClipboardData
function. - SetCurrentDirectory
kernel
SetCurrentDirectory
function. - SetCursorPos
user
SetCursorPos
function. SetDoubleClickTime
function.- SetLastError
kernel
SetLastError
function. SetProcessDPIAware
function.- SetThreadStackGuarantee
kernel
SetThreadStackGuarantee
function. - Shell_NotifyIcon
shell
Shell_NotifyIcon
function. - ShowCursor
user
ShowCursor
function. - Sleep
kernel
Sleep
function. - SoundSentry
user
SoundSentry
function. StringFromCLSID
function.- SubtractRect
user
SubtractRect
function. - SwapMouseButton
user
SwapMouseButton
function. - SwitchToThread
kernel
SwitchToThread
function. - SystemParametersInfo⚠
user
SystemParametersInfo
function. - SystemTimeToFileTime
kernel
SystemTimeToFileTime
function. SystemTimeToTzSpecificLocalTime
function.- SystemTimeToVariantTime
oleaut
SystemTimeToVariantTime
function. The inverse operation is performed byVariantTimeToSystemTime
. - TaskDialogIndirect
comctl
andole
TaskDialogIndirect
function. - TrackMouseEvent
user
TrackMouseEvent
function. - TranslateMessage
user
TranslateMessage
function. - UnionRect
user
UnionRect
function. - UnregisterClass
user
UnregisterClass
function. - VarQueryValue⚠
version
VarQueryValue
function. - VariantTimeToSystemTime
oleaut
VariantTimeToSystemTime
function. The inverse operation is performed bySystemTimeToVariantTime
. - VerSetConditionMask
kernel
VerSetConditionMask
function. - VerifyVersionInfo
kernel
VerifyVersionInfo
function. - WaitMessage
user
WaitMessage
function. - WideCharToMultiByte
kernel
WideCharToMultiByte
function.
Type Definitions
- AnyResult
kernel
AResult
alias which returns aBox<dyn Error + Send + Sync>
on failure. - CCHOOKPROC
comdlg
Type alias toCCHOOKPROC
callback function. - DLGPROC
user
Type alias toDLGPROC
callback function. - Type alias to
EDITWORDBREAKPROC
callback function. - HOOKPROC
user
Type alias toHOOKPROC
callback function. - HrResult
ole
AResult
alias for COM error codes, which returns anHRESULT
on failure. - PFNLVCOMPARE
comctl
Type alias toPFNLVCOMPARE
callback function. - PFNLVGROUPCOMPARE
comctl
Type alias toPFNLVGROUPCOMPARE
callback function. - PFNTVCOMPARE
comctl
Type alias toPFNTVCOMPARE
callback function. - PFTASKDIALOGCALLBACK
comctl
andole
Type alias toPFTASKDIALOGCALLBACK
calback function. - SUBCLASSPROC
comctl
Type alias toSUBCLASSPROC
callback function. - SysResult
kernel
AResult
alias for native system error codes, which returns anERROR
on failure. - TIMERPROC
user
Type alias toTIMERPROC
callback function. - WNDPROC
user
Type alias toWNDPROC
callback function.