WM_DEVMODECHANGE
lpszDev = (LPCSTR) lParam; /* address of device name */
The WM_DEVMODECHANGE message is sent to all top-level windows when the default device-mode settings have changed.
lpszDev
Value of lParam. Points to the device name specified in the Windows initialization file, WIN.INI.
An application should return zero if it processes this message.
Applications that receive this message may reinitialize their device-mode settings. Applications that use the ExtDeviceMode function to save and restore device settings typically do not process this message.
This message is not sent when the user changes the default printer from Control Panel. In this case, a WM_WININICHANGE message is generated.