1

I want to know how can I handle the event when I click the maximize button(I have enabled it already) of my nsis dialog. I want to perform some other dialog element resizing every time I click maximize button, and restore when its minimized. So, how can I achieve it??? Please help. Thanks in advance.

1 Answer 1

1

NSIS was really not designed to handle re-sizable dialogs.

The only way to catch a size event would be to use a plugin. You could write your own custom plugin or try the experimental WndSubclass plugin, either way you pretty much need to know a bit about the Windows API to do this...

Edit:

!include nsDialogs.nsh
!include WinCore.nsh
!include WndSubclass.nsh
!macro _Win_HIWORD_FIXED _outvar _in
IntOp ${_outvar} "${_in}" >> 16 ;sign extended
${LOWORD} ${_outvar} ${_outvar} ;make sure we strip off the upper word
!macroend
!undef HIWORD
!define HIWORD "!insertmacro _Win_HIWORD_FIXED "

Var ParentSubProc
Function ParentSubProc
${If} $2 = ${WM_SIZE}
    ${LOWORD} $1 $4
    ${HIWORD} $2 $4
    ${NSD_SetText} $hwndparent "Size: $1 x $2"
${EndIf}
FunctionEnd

Function .onGuiInit
${NSD_AddStyle} $hwndparent 0x70000
${WndSubclass_Subclass} $hwndparent ParentSubProc $ParentSubProc $ParentSubProc
FunctionEnd
2
  • Can you please elaborate a little bit more about how should I approach it. I really need to do this, and cant find much information anywhere. Thanks.
    – foobar
    Mar 21, 2013 at 10:13
  • You cannot find much information because you are trying to do things NSIS was not designed to do...
    – Anders
    Mar 22, 2013 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.