[bmx] GetGadgetAtPosition by JoshK [ 1+ years ago ]

Started by BlitzBot, June 29, 2017, 00:28:40

Previous topic - Next topic

BlitzBot

Title : GetGadgetAtPosition
Author : JoshK
Posted : 1+ years ago

Description : You have to recompile win32maxgui with the hwnd map made public for this to work.

Code :
Code (blitzmax) Select
SuperStrict

Import maxgui.drivers

?win32
Import pub.win32

Extern "win32"
Function WindowFromPoint:Int(x:Int,y:Int)
EndExtern

Function GetGadgetFromHwnd:TGadget(hwnd:Int)
Return TGadget(TWindowsGUIDriver.GadgetMap.valueforkey(TIntWrapper.Create(hwnd)))
EndFunction

Function GetGadgetAtPosition:TGadget(x:Int,y:Int)
Return GetGadgetFromHwnd(WindowFromPoint(x,y))
EndFunction
?


Comments : none...