How do I add a "confirm close dialog box" to a FoxPro application that should appear when user clicks close (X) button?

Posted on 2004-11-22
Last Modified: 2013-12-03
I would like a confirmation dialog box ("There are unsaved changes. Are you sure you want to exit?") to appear when a user clicks on the close (X) button on a form in a FoxPro application. If user selects No the existing form should continue to be displayed.

Thank you.
Question by:Vijai
    1 Comment
    LVL 13

    Accepted Solution

    I think you need to handle the WM_CLOSE message. Open the dialog in this handler and only call the terminating function if yes was selected. Else do nothing.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
    This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now