Condividi tramite


Disegno su un controller di dominio che si estende su più schermi

Per rispondere a un messaggio di WM_PAINT , usare codice simile al seguente.

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

Per disegnare la metà superiore di una finestra, usare codice simile al seguente.

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

Per disegnare l'intero schermo virtuale in modo ottimale per ogni monitor, usare codice simile al seguente.

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