From EDM2
Jump to: navigation, search

Returns the window handle of a window that has a specified relationship to a specified window.

Syntax: hwndRelated = spQueryWindow ( hwnd , relation ) Parameters:

  • hwnd – Handle of window to be queried.
  • relation – Type of window information to be returned.
Table 5 Relation codes for spQueryWindow
relation code description
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 a window.
QW_PARENT Parent of a window.
QW_NEXTTOP Next window of the owner window hierarchy subject to their z-ordering.
QW_PREVTOP Previous main window.
QW_FRAMEOWNER Owner of hwnd mormalized so that it shares the same parent as hwnd.

Returns: Handle of window related to hwnd.

Example code: (part of spIsWindow example code)

/* wininfo.cmd (spUtils Example Code) */
CALL ShowInfo 'Focus window',hwnd
CALL ShowInfo 'Parent window',spQueryWindow(hwnd,'QW_PARENT')
CALL ShowInfo 'Owner window',spQueryWindow(hwnd,'QW_OWNER')
CALL ShowInfo 'Frame owner',spQueryWindow(hwnd,'QW_FRAMEOWNER')