win12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
WinOpenWindowDC (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINWINDOWMGR
 
HDC WinOpenWindowDC(hwnd)
HWND hwnd;    /* handle of the window */
 
The WinOpenWindowDC function opens a device context for a window.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hwnd       Identifies the window with the device context.
 
Return Value
 
The return value is the handle of the device context.
 
Comments
 
Only one device context can be opened for each window.
 
A handle to a device context is used to associate a presentation space with
the window.
 
The window device context is automatically closed when its associated window
is destroyed. It must not be closed with the DevCloseDC function.
 
This function is used by applications that typically have a lot of state
information associated with a presentation space, such as coordinate mapping
transforms, attributes, fonts, etc. This interface provides a "global"
presentation space for a given window. This global can be kept in the
application until the window is destroyed.
 
See Also
 
WinQueryWindowDC