Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
This can't be impossible to do
Message
From
30/03/2002 15:01:39
 
 
To
30/03/2002 14:07:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00639169
Message ID:
00639177
Views:
23
I tried your code and it too only works if all forms are modeless. If a modal form is on screen it does not release.
I added code to check forms collection after releaseallforms() and it
shows that all forms are not released when the active form is modal.
Yours does not hang due to iterating through the forms collection
for i = 1 to _screen.formcount step -1, but it does not shutdown either
unless user interactively closes the modal form. I am looking for a way
to programatically close a modal screen when a user leaves for the day with a modal screen displayed.
procedure	TerminateApplication()
	=ReleaseAllForms()
	clear events
	on shutdown
        quit
return

procedure	ReleaseAllForms()	
	local i, obj

	for i = _Screen.FormCount to 1 step -1
		obj = _screen.Forms[i]
		if( type('obj') == "O" )	&& may have disappeared
			if( pemstatus(Obj, 'Release',5) )
				=Obj.Release()
				obj = .null.
				release obj
			endif
		endif
	endfor
		=strtofile("Forms collection "+chr(13)+chr(10) ,"shutdowntrace.txt",.t.)
		for m.xx = 1 to _screen.formcount
			=strtofile("_screen.forms("+alltrim(str(m.xx))+") = "+_Screen.forms(m.xx).name+chr(13)+chr(10) ,"shutdowntrace.txt",.t.)
		next
		=strtofile("End of Forms collection "+chr(13)+chr(10)+chr(13)+chr(10) ,"shutdowntrace.txt",.t.)

endproc
*---------------------------------------------------------------------------
I have a test program with modeless, modal, browse and message boxes to test this.
If you would like to take a stab at it, let me know and I can send it to you. I appreciate any help.

Elmer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform