Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

DefSubclassProc function

Calls the next handler in a window's subclass chain. The last handler in the subclass chain calls the original window procedure for the window.

Syntax


LRESULT DefSubclassProc(
  _In_ HWND   hWnd,
  _In_ UINT   uMsg,
  _In_ WPARAM WPARAM,
  _In_ LPARAM LPARAM
);

Parameters

hWnd [in]

Type: HWND

A handle to the window being subclassed.

uMsg [in]

Type: UINT

A value of type unsigned int that specifies a window message.

WPARAM [in]

Type: WPARAM

Specifies additional message information. The contents of this parameter depend on the value of the window message.

LPARAM [in]

Type: LPARAM

Specifies additional message information. The contents of this parameter depend on the value of the window message. Note: On 64-bit versions of Windows LPARAM is a 64-bit value.

Return value

Type: LRESULT

The returned value is specific to the message sent. This value should be ignored.

Remarks

You do not need to call the default window procedure; this function calls it automatically.

The SUBCLASS module defines helper functions that are used to subclass windows. The code maintains a single property on the subclassed window and dispatches various subclass callbacks to its clients as required. The client is provided reference data and a default processing API.

A subclass callback is identified by a unique pairing of a callback function pointer and an unsigned ID value. Each callback can also store a single DWORD of reference data, which is passed to the callback function when it is called to filter messages. No reference counting is performed for the callback; it may repeatedly call SetWindowSubclass to alter the value of its reference data element.

Warning  You cannot use the subclassing helper functions to subclass a window across threads.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Commctrl.h

Library

Comctl32.lib

DLL

Comctl32.dll (version 5.8 or later)

See also

GetWindowSubclass
SetWindowSubclass
RemoveWindowSubclass

 

 

Community Additions

ADD
Show:
© 2015 Microsoft