Skip to content

Latest commit

 

History

History
254 lines (197 loc) · 7.93 KB

nf-winuser-getclasslongw.md

File metadata and controls

254 lines (197 loc) · 7.93 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.GetClassLongW
GetClassLongW function (winuser.h)
Retrieves the specified 32-bit (DWORD) value from the WNDCLASSEX structure associated with the specified window. (Unicode)
GCL_CBCLSEXTRA
GCL_CBWNDEXTRA
GCL_HBRBACKGROUND
GCL_HCURSOR
GCL_HICON
GCL_HICONSM
GCL_HMODULE
GCL_MENUNAME
GCL_STYLE
GCL_WNDPROC
GCW_ATOM
GetClassLong
GetClassLong function [Windows and Messages]
GetClassLongW
_win32_GetClassLong
_win32_getclasslong_cpp
winmsg.getclasslong
winui._win32_getclasslong
winuser/GetClassLong
winuser/GetClassLongW
winmsg\getclasslong.htm
winmsg
VS|winui|~\winui\windowsuserinterface\windowing\windowclasses\windowclassreference\windowclassfunctions\getclasslong.htm
12/05/2018
GCL_CBCLSEXTRA, GCL_CBWNDEXTRA, GCL_HBRBACKGROUND, GCL_HCURSOR, GCL_HICON, GCL_HICONSM, GCL_HMODULE, GCL_MENUNAME, GCL_STYLE, GCL_WNDPROC, GCW_ATOM, GetClassLong, GetClassLong function [Windows and Messages], GetClassLongA, GetClassLongW, _win32_GetClassLong, _win32_getclasslong_cpp, winmsg.getclasslong, winui._win32_getclasslong, winuser/GetClassLong, winuser/GetClassLongA, winuser/GetClassLongW
winuser.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
GetClassLongW (Unicode) and GetClassLongA (ANSI)
User32.lib
User32.dll
Windows
19H1
GetClassLongW
winuser/GetClassLongW
c++
APIRef
kbSyntax
DllExport
User32.dll
Ext-MS-Win-NTUser-Windowclass-l1-1-1.dll
ext-ms-win-ntuser-windowclass-l1-1-2.dll
GetClassLong
GetClassLongA
GetClassLongW
ext-ms-win-ntuser-windowclass-l1-1-1 (introduced in Windows 8.1)

GetClassLongW function

-description

Retrieves the specified 32-bit (DWORD) value from the WNDCLASSEX structure associated with the specified window.

Note  If you are retrieving a pointer or a handle, this function has been superseded by the GetClassLongPtr function. (Pointers and handles are 32 bits on 32-bit Windows and 64 bits on 64-bit Windows.)
 

-parameters

-param hWnd [in]

Type: HWND

A handle to the window and, indirectly, the class to which the window belongs.

-param nIndex [in]

Type: int

The value to be retrieved. To retrieve a value from the extra class memory, specify the positive, zero-based byte offset of the value to be retrieved. Valid values are in the range zero through the number of bytes of extra class memory, minus four; for example, if you specified 12 or more bytes of extra class memory, a value of 8 would be an index to the third integer. To retrieve any other value from the WNDCLASSEX structure, specify one of the following values.

Value Meaning
GCW_ATOM
-32
Retrieves an ATOM value that uniquely identifies the window class. This is the same atom that the RegisterClassEx function returns.
GCL_CBCLSEXTRA
-20
Retrieves the size, in bytes, of the extra memory associated with the class.
GCL_CBWNDEXTRA
-18
Retrieves the size, in bytes, of the extra window memory associated with each window in the class. For information on how to access this memory, see GetWindowLong.
GCL_HBRBACKGROUND
-10
Retrieves a handle to the background brush associated with the class.
GCL_HCURSOR
-12
Retrieves a handle to the cursor associated with the class.
GCL_HICON
-14
Retrieves a handle to the icon associated with the class.
GCL_HICONSM
-34
Retrieves a handle to the small icon associated with the class.
GCL_HMODULE
-16
Retrieves a handle to the module that registered the class.
GCL_MENUNAME
-8
Retrieves the address of the menu name string. The string identifies the menu resource associated with the class.
GCL_STYLE
-26
Retrieves the window-class style bits.
GCL_WNDPROC
-24
Retrieves the address of the window procedure, or a handle representing the address of the window procedure. You must use the CallWindowProc function to call the window procedure.

-returns

Type: DWORD

If the function succeeds, the return value is the requested value.

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

-remarks

Reserve extra class memory by specifying a nonzero value in the cbClsExtra member of the WNDCLASSEX structure used with the RegisterClassEx function.

Note

The winuser.h header defines GetClassLong 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

GetClassLongPtr

GetWindowLong

Reference

RegisterClassEx

SetClassLong

WNDCLASSEX

Window Classes