void DeviceMode(hWnd,hModule,lpDeviceName,lpOutput)
This function sets the current printing modes for the device identified by the lpDestDevType by prompting for those modes using a dialog box. An application calls the DeviceMode function to allow the user to change the printing modes of the corresponding device. The function copies the mode information to the environment block associated with the device and maintained by GDI.
Parameter | Type/Description | |
hWnd | HWND Identifies the window that will own the dialog box. | |
hModule | HANDLE Identifies the printer-driver module. The application should retrieve this handle by calling either the GetModuleHandle or LoadLibrary function. | |
lpDeviceName | LPSTR Points to a null-terminated character string that specifies the name of the specific device to be supported (for example, Epson FX-80). The device name is the same as the name passed to the CreateDC function. | |
lpOutput | LPSTR Points to a null-terminated character string that specifies the DOS file or device name for the physical output medium (file or output port). The output name is the same as the name passed to the CreateDC function. |
None.
The DeviceMode function is actually part of the printer's device driver, and not part of GDI. To call this function, the application must load the printer device driver by calling LoadLibrary and retrieve the address of the function by using the GetProcAddress function. The application can then use the address to set up the printer.