oi10:presentation_server:handlebycursor_method_system

HANDLEBYCURSOR Method (System)

This method returns the handle (HWND) of a GUI object underneath the cursor.

Hwnd = Exec_Method( "SYSTEM", "HANDLEBYCURSOR", ScreenXY, FormOnly, DPIObject )

NameRequiredDescription
ScreenXYNoScreen coordinates to use for the search. If these are not passed the current cursor position is used.
FormatOnlyNoIf TRUE$ then this method returns the handle of the parent form under the cursor, rather than any child windows.
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.

The handle (HWND) of the GUI object under the cursor (or passed screen coordinates). This handle can be a non-PS object.

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

 
// Example - find the object under the screen cursor and check if it's a

   // PS object.

   

   hwndHot = Exec_Method( "SYSTEM", "HANDLEBYCURSOR", "", "", "" )

   

   if hwndHot then

      hotID = Exec_Method( "SYSTEM", "OBJECTID", hwndHot )

      if bLen( hotID ) then

         // We have a PS object underneath the cursor

      end

   end
 
 
 

OBJECTBYCURSOR method, OBJECTID method, Common GUI HANDLE property.

  • oi10/presentation_server/handlebycursor_method_system.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1