jgg Posted May 5, 2004 Posted May 5, 2004 Hello outthere! I want to read a text in a window in a program which have several windows where only one can have focus. The only way to see which window i want focus on is by LastControUnderMouse. I then will use controlgettext for the LastControUnderMouse and write that value to a text-file. I can't get autoit-syntax to get focus to lastcontrolundermouse, anyone knowing how? >>>>>>>>>>>>( Window Title )<<<<<<<<<<<<< Friendly Börs AT (OMX 0.00 ( 0.00% )) ( classname=Fbi5MdiFrame ) >>>>>>>>>>>( Mouse Position )<<<<<<<<<<<< On Desktop: x: 437 y: 716 In Window: x: 441 y: 720 >>>>>>>>>>>>>( Pixel Color Under Mouse)<<<<<<<<<<<<< Dec: 16673282 Hex: 0xFE6A02 >>>>>>>>>>>( Window Position )<<<<<<<<<<< left: -4 top: -4 width: 1288 height: 1032 >>>>>>>>( Last Control Under Mouse )<<<<<<< Class: BorsTradeChild1 Text: OMX4E 694.75 ( 7.00, 1.02% ) >>>>>>>>>( Status Bar Text )<<<<<<<< The code: Opt("WinTitleMatchMode",4) ControlFocus("", "", "Fbi5MdiFrame") $var = ControlGetText("", "", "BorsTradeChild1") MsgBox(0, "Visa",$var,4)
jgg Posted May 6, 2004 Author Posted May 6, 2004 Seems that it isn't possible to solve according to no response. Any other ideas, shall i position the mouse in certain x-y-pixel position and read the value?. Isn't there anyone out there having done this before?
scriptkitty Posted May 6, 2004 Posted May 6, 2004 not sure on your exact question actually. Must be too early for me atm. Anyway, since you are talking about multiple windows, make sure to use: Opt("WinSearchChildren", 1) ;0=no, 1=search children also Also controlgettext reads the text of that control, so if it is not a standard control it won't retrieve the text that way. Also you use a different approach for getting the text in a dropdown menu and such. You can use standard copy commands on many programs as well. I will reread your post after I get some coffee. AutoIt3, the MACGYVER Pocket Knife for computers.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now