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.22", 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 |
---|---|
advapi | Advapi32.dll and Ktmw32.dll, advanced kernel functions |
comctl | ComCtl32.dll, the 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, basic kernel functions |
mf | Media Foundation |
ole | Basic OLE/COM support |
oleaut | OLE Automation |
raw-dylib | Enables raw-dylib linking |
shell | Shell32.dll, Shlwapi.dll, and Userenv.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
.
Sending messages are a special case, see the msg
module.
§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. |
path | File path operations. |
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.
Macros§
- Generates sequential
u16
constants starting from the given value.
Structs§
- ACCEL
user
ACCEL
struct. - ACL
kernel
ACL
struct. - ALTTABINFO
user
ALTTABINFO
struct. - AM_
MEDI A_ 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.- BLENDFUNCTION
user
BLENDFUNCTION
struct. - BSTR
oleaut
A string data type used with COM automation. - BUTTO
N_ IMAGELIST comctl
BUTTON_IMAGELIST
struct. - BUTTO
N_ SPLITINFO comctl
BUTTON_SPLITINFO
struct. BY_HANDLE_FILE_INFORMATION
struct.- CHOOSECOLOR
user
CHOOSECOLOR
struct. CLAIM_SECURITY_ATTRIBUTE_V1
struct.COAUTHIDENTITY
struct.- COAUTHINFO
ole
COAUTHINFO
struct. - COLORREF
user
COLORREF
struct. - COLORSCHEME
comctl
COLORSCHEME
struct. - COMBOBOXINFO
user
COMBOBOXINFO
struct. - COMDL
G_ FILTERSPEC shell
COMDLG_FILTERSPEC
struct. COMPAREITEMSTRUCT
struct.CONSOLE_READCONSOLE_CONTROL
struct.- COSERVERINFO
ole
COSERVERINFO
struct. - CREATESTRUCT
user
CREATESTRUCT
struct. - CURSORINFO
user
CURSORINFO
struct. - DATETIMEPICKERINFO
comctl
DATETIMEPICKERINFO
struct. - DELETEITEMSTRUCT
user
DELETEITEMSTRUCT
struct. - DEVMODE
user
DEVMODE
struct. DEV_BROADCAST_DEVICEINTERFACE
struct.- DEV_
BROADCAS T_ HANDLE advapi
DEV_BROADCAST_HANDLE
struct. - DEV_
BROADCAS T_ HDR kernel
DEV_BROADCAST_HDR
struct. - DEV_
BROADCAS T_ OEM advapi
DEV_BROADCAST_OEM
struct. - DEV_
BROADCAS T_ PORT advapi
DEV_BROADCAST_PORT
struct. - DEV_
BROADCAS T_ VOLUME advapi
DEV_BROADCAST_VOLUME
struct. - DISK_
SPAC E_ INFORMATION kernel
DISK_SPACE_INFORMATION
struct. - DISPLA
Y_ 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_ADAPTER_DESC1
struct.DXGI_ADAPTER_DESC2
struct.DXGI_FRAME_STATISTICS
struct.DXGI_GAMMA_CONTROL
struct.DXGI_GAMMA_CONTROL_CAPABILITIES
struct.- DXGI_
MAPPE D_ RECT dxgi
DXGI_MAPPED_RECT
struct. - DXGI_
MODE_ DESC dxgi
DXGI_MODE_DESC
struct. - DXGI_
OUTPU T_ DESC dxgi
DXGI_OUTPUT_DESC
struct. - DXGI_
RATIONAL dxgi
DXGI_RATIONAL
struct. - DXGI_
RGB dxgi
DXGI_RGB
struct. - DXGI_
SAMPL E_ 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. - FILTE
R_ 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. - File
Mapped 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
advapi
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. - HEAPLIS
T32 kernel
HEAPLIST32
struct. - HELPINFO
user
HELPINFO
struct. - HEVENT
kernel
Handle to a named or unnamed event object. Originally just aHANDLE
. - HEVENTLOG
advapi
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
advapi
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
. - HSC
advapi
Handle to a Service Control Manager. OriginallySC_HANDLE
. - HSERVICE
advapi
Handle to a service. OriginallySC_HANDLE
. - HSERVICESTATUS
advapi
Handle to a service status. OriginallySERVICE_STATUS_HANDLE
. - 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
advapi
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
. - HVERSIONINFO
version
Handle to a version info block. - HWND
user
Handle to a window. - IAction
taskschd
IAction
COM interface. - IAction
Collection taskschd
IActionCollection
COM interface. - IAdvise
Sink ole
IAdviseSink
COM interface. - IBase
Filter dshow
IBaseFilter
COM interface. - IBind
Ctx ole
IBindCtx
COM interface. - IBoot
Trigger taskschd
IBootTrigger
COM interface. - ICONINFO
user
ICONINFO
struct. - ICONINFOEX
user
ICONINFOEX
struct. - ICom
Handler Action taskschd
IComHandlerAction
COM interface. - IDXGI
Adapter dxgi
IDXGIAdapter
COM interface. - IDXGI
Adapter1 dxgi
IDXGIAdapter1
COM interface. - IDXGI
Adapter2 dxgi
IDXGIAdapter2
COM interface. - IDXGI
Device dxgi
IDXGIDevice
COM interface. IDXGIDeviceSubObject
COM interface.- IDXGI
Factory dxgi
IDXGIFactory
COM interface. - IDXGI
Factory1 dxgi
IDXGIFactory1
COM interface. - IDXGI
Keyed Mutex dxgi
IDXGIKeyedMutex
COM interface. - IDXGI
Object dxgi
IDXGIObject
COM interface. - IDXGI
Output dxgi
IDXGIOutput
COM interface. - IDXGI
Resource dxgi
IDXGIResource
COM interface. - IDXGI
Surface dxgi
IDXGISurface
COM interface. - IDXGI
Swap Chain dxgi
IDXGISwapChain
COM interface. - IDaily
Trigger taskschd
IDailyTrigger
COM interface. - IData
Object ole
IDataObject
COM interface. - IDispatch
oleaut
IDispatch
COM interface. - IDrop
Target ole
IDropTarget
COM interface. - IEmail
Action taskschd
IEmailAction
COM interface. - IEnum
Filters dshow
IEnumFilters
COM interface. - IEnum
Media Types dshow
IEnumMediaTypes
COM interface. - IEnum
Pins dshow
IEnumPins
COM interface. - IEnum
Shell Items shell
IEnumShellItems
COM interface. - IEvent
Trigger taskschd
IEventTrigger
COM interface. - IExec
Action taskschd
IExecAction
COM interface. - IFile
Dialog shell
IFileDialog
COM interface. - IFile
Dialog Events shell
IFileDialogEvents
COM interface. - IFile
Open Dialog shell
IFileOpenDialog
COM interface. - IFile
Save Dialog shell
IFileSaveDialog
COM interface. - IFile
Sink Filter dshow
IFileSinkFilter
COM interface. - IFilter
Graph dshow
IFilterGraph
COM interface. - IFilter
Graph2 dshow
IFilterGraph2
COM interface. - IGraph
Builder dshow
IGraphBuilder
COM interface. - IIdle
Trigger taskschd
IIdleTrigger
COM interface. - ILogon
Trigger taskschd
ILogonTrigger
COM interface. - IMAGELISTDRAWPARAMS
comctl
andgdi
IMAGELISTDRAWPARAMS
struct. IMFAsyncCallback
COM interface.IMFAsyncResult
COM interface.IMFAttributes
COM interface.IIMFByteStream
COM interface.- IMFClock
mf
IMFClock
COM interface. IMFCollection
COM interface.IMFGetService
COM interface.IMFMediaEvent
COM interface.IMFMediaEventGenerator
COM interface.IMFMediaSession
COM interface.IMFMediaSource
COM interface.IMFMediaTypeHandler
COM interface.IMFPresentationDescriptor
COM interface.IMFSourceResolver
COM interface.IMFStreamDescriptor
COM interface.IMFTopology
COM interface.IMFTopologyNode
COM interface.IMFVideoDisplayControl
COM interface.- IMedia
Control dshow
IMediaControl
COM interface. - IMedia
Filter dshow
IMediaFilter
COM interface. - IMedia
Seeking dshow
IMediaSeeking
COM interface. - IModal
Window shell
IModalWindow
COM interface. - IMoniker
ole
IMoniker
COM interface. - INITCOMMONCONTROLSEX
comctl
INITCOMMONCONTROLSEX
struct - INPUT
user
INPUT
struct. - IPersist
ole
IPersist
COM interface. - IPersist
File ole
IPersistFile
COM interface. IPersistStream
COM interface.- IPicture
ole
IPicture
COM interface. - IPin
dshow
IPin
COM interface. - IProperty
Store oleaut
IPropertyStore
COM interface. - IRegistered
Task taskschd
IRegisteredTask
COM interface. - IRegistration
Info taskschd
IRegistrationInfo
COM interface. ISequentialStream
COM interface.- IShell
Item shell
IShellItem
COM interface. - IShell
Item2 shell
IShellItem2
COM interface. - IShell
Item Array shell
IShellItemArray
COM interface. - IShell
Link shell
IShellLink
COM interface. - IStorage
ole
IStorage
COM interface. - IStream
ole
IStream
COM interface. - ITask
Definition taskschd
ITaskDefinition
COM interface. - ITask
Folder taskschd
ITaskFolder
COM interface. - ITask
Service taskschd
ITaskService
COM interface. - ITaskbar
List shell
ITaskbarList
COM interface. - ITaskbar
List2 shell
ITaskbarList2
COM interface. - ITaskbar
List3 shell
ITaskbarList3
COM interface. - ITaskbar
List4 shell
ITaskbarList4
COM interface. - ITrigger
taskschd
ITrigger
COM interface. - ITrigger
Collection taskschd
ITriggerCollection
COM interface. - IType
Info oleaut
ITypeInfo
COM interface. - IUnknown
ole
IUnknown
COM interface. It’s the base to all COM interfaces. - KEYBDINPUT
user
KEYBDINPUT
struct. - LANGID
kernel
LANGID
language identifier. - LASTINPUTINFO
user
LASTINPUTINFO
struct. - 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 advapi
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. - MODULEENTR
Y32 kernel
MODULEENTRY32
struct. - MONITORINFOEX
user
MONITORINFOEX
struct. - MONTHDAYSTATE
comctl
MONTHDAYSTATE
struct. - MOUSEINPUT
user
MOUSEINPUT
struct. - MSG
user
MSG
struct. - MULT
I_ 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. - NMHDDISPINFO
comctl
NMHDDISPINFO
struct. - NMHDFILTERBTNCLICK
comctl
NMHDFILTERBTNCLICK
struct. - NMHDR
comctl
NMHDR
struct. - NMHEADER
comctl
NMHEADER
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. - POWERBROADCAS
T_ SETTING kernel
POWERBROADCAST_SETTING
struct. - PROCESSENTR
Y32 kernel
PROCESSENTRY32
struct. - PROCESSO
R_ NUMBER kernel
PROCESSOR_NUMBER
struct. - PROCES
S_ HEAP_ ENTRY kernel
PROCESS_HEAP_ENTRY
struct. - PROCES
S_ HEAP_ ENTR Y_ Block kernel
PROCESS_HEAP_ENTRY
Block
. PROCESS_HEAP_ENTRY
Region
.- PROCES
S_ INFORMATION kernel
PROCESS_INFORMATION
struct. - PROPERTYKEY
oleaut
PROPERTYKEY
struct. - PROPVARIANT
oleaut
PROPVARIANT
struct. - RECT
user
RECT
struct. - RGBQUAD
gdi
RGBQUAD
struct. - SCROLLINFO
user
SCROLLINFO
struct. - SECURIT
Y_ ATTRIBUTES kernel
SECURITY_ATTRIBUTES
struct. - SECURIT
Y_ DESCRIPTOR kernel
SECURITY_DESCRIPTOR
struct. - SERVIC
E_ STATUS advapi
SERVICE_STATUS
struct. - SERVIC
E_ TIMECHANG E_ INFO advapi
SERVICE_TIMECHANGE_INFO
struct. - SHELLEXECUTEINFO
advapi
andshell
SHELLEXECUTEINFO
struct. - SHFILEINFO
shell
SHFILEINFO
struct. - SHFILEOPSTRUCT
shell
SHFILEOPSTRUCT
struct. - SHSTOCKICONINFO
shell
SHSTOCKICONINFO
struct. - SID
advapi
SID
struct. - SID_
AND_ ATTRIBUTES advapi
SID_AND_ATTRIBUTES
struct. - SID_
AND_ ATTRIBUTE S_ HASH advapi
SID_AND_ATTRIBUTES_HASH
struct. - SID_
IDENTIFIE R_ AUTHORITY advapi
SID_IDENTIFIER_AUTHORITY
struct. - SIZE
user
SIZE
struct. - SNB
ole
SNB
struct. - STARTUPINFO
kernel
STARTUPINFO
struct. - STYLESTRUCT
user
STYLESTRUCT
struct. - SYSTEMTIME
kernel
SYSTEMTIME
struct. - SYSTE
M_ INFO kernel
SYSTEM_INFO
struct. - TASKDIALOGCONFIG
comctl
TASKDIALOGCONFIG
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
advapi
andcomctl
TBSAVEPARAMS
struct. - TCHITTESTINFO
comctl
TCHITTESTINFO
struct. - TCITEM
comctl
TCITEM
struct. - TEXTMETRIC
gdi
TEXTMETRIC
struct. - THREADENTR
Y32 kernel
THREADENTRY32
struct. - TIME_
ZONE_ INFORMATION kernel
TIME_ZONE_INFORMATION
struct. - TITLEBARINFOEX
user
TITLEBARINFOEX
struct. - TOKE
N_ ACCES S_ INFORMATION advapi
TOKEN_ACCESS_INFORMATION
struct. TOKEN_APPCONTAINER_INFORMATION
struct.- TOKE
N_ DEFAUL T_ DACL advapi
TOKEN_DEFAULT_DACL
struct. - TOKE
N_ ELEVATION advapi
TOKEN_ELEVATION
struct. - TOKE
N_ GROUPS advapi
TOKEN_GROUPS
struct. TOKEN_GROUPS_AND_PRIVILEGES
struct.- TOKE
N_ LINKE D_ TOKEN advapi
TOKEN_LINKED_TOKEN
struct. - TOKE
N_ MANDATOR Y_ LABEL advapi
TOKEN_MANDATORY_LABEL
struct. - TOKE
N_ MANDATOR Y_ POLICY advapi
TOKEN_MANDATORY_POLICY
struct. - TOKE
N_ ORIGIN advapi
TOKEN_ORIGIN
struct. - TOKE
N_ OWNER advapi
TOKEN_OWNER
struct. - TOKE
N_ PRIMAR Y_ GROUP advapi
TOKEN_PRIMARY_GROUP
struct. - TOKE
N_ PRIVILEGES advapi
TOKEN_PRIVILEGES
struct. - TOKE
N_ SOURCE advapi
TOKEN_SOURCE
struct. - TOKE
N_ STATISTICS advapi
TOKEN_STATISTICS
struct. - TOKE
N_ USER advapi
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
advapi
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. - WTSSESSIO
N_ NOTIFICATION advapi
WTSSESSION_NOTIFICATION
struct.
Enums§
- Accel
Menu Ctrl user
Variant parameter for: - AtomStr
user
Variant parameter for: - BmpIcon
user
Variant parameter for: - BmpIcon
CurMeta comctl
Variant parameter for: - BmpIdb
Res comctl
Variant parameter for: - BmpInst
Id comctl
Variant parameter for: - BmpPtr
Str user
Variant parameter for: - Claim
Security Attr kernel
Variable parameter for: - ClrDef
None comctl
Variant parameter for: - CurObj
gdi
Variant parameter for: - Disab
Priv advapi
Variable parameter for: - Dispf
Nup user
Variant parameter for: - Encoding
kernel
String encodings. - File
Access kernel
Access types forFile::open
andFileMapped::open
. - Gmidx
Enum user
Variant parameter for: - HwKb
Mouse user
Variant parameter for: - Hwnd
Focus user
Variant parameter for: - Hwnd
Hmenu user
Variant parameter for: - Hwnd
Place user
Variant parameter for: - Hwnd
Point Id user
Variant parameter for: - IcoMon
shell
Variable parameter for: - IconId
comctl
Variant parameter for: - Icon
IdTd comctl
Variant parameter for: - IconRes
comctl
Variant parameter for: - IdIdc
Str user
Variant parameter for: - IdIdi
Str user
Variant parameter for: - IdMenu
user
Variant parameter used in menu methods: - IdObm
Str gdi
Variant parameter for: - IdOcr
Str gdi
Variant parameter for: - IdOic
Str gdi
Variant parameter for: - IdPos
user
Variant parameter for: - IdStr
kernel
A resource identifier. - IdxCb
None comctl
Variant type for: - IdxStr
comctl
Variant parameter for: - Menu
Item user
Variant parameter for: - Menu
Item Info user
Variant parameter for: - Nccsp
Rect user
Variant parameter for: - Power
Setting kernel
Variant parameter for: - Power
Setting Away Mode kernel
Variant parameter for: - Power
Setting Lid kernel
Variant parameter for: - PtIdx
comctl
Variant parameter for: - PtsRc
user
Variant parameter for: - Registry
Value advapi
Registry value types. - ResStrs
comctl
Variant parameter for: - RtStr
kernel
A predefined resource identifier. - Success
Timeout user
Variant parameter for: - SvcCtl
advapi
Notification content forHSERVICESTATUS::RegisterServiceCtrlHandlerEx
callback, describingco::SERVICE_CONTROL
. - SvcCtl
Device Event advapi
Notification content forSvcCtl
. - SvcCtl
Power Event advapi
Notification content forSvcCtl
. - Token
Info advapi
Variant parameter for: - Treeitem
Tvi comctl
Variant parameter for:
Functions§
AdjustWindowRectEx
function.AdjustWindowRectExForDpi
function.- Allocate
AndInitialize Sid advapi
AllocateAndInitializeSid
function. AllowSetForegroundWindow
function- AnyPopup
user
AnyPopup
function. AttachThreadInput
function.- Block
Input user
BlockInput
function. BroadcastSystemMessage
function.CLSIDFromProgID
function.CLSIDFromProgIDEx
function.CLSIDFromString
function.ChangeDisplaySettings
function.ChangeDisplaySettingsEx
function.- Choose
Color user
ChooseColor
function. - Clip
Cursor user
ClipCursor
function. - CoCreate
Guid 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.- Command
Line ToArgv shell
CommandLineToArgv
function. - Convert
SidTo String Sid advapi
ConvertSidToStringSid
function. - Convert
String SidTo Sid advapi
ConvertStringSidToSid
function. - Copy
File kernel
CopyFile
function. - CopySid
advapi
CopySid
function. CreateClassMoniker
function.CreateDXGIFactory
function.CreateDXGIFactory1
function.- Create
Directory kernel
CreateDirectory
function. CreateFileMoniker
function.CreateItemMoniker
function.CreateObjrefMoniker
function.CreatePointerMoniker
function.- Create
Well Known Sid advapi
CreateWellKnownSid
function. - Decrypt
File advapi
DecryptFile
function. - Delete
File kernel
DeleteFile
function. - Dispatch
Message ⚠user
DispatchMessage
function. DwmEnableMMCSS
function.- DwmFlush
dwm
DwmFlush
function. DwmGetColorizationColor
function.DwmIsCompositionEnabled
function.- Empty
Clipboard user
EmptyClipboard
function. - Encrypt
File advapi
EncryptFile
function. - Encryption
Disable advapi
EncryptionDisable
function. - EndMenu
user
EndMenu
function. EnumDisplayDevices
function.EnumDisplaySettings
function.EnumDisplaySettingsEx
function.EnumThreadWindows
function.- Enum
Windows user
EnumWindows
function. - Equal
Domain Sid advapi
EqualDomainSid
function. - Equal
Prefix Sid advapi
EqualPrefixSid
function. - Equal
Sid advapi
EqualSid
function. - Exit
Process kernel
ExitProcess
function. - Exit
Thread kernel
ExitThread
function. - Exit
Windows Ex user
ExitWindowsEx
function. - Expand
Environment Strings kernel
ExpandEnvironmentStrings
function. - File
Time ToSystem Time kernel
FileTimeToSystemTime
function. - Flush
Process Write Buffers kernel
FlushProcessWriteBuffers
function. - Format
Message ⚠kernel
FormatMessage
function. - GdiFlush
gdi
GdiFlush
function. GdiGetBatchLimit
function.GdiSetBatchLimit
function.GetAllUsersProfileDirectory
function.- GetAsync
KeyState user
GetAsyncKeyState
function. - GetBinary
Type kernel
GetBinaryType
function. GetCaretBlinkTime
function.- GetCaret
Pos user
GetCaretPos
function. - GetClip
Cursor user
GetClipCursor
function. - GetClipboard
Data ⚠user
GetClipboardData
function. GetClipboardSequenceNumber
function.- GetCommand
Line kernel
GetCommandLine
function. - GetComputer
Name kernel
GetComputerName
function. - GetCurrent
Directory kernel
GetCurrentDirectory
function. - GetCurrent
Process Id kernel
GetCurrentProcessId
function. - GetCurrent
Thread Id kernel
GetCurrentThreadId
function. - GetCursor
Info user
GetCursorInfo
function. - GetCursor
Pos user
GetCursorPos
function. GetDefaultUserProfileDirectory
function.GetDialogBaseUnits
function.- GetDisk
Free Space Ex kernel
GetDiskFreeSpaceEx
function. - GetDisk
Space Information kernel
GetDiskSpaceInformation
function. GetDoubleClickTime
function.- GetDrive
Type kernel
GetDriveType
function. - GetEnvironment
Strings kernel
GetEnvironmentStrings
function. - GetFile
Attributes kernel
GetFileAttributes
function. - GetFirmware
Type kernel
GetFirmwareType
function. - GetGUI
Thread Info user
GetGUIThreadInfo
function. - GetLarge
Page Minimum kernel
GetLargePageMinimum
function. - GetLast
Error kernel
GetLastError
function. - GetLast
Input Info user
GetLastInputInfo
function. - GetLength
Sid advapi
GetLengthSid
function. - GetLocal
Time kernel
GetLocalTime
function. - GetLogical
Drive Strings kernel
GetLogicalDriveStrings
function. - GetLogical
Drives kernel
GetLogicalDrives
function. GetMenuCheckMarkDimensions
function.- GetMessage
user
GetMessage
function. - GetMessage
Pos user
GetMessagePos
function. - GetNative
System Info kernel
GetNativeSystemInfo
function. - GetPrivate
Profile Section kernel
GetPrivateProfileSection
function. GetPrivateProfileSectionNames
function.- GetPrivate
Profile String kernel
GetPrivateProfileString
function. - GetProfiles
Directory shell
GetProfilesDirectory
function. - GetQueue
Status user
GetQueueStatus
function. - GetSid
Length Required advapi
GetSidLengthRequired
function. - GetStartup
Info kernel
GetStartupInfo
function. - GetSys
Color user
GetSysColor
function. - GetSystem
Directory kernel
GetSystemDirectory
function. - GetSystem
File Cache Size kernel
GetSystemFileCacheSize
function. - GetSystem
Info kernel
GetSystemInfo
function. - GetSystem
Metrics user
GetSystemMetrics
function. GetSystemMetricsForDpi
function.- GetSystem
Time kernel
GetSystemTime
function. - GetSystem
Time AsFile Time kernel
GetSystemTimeAsFileTime
function. GetSystemTimePreciseAsFileTime
function.- GetSystem
Times kernel
GetSystemTimes
function. - GetTemp
File Name kernel
GetTempFileName
function. - GetTemp
Path kernel
GetTempPath
function. GetThreadDpiHostingBehavior
function.- GetTick
Count64 kernel
GetTickCount64
function. - GetUser
Name advapi
GetUserName
function. - GetVolume
Information kernel
GetVolumeInformation
function. - GetVolume
Path Name kernel
GetVolumePathName
function. GetWindowsAccountDomainSid
function.- Global
Memory Status Ex kernel
GlobalMemoryStatusEx
function. - HIBYTE
kernel
HIBYTE
macro. - HIDWORD
kernel
Returns the high-orderu32
of anu64
. - HIWORD
kernel
HIWORD
macro. - InSend
Message user
InSendMessage
function. - InSend
Message Ex user
and 64-bitInSendMessageEx
function. - Inflate
Rect user
InflateRect
function. - Init
Common Controls comctl
InitCommonControls
function. - Init
Common Controls Ex comctl
InitCommonControlsEx
function. - InitMUI
Language comctl
InitMUILanguage
function. InitializeSecurityDescriptor
function.- Initiate
System Shutdown advapi
InitiateSystemShutdown
function. - Initiate
System Shutdown Ex advapi
InitiateSystemShutdownEx
function. - Intersect
Rect user
IntersectRect
function. - IsApp
Themed uxtheme
IsAppThemed
function. - IsComposition
Active uxtheme
IsCompositionActive
function. - IsDebugger
Present kernel
IsDebuggerPresent
function. - IsGUI
Thread user
IsGUIThread
function. - IsNative
VhdBoot kernel
IsNativeVhdBoot
function. - IsRect
Empty user
IsRectEmpty
function. - IsTheme
Active uxtheme
IsThemeActive
function. - IsTheme
Dialog Texture Enabled uxtheme
and 64-bitIsThemeDialogTextureEnabled
function. IsValidSecurityDescriptor
function.- IsValid
Sid advapi
IsValidSid
function. - IsWell
Known Sid advapi
IsWellKnownSid
function. - IsWindows7
OrGreater kernel
IsWindows7OrGreater
function. - IsWindows8
OrGreater kernel
IsWindows8OrGreater
function. IsWindows8Point1OrGreater
function.- IsWindows10
OrGreater kernel
IsWindows10OrGreater
function. - IsWindows
Server kernel
IsWindowsServer
function. IsWindowsVersionOrGreater
function.- IsWindows
Vista OrGreater kernel
IsWindowsVistaOrGreater
function. - IsWow64
Message user
IsWow64Message
function. - LOBYTE
kernel
LOBYTE
macro. - LODWORD
kernel
Returns the low-orderu32
of anu64
. - LOWORD
kernel
LOWORD
macro. LockSetForegroundWindow
function.- Lookup
Account Name advapi
LookupAccountName
function. - Lookup
Account Sid advapi
LookupAccountSid
function. - Lookup
Privilege Name advapi
LookupPrivilegeName
function. - Lookup
Privilege Value advapi
LookupPrivilegeValue
function. - MAKEDWORD
kernel
- MAKEQWORD
kernel
Similar toMAKEDWORD
, but foru64
. - MAKEWORD
kernel
MAKEWORD
macro. MFCreateAsyncResult
function.MFCreateMFByteStreamOnStream
function.MFCreateMediaSession
function.MFCreateSourceResolver
function.MFCreateTopology
function.MFCreateTopologyNode
function.MFStartup
function.- Move
File kernel
MoveFile
function. - MulDiv
kernel
MulDiv
function. - Multi
Byte ToWide Char kernel
MultiByteToWideChar
function. - Offset
Rect user
OffsetRect
function. - OleLoad
Picture oleaut
OleLoadPicture
function. - OleLoad
Picture Path oleaut
OleLoadPicturePath
function. - Output
Debug String kernel
OutputDebugString
function. - PSGet
Name From Property Key oleaut
PSGetNameFromPropertyKey
function. - Path
Combine shell
PathCombine
function. - Path
Common Prefix shell
PathCommonPrefix
function. - Path
Skip Root shell
PathSkipRoot
function. - Path
Strip Path shell
PathStripPath
function. - Path
Undecorate shell
PathUndecorate
function. - Path
Unquote Spaces shell
PathUnquoteSpaces
function. - Peek
Message user
PeekMessage
function. - Post
Quit Message user
PostQuitMessage
function. - Post
Thread ⚠Message user
PostThreadMessage
function. - PtIn
Rect user
PtInRect
function. - Query
Performance Counter kernel
QueryPerformanceCounter
function. QueryPerformanceFrequency
function.QueryUnbiasedInterruptTime
function.- Register
Class ⚠Ex user
RegisterClassEx
function. RegisterWindowMessage
function.- Replace
File kernel
ReplaceFile
function. - SHAdd
ToRecent ⚠Docs shell
SHAddToRecentDocs
function. SHCreateItemFromParsingName
function.- SHCreate
MemStream shell
SHCreateMemStream
function. - SHFile
Operation shell
SHFileOperation
function. - SHGet
File Info shell
SHGetFileInfo
function. - SHGet
Known Folder Path advapi
andshell
SHGetKnownFolderPath
function. - SHGet
Stock Icon Info shell
SHGetStockIconInfo
function. - Send
Input user
SendInput
function. SetCaretBlinkTime
function.- SetCaret
Pos user
SetCaretPos
function. - SetClipboard
Data ⚠user
SetClipboardData
function. - SetCurrent
Directory kernel
SetCurrentDirectory
function. - SetCursor
Pos user
SetCursorPos
function. SetDoubleClickTime
function.- SetFile
Attributes kernel
SetFileAttributes
function. - SetLast
Error kernel
SetLastError
function. SetProcessDPIAware
function.SetThreadDpiHostingBehavior
function.- SetThread
Stack Guarantee kernel
SetThreadStackGuarantee
function. - Shell
Execute Ex advapi
andshell
ShellExecuteEx
function. - Shell_
Notify Icon shell
Shell_NotifyIcon
function. - Show
Cursor user
ShowCursor
function. - Sleep
kernel
Sleep
function. - Sound
Sentry user
SoundSentry
function. StringFromCLSID
function.- Subtract
Rect user
SubtractRect
function. - Swap
Mouse Button user
SwapMouseButton
function. - Switch
ToThread kernel
SwitchToThread
function. - System
Parameters ⚠Info user
SystemParametersInfo
function. - System
Time ToFile Time kernel
SystemTimeToFileTime
function. SystemTimeToTzSpecificLocalTime
function.- System
Time ToVariant Time oleaut
SystemTimeToVariantTime
function. - Task
Dialog Indirect comctl
TaskDialogIndirect
function. - Track
Mouse Event user
TrackMouseEvent
function. - Translate
Message user
TranslateMessage
function. - Union
Rect user
UnionRect
function. - Unregister
Class user
UnregisterClass
function. - Variant
Time ToSystem Time oleaut
VariantTimeToSystemTime
function. - VerSet
Condition Mask kernel
VerSetConditionMask
function. - Verify
Version Info kernel
VerifyVersionInfo
function. - Wait
Message user
WaitMessage
function. - Wide
Char ToMulti Byte kernel
WideCharToMultiByte
function. WritePrivateProfileString
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.