Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ulhas Amrite
  Where is Ulhas Amrite?
 Pune
 India
 Ulhas Amrite
 Tags
Subject: Things reqd for My appliaction
Thread ID: 189106 Message ID: 189106 # Views: 3 # Ratings: 0
Version: Visual FoxPro 6 Category: Classes and Objects
Date: Wednesday, August 13, 2008 12:24:33 PM         
   


Dear friends,

Please help me for following
1) I want to display a splash screen for my application
2) I want a background picture on screen as water mark
3) I want to disable second instance of my application on the same machine.
4) I want to close the application by selecting exit from the menu as well as by clicking the [X] on the title bar of the application.
5) When I want to perform some development work I want to give a warning to the existing users that the system will shut down after some (say 1 minute) time and disallow new users to log in to the system.
I already have implemented item 1 thru 4 for my application. I feel for 4th I need to have a top level form containing menu and I am unable to put all things together

Regards,

Ulhas Amrite

I am using following codes
For item 1- a form class named splash is in class-lib “sur_clsl”

_SCREEN.VISIBLE = .F.	&& Hide main vfp window
LOCAL loform
loform = NEWOBJECT("_splash", "..\amrite\classes\sur_clsl")
IF VARTYPE(loform) # "O"
	RETURN
ENDIF
loform.SHOW()	&& display splash screen
_SCREEN
.VISIBLE = .t. && Hide main vfp window

for Item 2
either _screen.picture = “mypicture.jpg”
or if top level form this.image1.picture = “mypicture.jpg”

for Item 3 the code is available on following url

https://www.netacademia.net/tudastar/default.aspx?upid=11227

for Item 4

ON SHUTDOWN DO realquit IN ..\amrite\programs\std_proc		&& exit

PROCEDURE realquit	&& lcmyname obtained in scaffold.prg from admin.dbf

IF MESSAGEBOX([Exit from "] + TRIM(lcmyname) + [" System?], 4+32+256, "System Exit") = 6
	DO WHILE _SCREEN.FORMCOUNT > 0
		_SCREEN.ACTIVEFORM.RELEASE
	ENDDO
	KEYBOARD "y"
	SET SYSMENU TO DEFAULT
	use suryalog shared
	delete for upper(machine) = left(upper(sys(0)),10) and trim(UPPER(user)) = trim(UPPER(loguser))
	CLEAR ALL
	CLOSE ALL	
	QUIT
ENDIF


for item 5 – I use a class “timershut” based on “timer” code is below

IF m.pnshutseconds = 0
	IF FILE("DoShut.txt")
		m.pnshutseconds = VAL(FILETOSTR("DoShut.txt"))
		m.ptshuttime = DATETIME()+VAL(FILETOSTR("DoShut.txt"))
	ENDIF
ENDIF
IF m.pnshutseconds > 0
	WAIT WINDOW "Maintenance shutdown called by " + ;
		"system administrator" + CHR(13)+ ;
		"please close down your application before " + ;
		"the forced shutdown."+ CHR(13)+ CHR(13)+;
		"shutdown time "+TTOC(m.ptshuttime) + CHR(13)+ ;
		"current time is "+TTOC(DATETIME()) NOWAIT NOCLEAR
	IF DATETIME() > m.ptshuttime
		WAIT CLEAR
		THISFORM.RELEASE()
	ENDIF
ENDIF


ENTIRE THREAD

Things reqd for My appliaction Posted by Ulhas Amrite @ 8/13/2008 12:24:33 PM
RE: Things reqd for My appliaction Posted by Stefan Wuebbe @ 8/13/2008 1:05:01 PM
RE: Things reqd for My appliaction Posted by Ulhas Amrite @ 8/13/2008 4:39:28 PM
RE: Things reqd for My appliaction Posted by Anil Sharma @ 8/13/2008 7:52:28 PM
RE: Things reqd for My appliaction Posted by Stefan Wuebbe @ 8/13/2008 7:42:52 PM
RE: Things reqd for My appliaction Posted by Yousfi Benameur @ 8/14/2008 3:47:08 AM