Subject Re: closing form with windows
From Mervyn Bick <invalid@invalid.invalid>
Date Wed, 27 Jan 2021 09:16:54 +0200
Newsgroups dbase.getting-started

On 2021/01/25 03:50, Leslie Shewchuk wrote:
> You can use the form.CanClose() to stop it from working.  Just add a flag variable to the form when you open it.  Use the CanClose() to see if the flag is still set.  In the event where you DO want the form to close (in this example, by pressing the button) set the flag to allow the close and then call form.close()
>

This is a workable solution but it does have one disadvantage.  It
doesn't change the appearance of the system close button.

By using the ModifyMenu() or DestroyMenu() function from the Windows32
API the button is greyed out so that the user can see it isn't available
to close the form.

Mervyn.