Old 12th April 2017, 13:58   #1
Kalakom
Junior Member
 
Join Date: Apr 2017
Posts: 5
How to know that button was pressed?

Hello ...

code:

!define MUI_PAGE_CUSTOMFUNCTION_LEAVE leavePageComponents
!insertmacro MUI_PAGE_COMPONENTS
...
...
Function leavePageComponents

MessageBox MB_ICONEXCLAMATION|MB_OK "Hello ..."
FunctionEnd



Function "leavePageComponents" is called when I press to "Next" button and press to "Back" button. I don't want the operator "MessageBox" was called when I press to "Back" button. If I will can to know what pressed "Back" button I will call operator "Return" after this and resolve my problem.
Kalakom is offline   Reply With Quote
Old 12th April 2017, 14:13   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,578
Leave is not called there when you press the back button so I don't understand what you are talking about.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 12th April 2017, 14:45   #3
Kalakom
Junior Member
 
Join Date: Apr 2017
Posts: 5
Ok, I did mistake. not "Back" button - use "Cancel" button.
Please, compile this example and press button "Cancel" on component page.

code:
!include "UMUI.nsh"
!insertmacro MUI_PAGE_WELCOME

!define MUI_PAGE_CUSTOMFUNCTION_LEAVE leavePageComponents
!insertmacro MUI_PAGE_COMPONENTS

!insertmacro MUI_PAGE_FINISH
!insertmacro UMUI_PAGE_ABORT
!insertmacro MUI_LANGUAGE "Russian"

Section
SectionEnd

Function leavePageComponents
MessageBox MB_ICONEXCLAMATION|MB_OK "Hello ..."
FunctionEnd

Kalakom is offline   Reply With Quote
Old 12th April 2017, 20:01   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,578
Official NSIS MUI 1&2 will not display that MessageBox on cancel, I don't know what UMUI does...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th April 2017, 17:03   #5
Kalakom
Junior Member
 
Join Date: Apr 2017
Posts: 5
Ok. But the error of NSIS we may bypass. For this in begin function leavePageComponents we can know for what reason this function was called. Or because of press on "Next" button, or because of press on "Cancel" button. If we know that because of press on "Cancel" button we just call Return from the function. How I can know that button "Cancel" was pressed?
Kalakom is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off

Forum Jump