Information générale
Catégorie:
Codage, syntaxe et commandes
I use this to determine:
1. If the app is already running (file exists and is open)
2. Something bad was happened last time (file exists and is not open).
If the app crash, windows release the file handle (AFAIK). I didn't knew a thing about API when I choosed this workaround, but worked. Like you said, checking for windows caption can be more reliable.
>Dorin,
>
>>>You can open another file with low level function FOPEN({file},1). If the file is already opened by another app, then FOPEN() returns -1 and FERROR() returns 5 (Acces denied) .
>
>That solution implies that your application starts, creates the file, and eventually exits normally erasing the file. But what happens if your application crashes or there is some other irregular exit? I think checking for a window with your application's caption is probably more reliable.
>
>David
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