Screen Position of a Control

Started by Jeffrey Ferreira, June 21, 2023, 08:44:27 AM

Previous topic - Next topic

Jeffrey Ferreira

Hello All,

i'm trying to figure out where a pxplus control is positioned relative to the monitor not relative to the pxplus panel.
i'm also not sure what is standard unit of measure for stating this (i think it is pixels)
can anyone help me out?

thanks

jeff

Jeffrey Ferreira

i think i figured it out.
this obj command gave me the position in pixels.
i was then able to reference it in powershell and hover mouse over button..
that is what i was looking for

1520 let WINDOW_OBJ$=obj(0)
1530 let WINDOW_COLUMN=int(dec(WINDOW_OBJ$(21,2)))
1540 let WINDOW_LINE=int(dec(WINDOW_OBJ$(23,2)))
1550 let BUTTON_OBJ$=obj(BUTTON_1.CTL)
1551 let BUTTON_COLUMN=int(dec(BUTTON_OBJ$(21,2)))
1552 let BUTTON_LINE=int(dec(BUTTON_OBJ$(23,2)))

Mike King

Jeffrey,

Why did you want to know the screen position for a control?
Also, for most controls you can reference the 'Top and 'Left properties to get the pixel co-ordinates of a control relative to the window they are in.  This may be easier than using the OBJ function.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Jeffrey Ferreira

Hi Mike,

I'm just experimenting with something where i'm trying to auto click a button if it pops up during an automated process.

jeff