Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check for another application running?
Message
De
17/06/2004 03:58:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
16/06/2004 15:44:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00914414
Message ID:
00914544
Vues:
7
>I have a client who needs to see if another is application is running on a workstation at the same time as a custom built VFP app is running. For example, VFP application A is running and it wants to see if Excel is running. Is there a way to query the OS via a WinAPI call to see if Excel is indeed running and if possible, get an object handle to Excel so that it can be "controlled" by the VFP application.
>
>An outline of the logic is this:
>Is Excel running?
>....Yes, then do this: oExcel = handle returned by the call to the WinAPI
>....No, then do this: oExcel = CreateObject( 'Excel.Application' )
>
>Then code procedes on using the "oExcel" object.
>
>Can this be done?

Kenneth,
George answered already but I wanted to warn you if you're going to do that for Excel, FWIW do not use GetObject(). In its simple form, do not do that because you might never know who created the session and if would be around after your GetObject().
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform