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

# SHSetParentHwnd(3w)

## NAME

**SHSetParentHwnd** (SHLWAPI.167)

## SYNOPSIS

HWND SHSetParentHwnd\
  (\
   HWND *hWnd*,\
   HWND *hWndParent*\
  )

## DESCRIPTION

Change a window's parent.

## PARAMS

*hWnd* **\[In\]**  Window to change parent of.

*hWndParent* **\[In\]**  New parent window.

## RETURNS

The old parent of *hWnd*.

## NOTES

If *hWndParent* is **NULL** (desktop), the window style is changed to **WS\_POPUP**. If *hWndParent* is **NOT** NULL then we set the **WS\_CHILD** style.

## IMPLEMENTATION

Exported by ordinal only. Use **[GetProcAddress(3w)](/GetProcAddress/3w.md)** to obtain a pointer to the function.

Implemented in **"dlls/shlwapi/ordinal.c"**.

Debug channel **"shell"**.
