WindowFromDC function

The WindowFromDC function returns a handle to the window associated with the specified display device context (DC). Output functions that use the specified device context draw into this window.

Syntax


HWND WindowFromDC(
  _In_ HDC hDC
);

Parameters

hDC [in]

Handle to the device context from which a handle to the associated window is to be retrieved.

Return value

The return value is a handle to the window associated with the specified DC. If no window is associated with the specified DC, the return value is NULL.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Painting and Drawing Overview
Painting and Drawing Functions
GetDC
GetDCEx
GetWindowDC

 

 

Show: