CPrintDialogEx::GetDefaults
Call this function to retrieve the device defaults of the default printer without displaying a dialog box.
BOOL GetDefaults( );
Return Value
TRUE if successful, otherwise FALSE.
Remarks
Creates a printer device context (DC) from the DEVMODE and DEVNAMES structures.
GetDefaults does not display the Print property sheet. Instead, it sets the hDevNames and hDevMode members of m_pdex to handles to the DEVMODE and DEVNAMES structures that are initialized for the system default printer. Both hDevNames and hDevMode must be NULL, or GetDefaults fails.
If the PD_RETURNDC flag is set, this function will not only return hDevNames and hDevMode (located in m_pdex.hDevNames and m_pdex.hDevMode) to the caller, but will also return a printer DC in m_pdex.hDC. It is the responsibility of the caller to delete the printer DC and call the Windows GlobalFree function on the handles when you are finished with the CPrintDialogEx object.
Requirements
Header: afxdlgs.h