int ExtDeviceMode(
HWND hWnd,
HANDLE hDriver,
LPDEVMODE lpDevModeOutput,
LPSTR lpDeviceName,
LPSTR lpPort,
LPDEVMODE lpDevModeInput,
LPSTR lpProfile,
WORD wMode
);
Retrieves or modifies device-initialization information for a given graphics driver, or displays a driver-supplied dialog box for configuring the graphics driver. Applications call the ExtDeviceMode function when the user requests setting up the printer as part of preparing for a print job.
All printer drivers must export the ExtDeviceMode function.
DM_UPDATE (1) | Writes the driver's current settings to the environment and the WIN.INI initialization file. |
DM_COPY (2) | Writes the driver's current settings to the DEVMODE structure identified by the lpDevModeOutput parameter. The calling application must allocate a buffer sufficiently large to contain the information. If this bit is clear, lpDevModeOutput can be NULL. |
DM_PROMPT (4) | Presents the driver's dialog box and then changes the current settings according to user specifications. |
DM_MODIFY (8) | Changes the printer driver's current settings to match the partial initialization data in the DEVMODE structure identified by lpDevModeInput before prompting, copying, or updating the printer driver's setting. |
The export ordinal for this function is 90.
If wMode includes DM_PROMPT, the ExtDeviceMode function creates an application-modal dialog box using the DialogBox function (USER.240). The dialog box must provide options for the user to set the various settings of the device. ExtDeviceMode does the following:
The dialog box must provide at least a title bar and OK and Cancel buttons in addition to controls for the various operating modes. The title bar should contain the name of the current printer model (if the driver supports several models), but no other printer model information should be presented in the dialog box. (The ExtDeviceMode dialog box cannot permit the user to change device models.)
If a device has too many options to fit in a single dialog box, ExtDeviceMode can provide nested dialog boxes, using buttons in the first dialog box to access the others. In all cases, a dialog function for a ExtDeviceMode dialog box must close the dialog box if it receives a WM_COMMAND message with the wParam parameter set to IDCANCEL. This message occurs when the user presses the ESC key, chooses the Cancel button in the dialog box, or when Windows Help needs to close the dialog box in order to respond to a request for help from another application.