Melukis pada DC yang Mencakup Beberapa Tampilan

Untuk merespons pesan WM_PAINT , gunakan kode seperti berikut ini.

case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
EnumDisplayMonitors(hdc, NULL, MyPaintEnumProc, 0);
EndPaint(hwnd, &ps);
 

Untuk melukis bagian atas jendela, gunakan kode seperti berikut.

GetClient Rect(hwnd, &rc);
rc.bottom = (rc.bottom - rc.top) / 2;
hdc = GetDC(hwnd);
EnumDisplayMonitors(hdc, &rc, MyPaintEnumProc, 0);
ReleaseDC(hwnd, hdc);

Untuk melukis seluruh layar virtual secara optimal untuk setiap monitor, gunakan kode seperti berikut.

hdc = GetDC(NULL);
EnumDisplayMonitors(hdc, NULL, MyPaintScreenEnumProc, 0);
ReleaseDC(NULL, hdc);