Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Prevent form re loading
Message
From
11/02/2002 06:19:56
Max Chen
Yx Software
Shunde, China
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00618011
Message ID:
00618211
Views:
9
Hi,

U can paste the follow segment in the LOAD of you form.

It works for me, plz try it.

max.
LOCAL nLeft,nTop,aList(1),i,lShiftHold
*--prevent multi-instane---------------------- 
lShiftHold=INLIST(gnGetKeyState(0x10),65408,65409)
IF NOT lShiftHold && if shift hold, multi-instance allow
	this.tag=this.name
	this.name='formName1768785215'
	FOR i=1 to _screen.formCount
		if _screen.forms(i).name==guTag
			if _screen.forms(i).windowState=1
				_screen.forms(i).windowState=0
			endif		
			_screen.forms(i).show
			RETURN .f.
		endif	
	NEXT
	this.name=this.tag
ENDIF 	
*--prevent multi-instane----------------------



FUNCTION gnGetKeyState
LPARAMETER tnKey
*- ctl 0x11,   l-ctrl 0xA2, r-ctrl 0xA3
*- shift 0x10, l-shift 0xA0, r-shift 0xA1
*- tab 0x9, zoom 0xFB, capital 0x14
declare integer GetKeyState in win32api integer
RETURN GetKeyState(tnKey)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform