Table of Contents

OBJECTBYCURSOR Method (System)

Description

This method returns the name of a PS GUI object underneath the cursor.

Syntax

Hwnd = Exec_Method( "SYSTEM", "OBJECTBYCURSOR", ScreenXY, DPIObject )

Parameters

NameRequiredDescription
ScreenXYNoScreen coordinates to use for the search. If these are not passed the current cursor position is used.
DPIObjectNoContains the name of a GUI object (control or form) to use for DPI scaling. If this parameter is passed then the ScreenXY is considered to be scaled to the DPIObject’s DPI (i.e. DIPs rather than pixels), and the ScreenXY will be converted to pixels before the search is made.



This parameter is ignored if the ScreenXY parameter is not passed.

Returns

The name of the PS GUI object under the cursor (or passed screen coordinates), or null otherwise.

Remarks

This method is essentially a wrapper around the Windows API ChildWindowFromPoint function – for further information please see the MSDN website.

Example

 
// Example - find the PS object under the screen cursor

   

   hotID = Exec_Method( "SYSTEM", "OBJECTBYCURSOR", "", "", "" )
 
 
 

See Also

HANDLEBYCURSOR method.