thetford
02-18-2007, 11:57 PM
ok, this is a great function to prevent people from closing the app, but what do I do when I need to close the app without the users input i.e. not showing the dialog confirmation?
--This code asks user to "BE sure that they want to exit"
function QueryAllowProjectClose() --this function will be called when the program is exiting
if close_value
then Application.Exit(0);
else
confirmation = Dialog.Message("NOTICE", "WARNING! \r\ If you close this license manager you will not be able to run Credit Mechanic software.\r\Are you sure you want to Exit?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
if confirmation == 6 then
-- The yes button was pressed, allow program to close (return true)
return true;
else
-- The yes button was NOT pressed, do NOT allow the program to close (Return false)
return false;
end
end
end
I just keep running into problems this weekend!
thanks in advance.
--This code asks user to "BE sure that they want to exit"
function QueryAllowProjectClose() --this function will be called when the program is exiting
if close_value
then Application.Exit(0);
else
confirmation = Dialog.Message("NOTICE", "WARNING! \r\ If you close this license manager you will not be able to run Credit Mechanic software.\r\Are you sure you want to Exit?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
if confirmation == 6 then
-- The yes button was pressed, allow program to close (return true)
return true;
else
-- The yes button was NOT pressed, do NOT allow the program to close (Return false)
return false;
end
end
end
I just keep running into problems this weekend!
thanks in advance.