Search code examples
user-interfacedialogsizecontrolsnsis

In NSIS, How to set the size of the dialog box when using nsDialogs::Create 1018?


In Nsis, I'm using:

 ...
 nsDialogs::Create 1018
 Pop $0

 nsDialogs::Show
 ...

But the size of the dialog box doesn't fit my needs. How can I specify a length for x and y to this dialog ?


Solution

  • If you want to resize everything it is probably better to use Resource Hacker and ChangeUI but you can do it at runtime:

    !include nsDialogs.nsh
    
    Function mypage
    System::Call 'user32::SetWindowPos(i$hwndparent,i,i,i,i 640,i 480,i 0x16)' ; Resize outer dialog
    nsDialogs::Create 1018
    Pop $0
    System::Call 'user32::MoveWindow(i$0,i0,i0,i 600,i 200,i0)' ; Resize inner (nsDialogs) page
    
    ${NSD_CreateLabel} 0 10u 100% 10u "Hello, welcome to nsDialogs!"
    Pop $0
    SetCtlColors $0 0xffffff 0xff2255
    
    nsDialogs::Show
    FunctionEnd
    
    page custom mypage