win12.hlp (Table of Contents; Topic list)
WinQueryWindow (1.2)
Function Group  Overview  Changes               Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINMESSAGEMGR
 
HWND WinQueryWindow(hwnd, cmd, fLock)
HWND hwnd;     /* handle of the window     */
SHORT cmd;     /* which window to retrieve */
BOOL fLock;    /* lock/unlock flag         */
 
The WinQueryWindow function retrieves the handle of a window that has a
specified relationship to a specified window.
 
If WinQueryWindow is used to enumerate windows of other threads, it is not
guaranteed that all the windows are enumerated, because the Z ordering of
the windows may change during the enumeration. The WinGetNextWindow function
must be used for this purpose.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hwnd       Identifies a window. The window handle retrieved is relative to
           this window, based on the value in the cmd parameter.
 
cmd        Specifies which window to retrieve. The following are the
           possible values:
 
           Value          Meaning
           ─────────────────────────────────────────────────────────────────
           QW_NEXT        Next window in Z order (window below).
 
           QW_PREV        Previous window in Z order (window above).
 
           QW_TOP         Topmost child window.
 
           QW_BOTTOM      Bottommost child window.
 
           QW_OWNER       Owner of the window.
 
           QW_PARENT      Parent of window; HWND_OBJECT if object window.
 
           QW_NEXTTOP     Next main window in the enumeration order defined
                          for the ALT+ESCAPE function of the user
                          interface.
 
           QW_PREVTOP     Previous main window, in the enumeration order
                          defined by QW_NEXTTOP.
 
           QW_FRAMEOWNER  Returns the owner of hwnd, normalized so that it
                          shares the same parent as hwnd.
 
fLock      This parameter is ignored by MS OS/2 versions 1.2 and later.
 
Return Value
 
The return value is the handle of the window related to the window
identified by the hwnd parameter.
 
See Also
 
WinGetNextWindow, WinLockWindow