Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6085311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:37:30+00:00 2026-05-23T11:37:30+00:00

My FoxPro program has a quit button and the usual min/max/X buttons in the

  • 0

My FoxPro program has a quit button and the usual min/max/X buttons in the top right, and when using either the program disappears and seems to have closed properly. However, when I check my Task Manager, I find that it is still running.

This is my main.prg file:

ON SHUTDOWN CLEAR EVENTS
with _screen
.visible = .f.
endwith

DO FORM locations\form1
READ EVENTS
ON SHUTDOWN 

and this is the code for my exit button ‘click’ event:

unlock all
close database all
clear events
RELEASE ALL
quit

My program has only the one form and it’s set as top-level… any suggestions as to how I can fix this?

Thanks for your time and help 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:37:30+00:00Added an answer on May 23, 2026 at 11:37 am

    If you are running VFP originating from the IDE (Development environment), and you do _Screen.Visible = .F., you are HIDING the main VFP screen, and the system may be returning directly to that, and since you can’t see it, you cant formally quit.

    In your MAIN.PRG, put the following down at the bottom as a separate “function” that will be visible within the call stack.

    function CloseMyApp
       */ For now, just to "ignore" any errors of any dangling objects trying to get released
       */ and otherwise might be HIDING an error upon shutdown.
       on error *
    
       */ NOW, clear the event handler and close everything else down
       clear events
       close database all
       close tables
       on shutdown 
    
       quit
    endfunc 
    

    Then, in your start, change your ON SHUTDOWN to call this “function”… Right now, you are only issuing a single command of clear events. This way, you can wrap up a bunch of “cleanup” operations before closing, and not just clearing the read events.

    ON SHUTDOWN Do CloseMyApp in Main.PRG
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know zilch about FoxPro, but we're using a product that has a FoxPro
I have a datatable which has been dynamically generated from FoxPro tables using a
I'm writing a C# program to convert a FoxPro database to XML, and everything
I need to open foxpro free tables in vb.net using the oledb connection. But...
Is there a reasonable way to access FoxPro databases using LINQ?
I have a program written in foxpro (~shudder~) that I've inherited. The issue is,
Can we connect to a dBAse/FoxPro .dbf file on Linux using JDBC?
Has anyone out there got experience of calling a Visual FoxPro report from a
I have to convert .DBF and .FPT files from Visual FoxPro to MySQL. Right
I am trying to pull data from DBF files into my program using C#.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.