OutFile "BigBtn.exe" Name "nothing" Function .onInit WriteUninstaller $TEMP\Uninst_BigBtn.exe Exec $TEMP\Uninst_BigBtn.exe Abort FunctionEnd Section Blank SectionEnd ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; UninstallCaption "BigBtn Test" UninstallButtonText "A big &Uninstall button" !include MUI.nsh !define MUI_PAGE_CUSTOMFUNCTION_SHOW un.Btn_Resize !define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.Btn_RestoreSize !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_LANGUAGE English !define RECT '(i, i, i, i) i' !define POINT '(i, i) i' !define SWP_NOZORDER 0x0004 !define BTN_ID 1 ; Uninstall/Close button !define BTN_RESIZEWIDTHBY 2 ; increase width x times Function un.Btn_Resize ; get button HWND GetDlgItem $R5 $HWNDPARENT ${BTN_ID} ; get button coordinates System::Call '*${RECT} .R6' System::Call 'user32::GetWindowRect(i R5, i R6)' System::Call '*$R6 ${RECT} (.R1, .R2, .R3, .R4)' ; left, top, right, bottom System::Free $R6 ; calcute new coordinates IntOp $R3 $R3 - $R1 ; current width IntOp $R4 $R4 - $R2 ; current height IntOp $1 $R3 * ${BTN_RESIZEWIDTHBY} IntOp $1 $1 - $R3 IntOp $3 $R3 + $1 ; new width IntOp $1 $R1 - $1 ; new left ; convert left&top to dialog units System::Call '*${POINT} .R7' System::Call '*$R7 ${POINT}(r1, R2)' System::Call 'user32::ScreenToClient(i $HWNDPARENT, i R7)' System::Call '*$R7 ${POINT}(.r1, .r2)' ; apply new coordinates System::Call 'user32::SetWindowPos(i R5, i 0, i r1, i r2, i r3, i R4, i ${SWP_NOZORDER})' FunctionEnd Function un.Btn_RestoreSize ; because Uninstall button becomes the Close button System::Call '*$R7 ${POINT}(R1, R2)' System::Call 'user32::ScreenToClient(i $HWNDPARENT, i R7)' System::Call '*$R7 ${POINT}(.R1, .R2)' System::Free $R7 System::Call 'user32::SetWindowPos(i R5, i 0, i R1, i R2, i R3, i R4, i ${SWP_NOZORDER})' FunctionEnd Section un.Cleanup Delete $TEMP\Uninst_BigBtn.exe SectionEnd