Jump to content

WinWindowFromPoint

From EDM2

This function finds the window below a specified point, that is a descendant of a specified window.

Syntax

WinWindowFromPoint(hwndParent, pptlPoint, fEnumChildren)

Parameters

hwndParent (HWND) - input
Window handle whose child windows are to be tested.
HWND_DESKTOP
The desktop-window handle, implying that all main windows are tested. In this instance, pptlPoint must be relative to the bottom left corner of the screen.
Other
Parent-window handle.
pptlPoint (PPOINTL) - input
The point to be tested.
Specified in window coordinates relative to the window specified by the hwndParent parameter.
fEnumChildren (BOOL) - input
Test control.
TRUE - Test all the descendant windows, including child windows of child windows
FALSE - Test only the immediate child windows.

Returns

hwndFound (HWND) - returns
Window handle beneath pptlPoint.
NULLHANDLE - pptlPoint is outside hwndParent
Parent - pptlPoint is not inside any of the children of hwndParent
Other - Window handle is beneath pptlPoint.

Errors

Possible returns from WinGetLastError

PMERR_INVALID_HWND (0x1001)
An invalid window handle was specified.

Remarks

This function checks only the descendants of the specified window.

Example Code

This example calls WinWindowFromPoint to find out if any main windows are beneath point 100,100.

#define INCL_WINWINDOWMGR
#include <os2.h>

HWND hwndunderneath;
POINTL point = {100L, 100L};
hwndunderneath = WinWindowFromPoint(HWND_DESKTOP,
                                    &point,
                                    FALSE); /* do not test the */
                                            /* descendants of  */
                                            /* the main        */
                                            /* windows.        */

Related Functions

  • WinEnableWindow
  • WinIsThreadActive
  • WinIsWindow
  • WinIsWindowEnabled
  • WinQueryDesktopWindow
  • WinQueryObjectWindow
  • WinQueryWindowDC
  • WinQueryWindowProcess
  • WinQueryWindowRect
  • WinWindowFromDC
  • WinWindowFromID