Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to ensure that only one instance of my application is running in my desktop.

Running FPW on Win95, 98, 2000

How to ensure that only one instance of my application is running in my desktop.

by  ramani  Posted    (Edited  )
Your Main.PRG. shall start with the following line...

=myInstance("A name for your Application")

Then just copy the following code and add it at the end of your main.prg.
******************************************
PROCEDURE myInstance
PARAMETERS myApp
=ddesetoption("SAFETY",.F.)
ichannel = DDEINITIATE(myapp,"ZOOM")
IF ichannel =>0
=DDETERMINATE(ichannel)
QUIT
ENDIF
=DDESETSERVICE(myapp,"define")
=DDESETSERVICE(myapp,"execute")
=DDESETTOPIC(myapp,"","ddezoom")
RETURN
******************************************
PROCEDURE ddezoom
PARAMETER ichannel,saction,sitem,sdata,sformat,istatus
ZOOM WINDOW SCREEN NORM
RETURN
**********************************************************
** Ramani (Subramanian.G), FoxAcc, ramani_g@yahoo.com
** EOF
**********************************************************
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top