multiple instances of standalone under Windows

Jan Schenkel janschenkel at yahoo.com
Fri Jan 30 04:16:04 EST 2004


--- Chris Sheffield <revlist at cableone.net> wrote:
> Does anyone have a way to check if another instance
> of a standalone is
> already running, and if so close the one that was
> just opened?  I have an
> application running under Windows and need to keep
> the user from opening
> multiple instances of it.  Is there a way to do
> this?
> 
> I've tried using 'if there is a process
> "ProcessName"', but that doesn't
> seem to be working.  Maybe I'm just using it
> incorrectly?  Any ideas would
> be appreciated.
> 
> Chris Sheffield
> 

Hi Chris,

There should be a way to do this on Windows via
Dynamic Data Exchange API -- here's something I copied
from a FoxPro forum a while back :

=====
=ddesetoption("SAFETY",.F.)
ichannel = DDEINITIATE("myapp","ZOOM")
IF ichannel =>0
    =DDETERMINATE(ichannel)
    QUIT
ENDIF
=DDESETSERVICE("myapp","define")
=DDESETSERVICE("myapp","execute")
=DDESETTOPIC("myapp","","ddezoom")

PROCEDURE ddezoom
    PARAMETER  ichannel, saction, sitem, sdata, ;
               sformat,istatus
    ZOOM WINDOW SCREEN NORM
    RETURN 

has the added advantage that, if the user starts up a
second instance the first instance gets maximized.
=====

Check out the DDE-externals that Tuviah wrote ages
ago, at the old Crossworlds website :
<http://www.xworlds.com/metacard/external.htm>

If you need a hand converting the above xBase code
into xTalk, let me know.

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/


More information about the use-livecode mailing list