Jump to content

Can You Get Focus Of A Hidden Control?


fmen
 Share

Recommended Posts

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
Link to comment
Share on other sites

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

Try using WinActivate


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

Link to comment
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?

Link to comment
Share on other sites

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


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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...