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.
Usage
Add the dependency in your Cargo.toml
:
[dependencies]
winsafe = { version = "0.0.18", 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 |
dshow | DirectShow |
dwm | Desktop Window Manager |
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 |
mf | Media Foundation |
ole | OLE and basic COM support |
oleaut | OLE Automation |
shell | Shell32.dll and Shlwapi.dll, the COM-based Windows Shell |
taskschd | Task Scheduler |
user | User32.dll and ComDlg32.dll, the basic Windows GUI support |
uxtheme | UxTheme.dll, extended window theming |
version | Version.dll, to manipulate *.exe version info |
If you’re looking for a comprehensive Win32 coverage, take a look at winapi or windows crates, which are unsafe, but have everything.
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::*, 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::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::*, 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::{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
- co
kernel
Native constants. - guard
kernel
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. - msg
user
Parameters of window messages. - path
kernel
File path utilities. - prelude
kernel
The WinSafe prelude. - task_dlg
comctl
Provides high-level abstractions toTaskDialogIndirect
andHWND::TaskDialog
functions. - vt
ole
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
user
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. - DATETIMEPICKERINFO
comctl
DATETIMEPICKERINFO
struct. - DELETEITEMSTRUCT
user
DELETEITEMSTRUCT
struct. - DEVMODE
user
DEVMODE
struct. - DISK_SPACE_INFORMATION
kernel
DISK_SPACE_INFORMATION
struct. - DISPLAY_DEVICE
user
DISPLAY_DEVICE
struct. - DLGITEMTEMPLATE
user
DLGITEMTEMPLATE
struct. - DLGTEMPLATE
user
DLGTEMPLATE
struct. - DRAWITEMSTRUCT
user
DRAWITEMSTRUCT
struct. - DRAWTEXTPARAMS
user
DRAWTEXTPARAMS
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_MODE_DESC
dxgi
DXGI_MODE_DESC
struct. - DXGI_OUTPUT_DESC
dxgi
DXGI_OUTPUT_DESC
struct. - DXGI_RATIONAL
dxgi
DXGI_RATIONAL
struct. - DXGI_RGB
dxgi
DXGI_RGB
struct. - DXGI_SAMPLE_DESC
dxgi
DXGI_SAMPLE_DESC
struct. DXGI_SHARED_RESOURCE
struct.DXGI_SURFACE_DESC
struct.DXGI_SWAP_CHAIN_DESC
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 a named or unnamed event object. Originally just aHANDLE
. - HEVENTLOG
kernel
Handle to an event log. 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
. - HHEAP
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. - HeapBlock
kernel
Manages anHHEAP
memory block which uses the default heap of the calling process – that is, callsHHEAP::GetProcessHeap
. - IAction
taskschd
- IActionCollection
taskschd
IActionCollection
COM interface overIActionCollectionVT
. - IAdviseSink
ole
IAdviseSink
COM interface overIAdviseSinkVT
. - IBaseFilter
dshow
IBaseFilter
COM interface overIBaseFilterVT
. - IBindCtx
ole
IBindCtx
COM interface overIBindCtxVT
. - IBootTrigger
taskschd
IBootTrigger
COM interface overIBootTriggerVT
. - IComHandlerAction
taskschd
IComHandlerAction
COM interface overIComHandlerActionVT
. - IDXGIAdapter
dxgi
IDXGIAdapter
COM interface overIDXGIAdapterVT
. - IDXGIDevice
dxgi
IDXGIDevice
COM interface overIDXGIDeviceVT
. IDXGIDeviceSubObject
COM interface overIDXGIDeviceSubObjectVT
.- IDXGIFactory
dxgi
IDXGIFactory
COM interface overIDXGIFactoryVT
. - IDXGIObject
dxgi
IDXGIObject
COM interface overIDXGIObjectVT
. - IDXGIOutput
dxgi
IDXGIOutput
COM interface overIDXGIOutputVT
. - IDXGIResource
dxgi
IDXGIResource
COM interface overIDXGIResourceVT
. - IDXGISurface
dxgi
IDXGISurface
COM interface overIDXGISurfaceVT
. - IDXGISwapChain
dxgi
IDXGISwapChain
COM interface overIDXGISwapChainVT
. - IDailyTrigger
taskschd
IDailyTrigger
COM interface overIDailyTriggerVT
. - IDataObject
ole
IDataObject
COM interface overIDataObjectVT
. - IDispatch
oleaut
IDispatch
COM interface overIDispatchVT
. - IDropTarget
ole
IDropTarget
COM interface overIDropTargetVT
. - IEmailAction
taskschd
IEmailAction
COM interface overIEmailActionVT
. - IEnumFilters
dshow
IEnumFilters
COM interface overIEnumFiltersVT
. - IEnumMediaTypes
dshow
IEnumMediaTypes
COM interface overIEnumMediaTypesVT
. - IEnumPins
dshow
IEnumPins
COM interface overIEnumPinsVT
. - IEnumShellItems
shell
IEnumShellItems
COM interface overIEnumShellItemsVT
. - IEventTrigger
taskschd
IEventTrigger
COM interface overIEventTriggerVT
. - IExecAction
taskschd
IExecAction
COM interface overIExecActionVT
. - IFileDialog
shell
IFileDialog
COM interface overIFileDialogVT
. - IFileDialogEvents
shell
IFileDialogEvents
COM interface overIFileDialogEventsVT
. - 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
. - IIdleTrigger
taskschd
IIdleTrigger
COM interface overIIdleTriggerVT
. - ILogonTrigger
taskschd
ILogonTrigger
COM interface overILogonTriggerVT
. - IMAGELISTDRAWPARAMS
comctl
andgdi
IMAGELISTDRAWPARAMS
struct. IMFAsyncCallback
COM interface overIMFAsyncCallbackVT
.IMFAsyncResult
COM interface overIMFAsyncResultVT
.IMFAttributes
COM interface overIMFAttributesVT
.- IMFClock
mf
IMFClock
COM interface overIMFClockVT
. IMFGetService
COM interface overIMFGetServiceVT
.IMFMediaEvent
COM interface overIMFMediaEventVT
.IMFMediaEventGenerator
COM interface overIMFMediaEventGeneratorVT
.IMFMediaSession
COM interface overIMFMediaSessionVT
.IMFMediaSource
COM interface overIMFMediaSourceVT
.IMFPresentationDescriptor
COM interface overIMFPresentationDescriptorVT
.IMFSourceResolver
COM interface overIMFSourceResolverVT
.IMFTopology
COM interface overIMFTopologyVT
.IMFTopologyNode
COM interface overIMFTopologyNodeVT
.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
. - IRegisteredTask
taskschd
IRegisteredTask
COM interface overIRegisteredTaskVT
. - IRegistrationInfo
taskschd
IRegistrationInfo
COM interface overIRegistrationInfoVT
. 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
- ITaskDefinition
taskschd
ITaskDefinition
COM interface overITaskDefinitionVT
. - ITaskFolder
taskschd
ITaskFolder
COM interface overITaskFolderVT
. - ITaskService
taskschd
ITaskService
COM interface overITaskServiceVT
. - ITaskbarList
shell
ITaskbarList
COM interface overITaskbarListVT
. - ITaskbarList2
shell
ITaskbarList2
COM interface overITaskbarList2VT
. - ITaskbarList3
shell
ITaskbarList3
COM interface overITaskbarList3VT
. - ITaskbarList4
shell
ITaskbarList4
COM interface overITaskbarList4VT
. - ITrigger
taskschd
ITrigger
COM interface overITriggerVT
. - ITriggerCollection
taskschd
ITriggerCollection
COM interface overITriggerCollectionVT
. - 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. - LUID_AND_ATTRIBUTES
kernel
LUID_AND_ATTRIBUTES
struct. - 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. - MARGINS
uxtheme
MARGINS
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. MFCLOCK_PROPERTIES
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
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_AND_ATTRIBUTES
kernel
SID_AND_ATTRIBUTES
struct. - SID_IDENTIFIER_AUTHORITY
kernel
SID_IDENTIFIER_AUTHORITY
struct. - SIZE
user
SIZE
struct. - SNB
ole
SNB
struct. - STARTUPINFO
kernel
STARTUPINFO
struct. - STYLESTRUCT
user
STYLESTRUCT
struct. - SYSTEMTIME
kernel
SYSTEMTIME
struct. - SYSTEM_INFO
kernel
SYSTEM_INFO
struct. - TASKDIALOGCONFIG
comctl
TASKDIALOGCONFIG
struct. - TASKDIALOG_BUTTON
comctl
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. TOKEN_APPCONTAINER_INFORMATION
struct.- TOKEN_DEFAULT_DACL
kernel
TOKEN_DEFAULT_DACL
struct. - TOKEN_ELEVATION
kernel
TOKEN_ELEVATION
struct. - TOKEN_GROUPS
kernel
TOKEN_GROUPS
struct. - TOKEN_LINKED_TOKEN
kernel
TOKEN_LINKED_TOKEN
struct. - TOKEN_MANDATORY_LABEL
kernel
TOKEN_MANDATORY_LABEL
struct. - TOKEN_MANDATORY_POLICY
kernel
TOKEN_MANDATORY_POLICY
struct. - TOKEN_ORIGIN
kernel
TOKEN_ORIGIN
struct. - TOKEN_OWNER
kernel
TOKEN_OWNER
struct. - TOKEN_PRIMARY_GROUP
kernel
TOKEN_PRIMARY_GROUP
struct. - TOKEN_PRIVILEGES
kernel
TOKEN_PRIVILEGES
struct. - TOKEN_USER
kernel
TOKEN_USER
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 for: - 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: - DisabPriv
kernel
Variable 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
Variant parameter for: - IconIdTdicon
comctl
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
Variant parameter for: - IdxCbNone
comctl
Variant type for: - IdxStr
comctl
Variant parameter for: - MenuItem
user
Variant parameter for: - MenuItemInfo
user
Variant parameter for: - NccspRect
user
Variant parameter for: - PtIdx
comctl
Variant parameter for: - PtsRc
user
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.AdjustWindowRectExForDpi
function.- AllocateAndInitializeSid
kernel
AllocateAndInitializeSid
function. AllowSetForegroundWindow
function- AnyPopup
user
AnyPopup
function. AttachThreadInput
function.- BlockInput
user
BlockInput
function. BroadcastSystemMessage
function.CLSIDFromProgID
function.CLSIDFromProgIDEx
function.CLSIDFromString
function.ChangeDisplaySettings
function.ChangeDisplaySettingsEx
function.- ChooseColor
user
ChooseColor
function. - ClipCursor
user
ClipCursor
function. - CoCreateGuid
ole
CoCreateGuid
function. CoCreateInstance
function.CoCreateInstanceEx
function.CoInitializeEx
function, which initializes the COM library. When succeeding, returns an informational error code.CoLockObjectExternal
function.CoTaskMemAlloc
function.CoTaskMemRealloc
function.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.- CreateDirectory
kernel
CreateDirectory
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. DwmEnableMMCSS
function.- DwmFlush
dwm
DwmFlush
function. DwmGetColorizationColor
function.DwmIsCompositionEnabled
function.- EmptyClipboard
user
EmptyClipboard
function. - EncryptFile
kernel
EncryptFile
function. - EncryptionDisable
kernel
EncryptionDisable
function. - EndMenu
user
EndMenu
function. EnumDisplayDevices
function.EnumDisplaySettings
function.EnumDisplaySettingsEx
function.EnumThreadWindows
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. - ExitWindowsEx
user
ExitWindowsEx
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.- GetDiskFreeSpaceEx
kernel
GetDiskFreeSpaceEx
function. - GetDiskSpaceInformation
kernel
GetDiskSpaceInformation
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. - GetTempFileName
kernel
GetTempFileName
function. - GetTempPath
kernel
GetTempPath
function. - GetTickCount64
kernel
GetTickCount64
function. - GetUserName
kernel
GetUserName
function. - GetVolumeInformation
kernel
GetVolumeInformation
function. - GetVolumePathName
kernel
GetVolumePathName
function. GetWindowsAccountDomainSid
function.- GlobalMemoryStatusEx
kernel
GlobalMemoryStatusEx
function. - HIBYTE
kernel
HIBYTE
macro. - HIDWORD
kernel
Returns the high-orderu32
of anu64
. - HIWORD
kernel
HIWORD
macro. - InSendMessage
user
InSendMessage
function. - InSendMessageEx
user
and 64-bitInSendMessageEx
function. - InflateRect
user
InflateRect
function. - InitCommonControls
comctl
InitCommonControls
function. - InitCommonControlsEx
comctl
InitCommonControlsEx
function. - InitMUILanguage
comctl
InitMUILanguage
function. InitializeSecurityDescriptor
function.- InitiateSystemShutdown
kernel
InitiateSystemShutdown
function. - InitiateSystemShutdownEx
kernel
InitiateSystemShutdownEx
function. - IntersectRect
user
IntersectRect
function. - IsAppThemed
uxtheme
IsAppThemed
function. - IsCompositionActive
uxtheme
IsCompositionActive
function. - IsDebuggerPresent
kernel
IsDebuggerPresent
function. - IsGUIThread
user
IsGUIThread
function. - IsNativeVhdBoot
kernel
IsNativeVhdBoot
function. - IsRectEmpty
user
IsRectEmpty
function. - IsThemeActive
uxtheme
IsThemeActive
function. - IsThemeDialogTextureEnabled
uxtheme
and 64-bitIsThemeDialogTextureEnabled
function. 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
macro. - LODWORD
kernel
Returns the low-orderu32
of anu64
. - LOWORD
kernel
LOWORD
macro. LockSetForegroundWindow
function.- LookupAccountName
kernel
LookupAccountName
function. - LookupAccountSid
kernel
LookupAccountSid
function. - LookupPrivilegeName
kernel
LookupPrivilegeName
function. - LookupPrivilegeValue
kernel
LookupPrivilegeValue
function. - MAKEDWORD
kernel
- MAKEQWORD
kernel
Similar toMAKEDWORD
, but foru64
. - MAKEWORD
kernel
MAKEWORD
macro. MFCreateAsyncResult
function.MFCreateMediaSession
function.MFCreateSourceResolver
function.MFCreateTopology
function.MFCreateTopologyNode
function.MFStartup
function.- MoveFile
kernel
MoveFile
function. - MulDiv
kernel
MulDiv
function. - MultiByteToWideChar
kernel
MultiByteToWideChar
function. - OffsetRect
user
OffsetRect
function. - OleLoadPicture
oleaut
OleLoadPicture
function. - OleLoadPicturePath
oleaut
OleLoadPicturePath
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.- SetFileAttributes
kernel
SetFileAttributes
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
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 Aliases
- AnyResult
kernel
AResult
alias which returns aBox<dyn Error + Send + Sync>
on failure. - CCHOOKPROC
user
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
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.