[win32] DeviceContext

[win32] DeviceContext

  • A context one has to interact with when drawing to the screen
  • It has to be aquired and returned via BeginPaint and EndPaint
HDC BeginPaint(
  [in]  HWND          hWnd,   // handle to the window to be repainted
  [out] LPPAINTSTRUCT lpPaint // out-param; the paint struct we should pass back
                              // to EndPaint, to communicate more information
);
BOOL EndPaint(
  [in] HWND              hWnd,
  [in] const PAINTSTRUCT *lpPaint
);
typedef struct tagPAINTSTRUCT {
  HDC  hdc;
  BOOL fErase;  // if the background should be cleared,
                // (I think automatic when wndclass::hbrBackground was set)
  RECT rcPaint; // the area that should be painted to
  BOOL fRestore;
  BOOL fIncUpdate;
  BYTE rgbReserved[32];
} PAINTSTRUCT, *PPAINTSTRUCT, *NPPAINTSTRUCT, *LPPAINTSTRUCT;
Calendar October 22, 2023