Sign in to follow this  
Followers 0
fmen

Can You Get Focus Of A Hidden Control?

7 posts in this topic

#1 ·  Posted (edited)

I work on an MDI application with the main frame being a wordprocessing window. For some reason, it takes two clicks on this frame in order to get focus. I hate that. I am trying to write a small script that would allow a single click focus.

Unfortunately, all of the controls on the WP frame are hidden and there are a lot of them. The control that would seem to be the most important to obtain focus is probably "TRichEdit1".

So,

ControlFocus ("Application", "", "TRichEdit1")

and

ControlClick ("Application", "", "TRichEdit1")

do not work. (The caret does not move to the window frame)

Is there any way of getting focus of a hidden control?

Thanks

Edited by fmen

Share this post


Link to post
Share on other sites



I am not sure if I understand correctly but here goes.

Try using WinActivate



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

I am not sure if I understand correctly but here goes.

Try using WinActivate

WinActivate will activate the entire MDI "Application", not the the area in question.

Is there any way of getting focus of a hidden control?

Share this post


Link to post
Share on other sites

Grasping at straws here....

What does ControlEnable followed by a ControlFocus do for you?


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

If you are trying to write to a part of the application you could always try ControlSend.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

WinActivate will activate the entire MDI "Application", not the the area in question.

Is there any way of getting focus of a hidden control?

Yes!!!

ControlEnable seems to do the trick. Thanks.

Share this post


Link to post
Share on other sites

...ControlEnable seems to do the trick. Thanks.

You are welcome.

I've never used ControlEnable - so it truely was grasping at straws for me...


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0