Information générale
Catégorie:
Codage, syntaxe et commandes
>I remember using the foxtools library to ensure that only one instance of my app was running, but I seem to have misplaced that code :)
>
>Has anyone else used foxtools to accomplish this and could you post / email me a sample of your code?
>
>TIA
How about this Larry?
set libr to foxtools.fll
* FindWindow() takes two parameters and returns the handle of the
* window, HWND, if it was found.
getwind = regfn("FindWindow", "CC", "I")
setactwind = regfn("SetActiveWindow", "I", "I")
*Set the first parameter of the call to getwind to 0, null.
wclass=0
winname="THIS APP" && this should be name that appears in main title bar
apphand=callfn(getwind,wclass ,winname)
*If the call was successful, stop processing.
IF apphand<>0
=msgbox('Cannot run multiple copies of THIS APP','Notice',16)
lastwind=callfn(setactwind,apphand)
QUIT
ENDIF
set libr to
I think I got this from a KB article. HTH
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