Skip to content

Latest commit

 

History

History
160 lines (94 loc) · 6.2 KB

nf-winuser-registerclassexw.md

File metadata and controls

160 lines (94 loc) · 6.2 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name req.apiset
NF:winuser.RegisterClassExW
RegisterClassExW function (winuser.h)
Registers a window class for subsequent use in calls to the CreateWindow or CreateWindowEx function. (RegisterClassExW)
RegisterClassEx
RegisterClassEx function [Windows and Messages]
RegisterClassExW
_win32_RegisterClassEx
_win32_registerclassex_cpp
winmsg.registerclassex
winui._win32_registerclassex
winuser/RegisterClassEx
winuser/RegisterClassExW
winmsg\registerclassex.htm
winmsg
VS|winui|~\winui\windowsuserinterface\windowing\windowclasses\windowclassreference\windowclassfunctions\registerclassex.htm
12/05/2018
RegisterClassEx, RegisterClassEx function [Windows and Messages], RegisterClassExA, RegisterClassExW, _win32_RegisterClassEx, _win32_registerclassex_cpp, winmsg.registerclassex, winui._win32_registerclassex, winuser/RegisterClassEx, winuser/RegisterClassExA, winuser/RegisterClassExW
winuser.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
RegisterClassExW (Unicode) and RegisterClassExA (ANSI)
User32.lib
User32.dll
Windows
19H1
RegisterClassExW
winuser/RegisterClassExW
c++
APIRef
kbSyntax
DllExport
User32.dll
API-MS-Win-NTUser-IE-Window-l1-1-0.dll
ie_shims.dll
API-MS-Win-RTCore-NTUser-Window-l1-1-0.dll
minuser.dll
Ext-MS-Win-NTUser-Windowclass-l1-1-0.dll
Ext-MS-Win-NTUser-Windowclass-l1-1-1.dll
Ext-MS-Win-RTCore-NTUser-Window-Ext-l1-1-0.dll
ext-ms-win-ntuser-windowclass-l1-1-2.dll
RegisterClassEx
RegisterClassExA
RegisterClassExW
ext-ms-win-ntuser-windowclass-l1-1-0 (introduced in Windows 8)

RegisterClassExW function

-description

Registers a window class for subsequent use in calls to the CreateWindow or CreateWindowEx function.

-parameters

-param unnamedParam1 [in]

Type: const WNDCLASSEX*

A pointer to a WNDCLASSEX structure. You must fill the structure with the appropriate class attributes before passing it to the function.

-returns

Type: ATOM

If the function succeeds, the return value is a class atom that uniquely identifies the class being registered. This atom can only be used by the CreateWindow, CreateWindowEx, GetClassInfo, GetClassInfoEx, FindWindow, FindWindowEx, and UnregisterClass functions and the IActiveIMMap::FilterClientWindows method.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

-remarks

If you register the window class by using RegisterClassExA, the application tells the system that the windows of the created class expect messages with text or character parameters to use the ANSI character set; if you register it by using RegisterClassExW, the application requests that the system pass text parameters of messages as Unicode. The IsWindowUnicode function enables applications to query the nature of each window. For more information on ANSI and Unicode functions, see Conventions for Function Prototypes.

All window classes that an application registers are unregistered when it terminates.

No window classes registered by a DLL are unregistered when the DLL is unloaded. A DLL must explicitly unregister its classes when it is unloaded.

Examples

For an example, see Using Window Classes.

Note

The winuser.h header defines RegisterClassEx as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

Conceptual

CreateWindow

CreateWindowEx

FindWindow

FindWindowEx

GetClassInfo

GetClassInfoEx

GetClassName

Reference

RegisterClass

UnregisterClass

WNDCLASSEX

Window Classes

WindowProc