GetGraphicsMode

The GetGraphicsMode function retrieves the current graphics mode for the specified device context.

int GetGraphicsMode(
  HDC hdc   // handle of device context
);
 

Parameters

hdc
Handle to the device context.

Return Values

If the function succeeds, the return value is the current graphics mode. It can be one of the following values.

Value Meaning
GM_COMPATIBLE The current graphics mode is the compatible graphics mode, a mode that is compatible with 16-bit Windows. In this graphics mode, an application cannot set or modify the world transformation for the specified device context. The compatible graphics mode is the default graphics mode.
GM_ADVANCED Windows NT and Windows 98: The current graphics mode is the advanced graphics mode, a mode that allows world transformations. In this graphics mode, an application can set or modify the world transformation for the specified device context.

Windows 95: The GM_ADVANCED value is not supported.


Otherwise, the return value is zero.

Windows NT: To get extended error information, call GetLastError.

Remarks

An application can set the graphics mode for a device context by calling the SetGraphicsMode function.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in wingdi.h.
  Import Library: Use gdi32.lib.

See Also

Coordinate Spaces and Transformations Overview, Coordinate Space and Transformation Functions, SetGraphicsMode