Old 29th July 2011, 20:08   #1
Garfeidl534
Junior Member
 
Join Date: Jul 2011
Posts: 1
NSIS Message Box Title, can be changed?

I am wondering can I modify the title of the message box title? And can I use my own icon instead of the icons provided by NSIS.

Thanks!
Garfeidl534 is offline   Reply With Quote
Old 29th July 2011, 20:16   #2
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,368
you have a little more options using the messagebox plugin (seems it was deleted from the wiki), but iirc it didn't allow changing the icon. another solution would be looking at nsWindows, which allows you to create custom pages at a size of your liking.
Yathosho is offline   Reply With Quote
Old 29th July 2011, 20:19   #3
DrO
 
Join Date: Sep 2003
Posts: 27,873
the removed messagebox plug-in did allow for the icon to be customised (it basically exposed everything the MessageBox(..) api exposed but was removed as i cannot support / re-develop something i lost the code to 6+ years ago - plus the compile didn't work correctly on most machines where DEP is enabled. hence the removal.

nswindows or trying to use the system plug-in (which wasn't as adapt at doing such things when i made my removed plug-in) is the recommended option i'd go with if trying to create something like a messagebox.

-daz
DrO is offline   Reply With Quote
Old 1st August 2011, 12:04   #4
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Try like this, for a simple solution:

code:
!macro MsgBox out text title flags
System::Call "user32::MessageBox(i $HWNDPARENT, t '${text}', t '${title}', i ${flags}) i.s"
Pop ${out}
!macroend

Section "MsgBoxTest"
!insertmacro MsgBox $0 "Hello world! This is just a test. Continue?" "Awesome title" 0x20|0x3
MessageBox MB_OK "Return Code: $0"
SectionEnd


My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Old 25th October 2011, 09:23   #5
Opalo
Junior Member
 
Join Date: Oct 2011
Posts: 3
Do You know maybe how to change the button's text on the dialog box? For instance from 'Yes' to 'Whatever'? Please let me know.
Opalo is offline   Reply With Quote
Old 25th October 2011, 09:28   #6
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Not possible with the "native" Windows dialog boxes (details).

There are certain flags to control which buttons will be shown, but no way to freely define the text.

You'd have to create your own window and manually add the buttons, I fear...

My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Old 25th October 2011, 10:27   #7
DrO
 
Join Date: Sep 2003
Posts: 27,873
wouldn't nsWindows be an option to create a dialogbox-like window?

-daz
DrO is offline   Reply With Quote
Old 25th October 2011, 11:42   #8
Opalo
Junior Member
 
Join Date: Oct 2011
Posts: 3
Thanks for the response. What I need to do is to display a simple menu at the beginning of the installation process. This menu would contain three options:
1) Show manual
2) Install
3) Exit
I thought to use the MessageBox but I can't customize the buttons' captions. How it can be done in different way? Please share your ideas.
Opalo is offline   Reply With Quote
Old 25th October 2011, 11:47   #9
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Instead of a pop-up window (message box), why not simply use a custom installer page as first page?

See nsDialogs manual for details:
http://nsis.sourceforge.net/Docs/nsDialogs/Readme.html

My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Old 25th October 2011, 12:00   #10
Opalo
Junior Member
 
Join Date: Oct 2011
Posts: 3
I'm reading this tutorial right now. Is there any way to hide the bar at the bottom of the window?
Opalo is offline   Reply With Quote
Old 25th October 2011, 12:04   #11
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Nope, as it's not part of the "inner" dialog, where the nsDialogs page is being displayed.

You can disable the buttons at the bottom of the installer dialog while your custom page is being shown though.


For the next button you would use this code to disable:

PHP Code:
GetDlgItem $0 $HWNDPARENT 1
EnableWindow 
$0 0 

My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
messagebox, nsis, title

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