fmen Posted November 1, 2005 Share Posted November 1, 2005 (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 November 1, 2005 by fmen Link to comment Share on other sites More sharing options...
BigDod Posted November 1, 2005 Share Posted November 1, 2005 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 More sharing options...
fmen Posted November 1, 2005 Author Share Posted November 1, 2005 I am not sure if I understand correctly but here goes.Try using WinActivateWinActivate 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 More sharing options...
herewasplato Posted November 1, 2005 Share Posted November 1, 2005 Grasping at straws here.... What does ControlEnable followed by a ControlFocus do for you? [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
BigDod Posted November 1, 2005 Share Posted November 1, 2005 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 More sharing options...
fmen Posted November 1, 2005 Author Share Posted November 1, 2005 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. Link to comment Share on other sites More sharing options...
herewasplato Posted November 1, 2005 Share Posted November 1, 2005 ...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] Link to comment Share on other sites More sharing options...
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