General information
Category:
Coding, syntax & commands
>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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only