Indigo Rose Software
  #1  
Old 10-03-2003
Desmond's Avatar
Desmond Desmond is offline
Indigo Rose Staff Member
 
Join Date: Jul 2003
Posts: 628
Grin Asking the User for Confirmation Before Exiting

AutoPlay Media Studio 5.0 Knowledge Base

Asking the User for Confirmation Before Exiting

Document ID: IR10094
The information in this article applies to:
  • AutoPlay Media Studio 5.0 Standard Edition
  • AutoPlay Media Studio 5.0 Professional Edition

SUMMARY

This article describes how to display a dialog box asking the user if they want to exit the application.

DISCUSSION

In AutoPlay Media Studio 5.0, it is possible to stop closing your application based on user input, even after the close button has been pressed, or the Application.Exit action has been used. This is useful if, for example, you are worried that the user will accidentally close your application, or if you want to allow the user to save their changes before they exit.

To accomplish this, you must include a function (QueryAllowProjectClose) in your Global Functions (Project > Global Functions) that returns true if the program should close, and false if it should not:

--this function will be called when the program is exiting

function QueryAllowProjectClose()

confirmation = Dialog.Message("Are you sure?", "Are you sure that you want to exit?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);



--the yes button was pressed

if confirmation == 6 then

--allow the program to close

return true;

end



--the no button was pressed

if confirmation == 7 then

--tell the program to 'stop closing'

return false;

end



--if for any reason confirmation is not set to yes OR no, allow the program to close

return true;

end
Please note that this function is called internally by your application when it is told to exit. If true is returned, your application will exit. If false is returned, your program will not exit.

KEYWORDS: AutoPlay Media Studio 5.0, Window, Application, Close, Exit, Terminate, Confirmation


Last reviewed: October 3, 2003
Copyright © 2003 Indigo Rose Corporation. All rights reserved.
__________________
Setup Factory 8.0 comes with over 250 actions so you can create smaller, faster and more intelligent software installers than ever before.

WebHelp Guides: AMS | MSIFACT | SUF | TU | VP
  #2  
Old 12-11-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,058
Two Questions:

1. Does this have anything to do with #WM_KILLFOCUS?

2. Can we get more of these tidbits (now for AMS 6)?


Thanks on both fronts in advance, regardless of the turnout.

Sincerely,
__________________
Intrigued
www.amsuser.com
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On



All times are GMT -6. The time now is 07:08 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software