This function returns the handle of a window that has a specified relationship to a specified window.
#define INCL_WINWINDOWMGR /* Or use INCL_WIN, INCL_PM, */ #include <os2.h> HWND hwnd; /* Handle of window to query. */ LONG lCode; /* Type of window information. */ HWND hwndRelated; /* Window handle. */ hwndRelated = WinQueryWindow(hwnd, lCode);