This function opens a device context for a window.
#define INCL_WINWINDOWMGR /* Or use INCL_WIN, INCL_PM, Also in COMMON section */ #include <os2.h> HWND hwnd; /* Window handle. */ HDC hdc; /* Device-context handle. */ hdc = WinOpenWindowDC(hwnd);