PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: John Messingham on December 30, 2005, 12:38:28 PM

Title: Close Down Confirmation
Post by: John Messingham on December 30, 2005, 12:38:28 PM
Hi,

I want to get the user to confirm that they want to shut down and application, with a 'Yes', 'No' message box.

Can someone give me a clue where to put it and how to process the 'no' option.

Many Thanks
Title: Close Down Confirmation
Post by: TechSupport on December 30, 2005, 03:24:00 PM
I assume that you are referring to the situation where the WM_CLOSE message is fired via clicking on the 'X' close button.

Try this:

Function FORM1_WM_CLOSE ( _
                       hWndForm As Dword _  ' handle of Form
                       ) As Long

   If MsgBox( "Close application?", %MB_YESNO, "Confirm") = %IDNO Then
      Function = %TRUE: Exit Function
   End If  
     
End Function
Title: Close Down Confirmation
Post by: John Messingham on December 31, 2005, 06:36:53 AM
Cheers Paul,

Exactly what I was trying to do.

All the best for the new year.