Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: Ulhas Amrite
  Where is Ulhas Amrite?
 Pune
 India
 Ulhas Amrite
 Tags
Subject: RE: Things reqd for My appliaction
Thread ID: 189106 Message ID: 189243 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: Classes and Objects
Date: Thursday, August 14, 2008 3:47:08 AM         
   


> 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


Hi Amrite
I answer you additive for few questions
1-I give you my program for killing any executable application (i say well ANY)
(windowrd.exe,excel.exe,vfp9.exe,vfp6.exe.....)
*Killing any executable application
*Yousfi Benameur Aug 14 2008

yKill('Excel.exe')

function ykill
lparameters yexe
LOCAL loWMI, lcQuery, loResult, loProcess
loWMI = GetObject("winmgmts://")
lcQuery = '"select * from win32_process where name='+"'"+yexe+"'"+ ' "'
aa=&lcQuery
loResult = loWMI.ExecQuery(m.aa)     
if messagebox(trans(loResult.count)+" application(s) running .Terminate ?!",4+64,"Terminate application")=6
FOR EACH loProcess IN loResult
	loProcess.Terminate(0)
NEXT

endi

endfunc



2-Generally a splash is a form with showwindow=2 that lives for 3-4 sec and diappear
(with a timer interval=3000).That is classic.you can even add a fading effect at disappearing.

I send you a non classic splash coded with vfp and internet explorer with sound,transitions...Replace photos with your and run the form you want to play after this.

https://www.foxite.com/uploads/5a9d77e5-8d9d-43ca-b594-a6ba447ddb18.zip
Regards
Yousfi Benameur

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