Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Active Window
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00555370
Message ID:
00555419
Vues:
20
>Hi
>
>For example, I have word, internet explorer and a vfp application
>How can I determine if vfp application is the active window?
>
>TIA

Use the API fuction GetForegroundWindow() and compare its results to VFP's window. Depending on the type of application (and version of VFP), you may have to use Foxtools as a help.
DECLARE INTEGER GetForegroundWindow IN Win32API
* Assuming an MDI application with VFP 7.0
lnactive = GetForegroundWindow()
IF _VFP.hwnd = lnactive
  * vfp is active
ELSE
  * it isn't
ENDIF
With previous versions of VFP, you'd use the Foxtools Mainhwnd() function. For an SDI applicaton in 7.0 you'd use the active form's hwnd property. In VFP 6.0 and before you'd use _WFindTitl() and _Whtohwnd() passing the active form's caption. Both of these are in Foxtools.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform