Old 24th April 2019, 01:41   #1
meoit
Member
 
Join Date: Oct 2014
Location: $DESKTOP
Posts: 90
Post How to resize and set position the next button

Hi all!

I need resize the next button, width = x2.
and set position to 10u from the old position.

I do not know user32::GetWindowRect, user32::SetWindowPos

Someone help me.

Thanks.
meoit is offline   Reply With Quote
Old 24th April 2019, 12:34   #2
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 339
try this:
HTML Code:
!include "MUI2.nsh"

Page Custom Button_Test
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_LANGUAGE English


Function Button_Test

nsDialogs::Create 1044
Pop $R0
${If} $R0 == error
Abort
${EndIf}

GetDlgItem $0 $HWNDPARENT 1 ;NEXT button
System::Call 'USER32::MoveWindow(p$0,i120,i60,i240,i130,i1)'
#(Control HWN ; Horizontal Posation ; Vertical Posation ; Controller Vertical Size ; Controller Horizontal Size)

GetDlgItem $0 $HWNDPARENT 1 ;NEXT button
${NSD_AddExStyle} $0 "${WS_EX_TRANSPARENT}|${WS_EX_TOPMOST}" ;Add Button To TOP |FIX hide Button|

nsDialogs::Show
FunctionEnd


Section

SectionEnd
r2du-soft is offline   Reply With Quote
Old 24th April 2019, 12:50   #3
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 339
Also see this Examples:

Example 2:
HTML Code:
!include "MUI2.nsh"

!define MUI_CUSTOMFUNCTION_GUIINIT onGUIInit
Page Custom Button_Test

!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_LANGUAGE English

Var BTN_NEXT


Function onGUIInit
GetDlgItem $0 $HWNDPARENT 1 ;NEXT button
ShowWindow $0 ${SW_HIDE}
FunctionEnd


Function Button_Test

nsDialogs::Create 1044
Pop $R0
${If} $R0 == error
Abort
${EndIf}

${NSD_CreateButton} 80 50 240 90 "NEXT Page Show"
Pop $BTN_NEXT
${NSD_OnClick} $BTN_NEXT BTN_NEXT_Click

nsDialogs::Show
FunctionEnd

Function BTN_NEXT_Click
Pop $0
SendMessage $HWNDPARENT ${WM_COMMAND} 1 "" ;Next
FunctionEnd



Section

SectionEnd



Example 3:
HTML Code:
!include "MUI2.nsh"

Page Custom Button_Test

!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_LANGUAGE English

Var BTN_NEXT


Function Button_Test

nsDialogs::Create 1044
Pop $R0
${If} $R0 == error
Abort
${EndIf}

${NSD_CreateButton} 80 50 240 90 "NEXT Page Show"
Pop $BTN_NEXT
${NSD_OnClick} $BTN_NEXT BTN_NEXT_Click

nsDialogs::Show
FunctionEnd

Function BTN_NEXT_Click
Pop $0
SendMessage $HWNDPARENT ${WM_COMMAND} 1 "" ;Next
FunctionEnd



Section

SectionEnd
r2du-soft is offline   Reply With Quote
Old 24th April 2019, 13:06   #4
meoit
Member
 
Join Date: Oct 2014
Location: $DESKTOP
Posts: 90
Thank r2du-soft!

Code working fine.
meoit is offline   Reply With Quote
Old 24th April 2019, 13:21   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,185
The code posted by r2du-soft uses pixels, not dialog units which is what you asked for.

Do you want to size the button on all pages or just a single page?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 24th April 2019, 13:41   #6
meoit
Member
 
Join Date: Oct 2014
Location: $DESKTOP
Posts: 90
Thank Anders!

I need for a single page.
meoit is offline   Reply With Quote
Old 13th May 2019, 14:57   #7
meoit
Member
 
Join Date: Oct 2014
Location: $DESKTOP
Posts: 90
@r2du-soft

I set font Tahoma for the Installer

When I tried rename Tahoma.ttf, result: The Next Button is no longer located where I want.

How to fix this?.
meoit is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump