Focus object

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Reimon
Pro Scripter
Posts: 55
Joined: Wed Mar 31, 2004 4:46 pm

Focus object

Post by Reimon » Thu Jan 24, 2008 12:56 pm

Hello!!!

I am a happy user of Macro Scheduler and I need goto (focus) specified field for enter data that change the position in window in certain circumstances.

For this I need to refer to this field/control with its name. This is possible ?

Very thanks,

Reimon

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Jan 24, 2008 9:30 pm

You *may* be able to get the fields handle via it's class name using the Win 32 API function FindWindowEx. You may then be able to focus it directly.

It may be easier to use image recognition. Does the field have a label or something that uniquely identifies it? If so capture that part of the screen and use FindImagePos to find it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Reimon
Pro Scripter
Posts: 55
Joined: Wed Mar 31, 2004 4:46 pm

Post by Reimon » Thu Jan 24, 2008 10:20 pm

Thanks Marcus.

The window is a Delphi application and I d'ont know if the field have a label or something that uniquely identifies it.

I want to investigate it.


But which you think is the easy way for me ? FindWindowEx or FindImagePos ?


Greetings,

Reimon

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts