Problema mensaje al salir

Aquí puedes preguntar o compartir tus dudas y conocimientos acerca del programa
Resulta que tengo este codigo
if Dialog.Message("Confirmar salida", "Estás Seguro(a) que deseas salir?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2) == 6 then
Application.Exit();
end
lo utilizo en on close y lo que pasa que al darle no igualmente se cierra la pagina ha hi alguna mansera de que no cierre la aplicaccion
Lo que podes hacer es esto te dejo un script que utilizo yo

Global Functions

function SaliEx()

resultado = Dialog.Message("NOMBRE DE TU SISTEMA", "¿Estas seguro que deseas salir de la aplicación?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);

if resultado == 7 then
---La Acción que quieres que haga al cancelar
else
Application.Exit(9);
end

end

Esta función la llamas donde la ocupes por lógica seria el el botón cerrar lo que tendrías que colocar en dicho botón seria lo siguiente:
 SaliEx()

Eso en realidad haria lo mismo lo que pasa es que lo llamas cun una funcion xd
Bien cris te explico, lo que pasa es lo siguiente, como tu dices ese código lo pones en OnClose del proyecto, es decir, cuando se cierra el proyecto se ejecuta ese código, desafortunadamente no te va a funcionar así porque el proyecto ya ha sido cerrado. Lo que debes de hacer es poner ese código en un boton de salir como te dice Agotaras.
QueryAllowProjectClose ( );

In them help file
QueryAllowProjectClose ( )
Called whenever the project is 'told' to close. Using this function, you can control how the user can close the application, such as confirming with the user that they intended to close the application.

Returns:
True if the application should close, false if it should not close.

Example:
function QueryAllowProjectClose()
    result= Dialog.Message("Application Exit", "Are you sure that you want to quit?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
    --if they choose yes 
    if result == IDYES then
        --allow the app to close
        return true;
    else
        --cancel close
        return false;
    end
end
You just place that on the global that is it, no need to add it to your close button

:nyancat: :nyancat: :nyancat: :nyancat: :nyancat: :nyancat: :nyancat:
a ok entonces no se puede hacer nada
YA TE DIJE!!! Usa un botón para salir!!! En configuraciones del proyecto usa el "estilo Flat" y coloca botones de minimizar y cerrar. En de cerrar pon la funcion que te dio Anchobeta
Crea botones para minimizar y salir...para ello debes poner tu proyecto an modalidad flat...de lo contrario te aparecerán los botones de cierre y minimizar que trae por defecto AMS.....cuando ya tengas tu proyecto en formato flat a los botones agregados de minimizar y cerrar ingresa la función que dice Míster Anchoveta........
patch escribió:QueryAllowProjectClose ( );

In them help file
QueryAllowProjectClose ( )
Called whenever the project is 'told' to close. Using this function, you can control how the user can close the application, such as confirming with the user that they intended to close the application.

Returns:
True if the application should close, false if it should not close.

Example:
function QueryAllowProjectClose()
    result= Dialog.Message("Application Exit", "Are you sure that you want to quit?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
    --if they choose yes 
    if result == IDYES then
        --allow the app to close
        return true;
    else
        --cancel close
        return false;
    end
end
You just place that on the global that is it, no need to add it to your close button

:nyancat: :nyancat: :nyancat: :nyancat: :nyancat: :nyancat: :nyancat:
Hola;

@cris690 solo usa el código de @patch en Global Functions como lo dijo en primer lugar @Agotaras123, no se como no te pudo quedar claro :cerealspit-1414026180:

PD: Gracias a todos :mindblown-1414029295: