The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed.
WM_DISPLAYCHANGE
cBitsPerPixel = wParam;
cxScreen = LOWORD(lParam);
cyScreen = HIWORD(lParam);
Windows NT: Requires version 4.0 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.
Painting and Drawing Overview, Painting and Drawing Messages