Archive: How do I know that the button is pressed ?


How do I know that the button is pressed ?
How do I find the button is pressed without the use of plug-Buttonevent ?


!AddPluginDir ".\"
!include MUI2.nsh
Page custom fnc_Create
;!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"

!define IDC_ABOUT 1300

OutFile "test_ButtonEvent_api.exe"
Var dlg

Function fnc_Create
nsDialogs::Create 1018
Pop $dlg
System::Call `*(i,i,i,i)i(10,10,80,20).R0`
System::Call `user32::MapDialogRect(i$HWNDPARENT,iR0)`
System::Call "*$R0(i.R1,i.R2,i.R3,i.R4)"
System::Free $R0
FindWindow $R0 "#32770" "" $HWNDPARENT
System::Call 'user32::CreateWindowEx(i0,t"Button",t"MyButton",i${BS_PUSHBUTTON}|${WS_CHILD}|${WS_VISIBLE}|${WS_TABSTOP},iR1,iR2,iR3,iR4,i$HWNDPARENT,i${IDC_ABOUT},ir0,i0)i.R0'

GetFunctionAddress $0 MyButton
ButtonEvent::AddEventHandler /NoUnload ${IDC_ABOUT} $0

nsDialogs::Show
FunctionEnd

Function MyButton
MessageBox MB_OK "You pressed 'MyButton'"
FunctionEnd

Section
SectionEnd

Read the nsDialogs documentation, it lists the events you can hook...


Events nsDialogs why it does not work with API...


Someone has ideas - how to solve the problem ?


You should be using the NSD macros to create the button on a nsDialogs page...


Originally posted by Anders
You should be using the NSD macros to create the button on a nsDialogs page...
The fact is that I need my extra button on a standard page.

Help please - how to manage the button click event, but without the plugin? Is there no solution?