Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
API Function to detect and close a program?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00068236
Message ID:
00068270
Vues:
20
>I am trying to write some functions in VFP 5.0 to set up an OLE session with Novell's GroupWise 5 package. The program needs to be able to log into GroupWise using a specific email id, retrieve the messages for that id and process them. I've got code set up to do this, and it all works fine except for when GroupWise is already running with a different user's mailbox, or when Notify is running (a GroupWise program that runs in the Win95 system tray to watch for new messages).
>
>What I would like to know first of all, is if anybody knows of an API function that will detect both of these programs? I can find GroupWise using the FindWindow function, however, this does not work for Notify which exists only in the system tray. Ideally, does anyone know of a function that would return all running programs like you get when you press CTRL+ALT+DELETE?
>
>Second, once the programs have been detected, I would like to present a dialog box asking the user if he/she wants the detected GroupWise program to be closed. If the answer is yes, I want Foxpro to shut down the GroupWise program, and continue processing Once again, the ideal function here would be similar to pressing the "End Task" button in the Close Programs dialog when CTRL+ALT+DELETE is pressed.
>
>Any help will be greatly appreciated.
>
>Thanks in advance.
>
>- Eric Rolfe
>erolfe@networkbta.com

Eric,

I've written a couple of functions which are available in the Files/Win32 & Other APIs section that will tell you if a particular application is running based on the known portion of the title bar.

As to shutting down the application, that can be a rather tricky business. If the application was already active when VFP started up, I don't know if it's possible. The easiest way, if the application is DDE enabled, is to use that to tell it to shut itself down.

hth,

George
George

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

Click here to load this message in the networking platform