Archive: How to capture the Back Event?


How to capture the Back Event?
nsDialogs has OnBack Function to caputer back event.

How InstallOptions and the default UI of NSIS capture the back event?
(How NSIS know it will go back to the front page when the 'Back' button is clicked?)

I want to deal with that event.


Thanks for help!!!!:up: :up:


Copied from IO documentation,

Return value
After a dialog is created (using display or show), a return value is available:

* success - The user has pressed the Next button
* back - The user has pressed the Back button
* cancel - The user has pressed the Cancel button
* error - An error has occurred, the dialog cannot be displayed.

You only have to check this value if you need something really special, such as doing something when the user pressed the Back button.

If you need the return value, use the INSTALLOPTIONS_DISPLAY_RETURN or INSTALLOPTIONS_SHOW_RETURN macro. The return value will be added to the stack, so you can use the Pop command to get it.

Thank you.I solved the problem with your method.
***************************************
##[Field 1]is a RadioButton###

Before initializing dialog,I use the following way.After showing the dialog,the RadioButton is checked.

WriteINIStr installType.ini "Field 1" "State" 1

But If I use another way,the RadioButton is not checked.

StrCpy $Value 1
WriteINIStr installType.ini "Field 1" "State" $Value

What's the reason?


Probably $value contains no supported string (either 1 for checked or 0 for no checked).

By the way it's not my method, it is the IO documentation which is a nice edition ;)


It's my fault.
I defined $Value for the front page.
I want to use the $Value at the next page.Before using it,I want to empty $Value.
Is my method right?

Pop $Value
or
StrCpy $Value ""


StrCpy $value "" is the right method.