hi, i have problem with button event plugin, i have following code:
!define MUI_CUSTOMFUNCTION_GUIINIT fckGUIInit
!define IDC_DECL 1300
Function fckGUIInit
System::Alloc 56
Pop $9
System::Call "*$9(i56)"
System::Call "user32::GetWindowInfo(i$HWNDPARENT,ir9)"
IntOp $R9 $9 + 20
System::Call "*$R9(i.R8,i.R7,i.R6,i.R4)"
System::Free $9
IntOp $R8 $R6 - $R8
!insertmacro GetDlgItemRect $R9 $R7 $R6 $R4 $HWNDPARENT 2
IntOp $R8 $R8 - $R6
IntOp $R6 $R6 - $R9
IntOp $R4 $R4 - $R7
System::Call 'kernel32::GetModuleHandle(i0)i.r9'
System::Call 'user32::CreateWindowEx(i0,t"Button",t"Decline",i${BS_PUSHBUTTON}|${WS_CHILD}|${WS_VISIBLE}|${WS_TABSTOP},iR8,iR7,iR6,iR4,i$HWNDPARENT,i${IDC_DECL},ir9,i0)i.R9'
StrCpy $button_decl $R9
System::Call 'kernel32::FreeLibrary(ir9)'
CreateFont $9 '$(^Font)' '$(^FontSize)'
SendMessage $button_decl ${WM_SETFONT} $9 0
GetFunctionAddress $9 FuncDecline
ButtonEvent::AddEventHandler /NoUnload ${IDC_DECL} $9
ShowWindow $button_decl ${SW_HIDE}
FunctionEnd
Function FuncDecline
MessageBox MB_OK "Decline working"
StrCpy $current_app_install "0"
StrCpy $R9 "1" ;Relative page number. See below.
Call RelGotoPage
FunctionEnd
in result i have error (look in attached screenshot)
i also can't use button handle for later show on page where it needed, "ShowWindow $button_decl ${SW_SHOW}" does nothing on custom page where decline should be shown, and pointed function does not called on button press also...
i also tried another method, call code whic is in guiinit function before custom pages block without adding eventhandler, and add event handler on required custom page(s), but as said above it worked for only on page, i also modified plugin similar, as said above (to always replace dlgproc to plugin own) and this worked, but it have random crashes on windows xp, so my question is:
How i can add decline button in left bottom corner with custom text and custom function which must be shown on few custom pages, i have completely dynamic custom pages which is generating in runtime.