RestoreDC

Syntax

BOOL RestoreDC(hDC,nSavedDC)

This function restores the device context specified by the hDC parameter to the previous state identified by the nSavedDC parameter. The RestoreDC function restores the device context by copying state information saved on the context stack by earlier calls to the SaveDC function.

The context stack can contain the state information for several device contexts. If the context specified by nSavedDC is not at the top of the stack, RestoreDC deletes any state information between the device context specified by the nSavedDC parameter and the top of the stack. The deleted information is lost.

Parameter Type/Description  

hDC HDC Identifies the device context.  
nSavedDC int Specifies the device context to be restored. It can be a value returned by a previous SaveDC function call. If nSavedDC is –1, the most recent device context saved is restored.  

Return Value

The return value specifies the outcome of the function. It is TRUE if the specified context was restored. Otherwise, it is FALSE.