Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP Loses Focus after creating IE object
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
VFP Loses Focus after creating IE object
Divers
Thread ID:
00606306
Message ID:
00606306
Vues:
83
This is a bug report AND a request for a workaround from my VFP guru
buddies...

This one has been really bugging us for a few days now. In order for this to
show the problem, you have to create a project and put the following program
in it and compile it to an EXE. Also, make sure that Internet Explorer is not currently running.

WAIT WINDOW TIMEOUT 2 "About to load IE in 2 seconds"
loIE = CREATEOBJECT("internetexplorer.application")
WAIT WINDOW TIMEOUT 3 "IE is now loaded. Ending in 3 seconds..."

You'll notice that when the 2nd wait window is displaying, VFP is not the
active window. The user has to click on the VFP window in order to start
using the application. We can fix this in interactive mode (when we run from
source code) by placing a MESSAGEBOX("Msg",0,"Caption",1) after the
"loIE=..." statement but it doesn't work when run from an EXE.

We've tried fixing the problem this way (and various things similar to this)
but it still doesn't do the trick for us:

* Because the creation of IE above can make the Phoenix window suddenly not
be
* active (you have to click in it to make the VFP window active again), we
need
* to manually bring the VFP window to the front again and make it active.
lnVFPhWnd = _VFP.hWnd
IF GetForegroundWindow() <> lnVFPhWnd
* The foreground window is NOT VFP (this window).
* Bring VFP to top and set it as the foreground window.
=BringWindowToTop(lnVFPhWnd)
=SetForegroundWindow(lnVFPhWnd)
ENDIF
Scott Alvord, MBA-MCA
Répondre
Fil
Voir

Click here to load this message in the networking platform