Making OI active after focus lost to other app. Try this at home (OpenInsight Specific)
At 07 SEP 2000 05:00:12AM Tony Hensby (Medicode Ltd) wrote:
Follow the instructions below and see if you can get OI to be active.
Answers on a postcard or a posting on here would be much appreciated.
We have created a MDI frame with a text control, button and an edit line on
it. There is an edit event on the button as follows
* get window handle
handle=get_property('RC_TEST', 'HANDLE')
* wait 5 secs
tim=time() + 5
loop
until time()=tim do repeat
* set text box to confirm timer elapsed
void=set_property('RC_TEST.TEXT', 'TEXT', 'Timer elapsed!')
* bring win to front
call BringWindowToTop(handle)
* set focus to edit line
void=set_property('RC_TEST.TEST2', 'FOCUS', 1)
RETURN 0
If we run the window then click the button then open explorer so that has focus and is active. After the delay the OI window is brought to the top and focus set in the edit line (cursor is flashing in the edit line) but the window is not active. If you start typing nothing happens in the edit line, explorer is still the active app/window.
We have tried
void=set_property('SYSTEM','FOCUS','RC_TEST.TEST2') to set focus to edit line
We are using OI 3.7.1 but it also happens in 3.7.2
How can we make OI active ?????
Many thanks
Tony H
At 07 SEP 2000 08:59AM Don Bakke wrote:
Tony,
Make the following changes to your code and it should work fine:
* get window handle
MDIFrame=Get_Property('RC_TEST', 'MDIFRAME')
handle=get_property(MDIFrame, 'HANDLE')
At 07 SEP 2000 09:24AM Tony Hensby (Medicode Ltd) wrote:
Don
Thanks for that
Tried it out, works brilliant the first time you click the button then open explorer on top but if you click the button again and bring explorer on top it does not bring the OI window to the top nor give it focus.
Have I missed something
Tony H