Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application Focus lost

Status
Not open for further replies.

jeisner

Programmer
Jul 23, 2001
26
0
0
AU
.Lostfocus works fine for a form if another form is opened, however if another application is opened and gets focus the lostfocus of the foremost foxpro application form does not execute.

What can be used to test if the foxpro application itself has lost focus, as even when it does not have focus the foremost form in that application still thinks it has focus.
 
That sounds like jibberish, oops :)

My problem is if a user opens another form say from the menu, I can trap the lost focus in the current form and execute code at that point.

If the user clicks on an application icon for example in there windows toolbar, the currently active foxpro form does not believe it has lost focus, how can I trap that. Or better still in a timer how (what property) can I determine if the foxpro application is the currently active APPLICATION.
 
First, since toolbars don't receive focus then the current control never looses focus. I'm not really sure what you are trying to do. Perhaps with that information, suggestions could be made to help you.

Rick
 
Rick

As I read it, jeisner wants to know how you can determine when the VFP application is no longer on top in the Windows task list?

Perhaps he could confirm. HTH

Chris [pc2]
 
This is not the exact answer you want, but will give you the code that only needs to be twicked to work.

look at the faq184-1998. this is an example how to determin if the window exist and bring to top. you can modify the code to run with a timer event to check to see if your window is on top. Attitude is Everything
 
OK try and be more precise....

My program has a grid on it that refreshes frequently (on a timer) if another window in the program is opened the timer is paused using 'lostfocus', the problem is when they open another application, the foxpro form doesn't realise that it has lostfocus nor does it trigger that it gotfocus when it is another application being run over the top.
 
The last line should read "nor does it trigger that it gotfocus when 'focus' is returned from another application that was being run over the top!
 
danceman, I'll give your solution a shot, I've had a quick look over it and I think it should be able to give me what I want!

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top