ResetDCA function (wingdi.h)

The ResetDC function updates the specified printer or plotter device context (DC) using the specified information.

Syntax

HDC ResetDCA(
  [in] HDC            hdc,
  [in] const DEVMODEA *lpdm
);

Parameters

[in] hdc

A handle to the DC to update.

[in] lpdm

A pointer to a DEVMODE structure containing information about the new DC.

Return value

If the function succeeds, the return value is a handle to the original DC.

If the function fails, the return value is NULL.

Remarks

An application will typically use the ResetDC function when a window receives a WM_DEVMODECHANGE message. ResetDC can also be used to change the paper orientation or paper bins while printing a document.

The ResetDC function cannot be used to change the driver name, device name, or the output port. When the user changes the port connection or device name, the application must delete the original DC and create a new DC with the new information.

An application can pass an information DC to the ResetDC function. In that situation, ResetDC will always return a printer DC.

ICM: The color profile of the DC specified by the hdc parameter will be reset based on the information contained in the lpInitData member of the DEVMODE structure.

Note

The wingdi.h header defines ResetDC as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

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

See also

DEVMODE

Device Context Functions

Device Contexts Overview

DeviceCapabilities

Escape