Jump to content

WinWindowFromPoint: Difference between revisions

From EDM2
Created page with "This function finds the window below a specified point, that is a descendant of a specified window. ==Syntax== WinWindowFromPoint(hwndParent, pptlPoint, fEnumChildren) ==Pa..."
 
Line 5: Line 5:


==Parameters==
==Parameters==
hwndParent (HWND) - input
;hwndParent (HWND) - input
:Window handle whose child windows are to be tested.


    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.  


    HWND_DESKTOP
;pptlPoint (PPOINTL) - input
        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
:The point to be tested.
        Parent-window handle.  
:Specified in window coordinates relative to the window specified by the hwndParent parameter.  


    pptlPoint (PPOINTL) - input
;fEnumChildren (BOOL) - input
        The point to be tested.
:Test control.


        Specified in window coordinates relative to the window specified by the hwndParent parameter.  
:;TRUE
::Test all the descendant windows, including child windows of child windows
:;FALSE
::Test only the immediate child windows.


    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==
==Returns==
; hwndFound (HWND) - returns
; hwndFound (HWND) - returns

Revision as of 23:28, 6 August 2023

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.        */

Definition

#define INCL_WINWINDOWMGR /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>

HWND       hwndParent;     /*  Window handle whose child windows are to be tested. */
PPOINTL    pptlPoint;      /*  The point to be tested. */
BOOL       fEnumChildren;  /*  Test control. */
HWND       hwndFound;      /*  Window handle beneath pptlPoint. */

hwndFound = WinWindowFromPoint(hwndParent, pptlPoint, fEnumChildren);

Related Functions

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