---
name: "SetWindowSubclass"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/SetWindowSubclass"
---

# SetWindowSubclass(3w)

## NAME

**SetWindowSubclass** (COMCTL32.410)

## SYNOPSIS

BOOL SetWindowSubclass\
  (\
   HWND         *hWnd*,\
   SUBCLASSPROC *pfnSubclass*,\
   UINT\_PTR     *uIDSubclass*,\
   DWORD\_PTR    *dwRef*\
  )

## DESCRIPTION

Starts a window subclass.

## PARAMS

*hWnd* **\[In\]**  handle to window subclass.

*pfnSubclass* **\[In\]**  Pointer to new window procedure.

*uIDSubclass* **\[In\]**  Unique identifier of subclass together with *pfnSubclass*.

*dwRef* **\[In\]**  Reference data to pass to window procedure.

## RETURNS

**Success:** non-zero

**Failure:** zero.

## BUGS

If an application manually subclasses a window after subclassing it with this Api and then with this Api again, then none of the previous subclasses get called or the original window procedure.

## IMPLEMENTATION

Declared in **"commctrl.h"**.

Implemented in **"dlls/comctl32/commctrl.c"**.

Debug channel **"commctrl"**.
