[This is preliminary documentation and subject to change.]
An application using the PrintDlgEx function can call the GetCurrentDevMode method to fill a DEVMODE structure with information about the currently selected printer.
HRESULT GetCurrentDevMode(
LPDEVMODE lpDevMode,
UINT *pcbSize
);
If the size is zero on input, the function returns the required buffer size (in bytes) in pcbSize and does not use the lpDevMode buffer.
If the method is successful, the return value is S_OK. If no printer is currently selected, the return value is S_OK, the value returned in pcbSize is zero, and the lpDevMode buffer is unchanged.
If an error occurs, the return value is a COM error code. For more information, see Error Handling.
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in commdlg.h.
Common Dialog Box Library Overview, IPrintDialogServices, DEVMODE, PrintDlgEx