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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RAMANI FAQS..about hiding main windows i have trouble please :( 2

Status
Not open for further replies.

ridifvx

Programmer
Apr 10, 2003
34
ID
Ramani Suggest in faq about Hiding main windows was perfect but..my apps now cannot close properly..it's can't close when i click cross (X in the corner) button or close button

in Unload and destroy event i write this code

CLOSE DATABASES ALL
_SCREEN.Visible = .F.
CLEAR EVENTS

any sugestion so i can close my form only with exit(X) button or close button (not with Ctrl+alt+del) :)

Thanks in advance
 
Create a procedure in your main.prg as follows:

PROCEDURE PropShutdown()
ON SHUTDOWN
*!*Any other clean up code you may want goes here
QUIT
ENDPROC

...Alternate procedure
PROCEDURE PropShutdown()
ON SHUTDOWN
*!*Any other clean up code you may want goes here
IF _vfp.StartMode = 0
Cancel
ELSE
QUIT
ENDIF
ENDPROC

...this alternate takes in to consideration that you don't want the VFP IDE to close down when you are debugging the system.

...and then the last thing you need to do is near the very top of your main.prg put the line:

On Shutdown Do PropShutdown

...the technique I have outlined above will keep you from seeing the "Cannot Quit Foxpro" dialog box when trying to shutdown your applicaiton.

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
HI,

I do follow the elaborate method, slighthaze specified.

But a quick one will be..

Just in the main.prg, before the code..
DO FORM mainForm
or such main starting of event processing

the previous line or earlier to that should be..

ON ShutDown CLEAR EVENTS

This will take care of the things.

:)

ramani :)
(Subramanian.G)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top