When the user presses "Cancel" in the GUI, set all hooks and in the hook handler call lua_error. If you need to tell when a script has been canceled in this way, call lua_error with your own error object. --lhf