Information générale
Catégorie:
Fonctions API de Windows
>What i'm trying to do is a program that updates files automaticaly, and i need to know if the list of files that i'm going to update are currently running, if they are running then i have to close them and then do the update.
>
>About the GetObject() function, i didn't understand it, is there an example a little bit more simple?.
>
>Thanks.
If you can open a program with CreateOject() or New, as in Set oXL=New Excel.Application, then you can get a reference to the running instance with oXL = GetObject(,"Excel.Application").
But, if you already know what to look for you don't need to enumerate every running program, just specify the window names to the function in MSKB Q176391 (link on my first reply) to close them if they are running.
If the call to FindWindow API fails, (the app is not running) it will return Null.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement