If a device context handle is specified, this example determines which window is associated with that device context.

#define INCL_WINWINDOWMGR
#include <OS2.H>
HWND hwnd;
HDC hdc;

/* Assume the device context for a window has been opened in     */
/* some other window procedure. We would like to get             */
/* a handle to that window.                                      */

/* This function is called in some other window:            */
/*   hdc = WinOpenWindowDC(hwnd);                             */


hwnd = WinWindowFromDC(hdc);


[Back] [Next]