RestoreDC

  BOOL RestoreDC(hdc, nSavedDC)    
  HDC hdc;    
  int nSavedDC;    

The RestoreDC function restores the device context specified by hdc to a previous state identified by nSavedDC. The device context is restored by popping state information off of a stack created by earlier calls to the SaveDC function.

The stack can contain the state information for several instances of the device context. If the context specified by nSavedDC is not at the top of the stack, RestoreDC deletes all state information between the instance specified by nSavedDC and the top of the stack.

Parameters

hdc

Identifies the device context.

nSavedDC

Specifies the instance of the device context to be restored. If positive, nSavedDC represents a specific instance of the device context to be restored. If negative, nSavedDC represents an instance relative to to current device context (e.g. -1 will restore the most recently saved state).

Return Value

The return value is TRUE if the specified instance of the device context was restored. Otherwise, it is FALSE.

See Also

SaveDC