Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LoWord.Activate() does not always make Word topmost Window
Message
De
22/08/2005 17:37:03
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
LoWord.Activate() does not always make Word topmost Window
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP SP2
Divers
Thread ID:
01042761
Message ID:
01042761
Vues:
84
In a commandbutton click method I start a Word session (or get a reference to an existing Word session if available), make it open a document, activate the Word session and start a timer. When the timer event fires it sets Interval = 0 and checks if the VFP app is the topmost Window, as suggested by Sergey.

If the app is the topmost Window it then checks if the document is in use, assuming that only Word uses it, which is a safe enough assumption. So far so good. If the document is in use it shows messagebox with instruction to first close editing session via a message box. At this point it activates the Word session with loWord.Activate() and restarts timer. Here is where a problem occurs: the first couple of times if succeeds at making Word the topmost Window, but if user continues to choose the VFP app via the Windows Taskbar, focus will remain in my app while the Word session simply flashes in Windows Taskbar. This is a problem because timer will then keep firing and messaging.

Any ideas?

Thank you very much.

Alex
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform