|
|
#1 |
|
Senior Member
|
Modal MessageBox
Guys,
Is there an option to make a MessageBox modal? MB_TOPMOST doesn't seem to do the trick. I have a question box that I want to be centre/top and unable to do anything until answered. Is this possible with NSIS? Thanks |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
I'm not sure what your problem is. The MessageBox instruction produces a modal message box which until a selection is made, halts code execution. Where are you showing one?
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#3 |
|
Senior Member
|
I want one similar to a modal box like mfc produces so it takes focus. Not just installation halt but doesn't allow anything else to be done too until question answered. Like if you click outside of the box, the computer will ding.
|
|
|
|
|
|
#4 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,775
|
why do you want to hurt your users?
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#5 |
|
Senior Member
|
I don't, it was more if it was possible :-)
|
|
|
|
|
|
#6 |
|
Major Dude
Join Date: Feb 2007
Posts: 545
|
To make a Messagebox modal you have to pass the parent window handle instead of NULL.
You can do this by code: (Shameless copy from a post from aerDNA in the MessageBox with more buttons thread) |
|
|
|
|
|
#7 |
|
Major Dude
Join Date: Feb 2007
Posts: 545
|
Hmm, and this is exactly what the NSIS MessageBox is doing, so what is your question?
|
|
|
|
|
|
#8 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
jweinraub I very much doubt this is possible with Windows as is. Have you ever seen this done before in an installation wizard?
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#9 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
I've seen it done before in some applications that throw an error (and I don't mean the UAC prompt).. so it can be done, but it sure is annoying(!)
|
|
|
|
|
|
#10 |
|
Senior Member
|
I don't recall if I ever seen an installation program do it, but I have seen Windows programs do it.
|
|
|
|
|
|
#11 |
|
Senior Member
|
Techically that example is modal to the parent window, not the desktop. I believe a true modal dialogue won't let you do anything else until that has been answered...
But I don't plan on doing anything that will make our customers annoyed it was just a curiosity question. |
|
|
|
|
|
#12 | ||
|
Major Dude
Join Date: Feb 2007
Posts: 545
|
Quote:
I didn't understand what you are trying to do at first. Quote:
http://en.wikipedia.org/wiki/Modal_window To make something you want, you will have to do something like the Windows XP shutdown dialogbox: Make a screendump, show it on top of everything, and place your dialogbox on top of that. See http://www.codeproject.com/KB/dotnet/DimmerForm.aspx for an example (.NET) But as said before, I don't think that is something you want to do to your users... |
||
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|