Graphics::FromHWND method (gdiplusgraphics.h)

The Graphics::FromHWND method creates a Graphics object that is associated with a specified window.

Syntax

Graphics * FromHWND(
  [in] HWND hwnd,
  [in] BOOL icm
);

Parameters

[in] hwnd

Type: HWND

Handle to the window that will be associated with the new Graphics object.

[in] icm

Type: BOOL

Optional. Boolean value that specifies whether the new Graphics object applies color adjustment according to the ICC profile associated with the display device. TRUE specifies that color adjustment is applied, and FALSE specifies that color adjustment is not applied. The default value is FALSE.

Return value

Type: Graphics*

This method returns a pointer to the new Graphics object.

Requirements

Requirement Value
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdiplusgraphics.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See also

Changes in the Programming Model

FromHDC Methods

Graphics

Graphics Constructors

Graphics::FromImage

Graphics::GetHDC