If your app as a static window title it's pretty easy.
_screen.Caption = "My cool app"
if ( AppAlreadyRunning() ) return endif
messagebox( "here we go" ) return
function AppAlreadyRunning()
local lcCaption, llReturn
lcCaption = _screen.Caption
_screen.Caption = _screen.Caption + sys(2015) && temporarily change the caption
declare integer FindWindow in win32api ; string lpClassName, ; && pointer to class name string lpWindowName && pointer to window name
llReturn = ( FindWindow( .null., lcCaption ) > 0 )
_screen.Caption = lcCaption
return llReturn
|