Skip to content
⌘ NSIS Forum Archive

XP styled thin progress bar

9 posts

Alfaromeo#

XP styled thin progress bar

Hi

Would like to embed XP styled progress bar with green blocks . Please find the attached image wherein the green progress is what I need. I'm using UMUI interface.
Anders#
XPStyle on (If running on XP and the Luna theme is active (it is by default) then you will get it)
Alfaromeo#
Have XPStyle on and XP default theme active. Still only see blue progress . What is the issue here ?
kichik#
UMUI might be turning off XPStyle so it can style the buttons on its own. Try putting "XPStyle on" as the very last command on the script.
Animaether#
Do you at least get the green blocks with the following full example?

!include "MUI2.nsh"
!include "WinMessages.nsh"
!include "nsDialogs.nsh"
OutFile "test.exe"
Page custom CreatePage
Section
SectionEnd
!define /math PBM_SETRANGE32 ${WM_USER} + 6
XPStyle on
Function CreatePage
    nsDialogs::Create 1018
    Pop $0
    ${If} $0 == error
        Abort
    ${EndIf}
    
    ${NSD_CreateProgressbar} 0 0 100% 10% ""
        Pop $0
        SendMessage $0 ${PBM_SETRANGE32} 0 100
        SendMessage $0 ${PBM_SETPOS} 33 0
    nsDialogs::Show
FunctionEnd
!insertmacro MUI_LANGUAGE "English" 
If you don't.. are you sure that your current theme (which the installer uses when XPStyle is on) actually uses the green progressbars?
Alfaromeo#
My Apologies. Actually putting XPStyle On in the last worked.
When I tested , XP theme was off and hence the misunderstanding.
But now and new issue . I see a blackborder on the checkbox label control when the XPStyle is On .Progress bar appears greeen as expected.
Let me Know.
Animaether#
Might be part of your theme?

!include "MUI2.nsh"
!include "WinMessages.nsh"
!include "nsDialogs.nsh"
OutFile "test.exe"
Page custom CreatePage
Section
SectionEnd
!define /math PBM_SETRANGE32 ${WM_USER} + 6
XPStyle on
Function CreatePage
    nsDialogs::Create 1018
    Pop $0
    ${If} $0 == error
        Abort
    ${EndIf}
    
    ${NSD_CreateProgressbar} 0 0 100% 10% ""
        Pop $0
        SendMessage $0 ${PBM_SETRANGE32} 0 100
        SendMessage $0 ${PBM_SETPOS} 33 0
    ${NSD_CreateCheckbox} 0 20% 30% 10% "Black border?"
        Pop $0
        
    nsDialogs::Show
FunctionEnd
!insertmacro MUI_LANGUAGE "English" 
Should result in something like...
Alfaromeo#
This turned out to be an issue with UMUI itself which is what I use. I'm setting the background image for the dialog using the following

!define UMUI_UNIQUEBGIMAGE
!define UMUI_UNUNIQUEBGIMAGE

!define UMUI_PAGEBGIMAGE
!define UMUI_UNPAGEBGIMAGE
!define UMUI_PAGEBGIMAGE_BMP "<path to BMP>"

The following lines when commented , does not show up the blackborder in the license page .