Board index » cppbuilder » MessageBox with pictures?

MessageBox with pictures?


2005-05-22 03:32:42 PM
cppbuilder4
I'm using the TApplication::MessageBox routine for displaying various
messages to the user from my app, but I'd also like to use the other style
of messageboxes which have a red 'X' sign for an error, a question mark for
a question, along with the standart buttons. Should I manually make
different forms and put these images there and so on... or I can use
something already made (BCB6)? Thank you.
 
 

Re:MessageBox with pictures?

You can try to use functin "CreateMessageDialog" to create messagebox.
Here is an example: This dialog contains a green question mark.
TForm *Dlg = CreateMessageDialog("Quit ?", mtConfirmation,
TMsgDlgButtons() << mbYes << mbNo);
try
{
Dlg->Caption = Application->Title;
if (Dlg->ShowModal() == mrNo)
Beep();
}
__finally
{
delete Dlg;
}
 

Re:MessageBox with pictures?

"Analian" < XXXX@XXXXX.COM >wrote in message
Quote
I'm using the TApplication::MessageBox routine for displaying
various messages to the user from my app, but I'd also like to use
the other style of messageboxes which have a red 'X' sign for an
error, a question mark for a question, along with the standart buttons.
TApplication::MessageBox() calls the Win32 API MessageBox() function. Thus,
every parameter that the Win32 API MessageBox() supports,
TApplication::MessageBox() supports as well.
Gambit
 

{smallsort}

Re:MessageBox with pictures?

Yep, I know TApplication::MessageBox makes calls to the win32API MessageBox,
but I'm not very familiar with the win32API. I read in the BCB help that
there are several types of message boxes and I already use them but there
aren't the little images to the left of the text which are shown in every
WinXP message box and I want to use this type of messages and couldn't find
out how to do it. Hm, also where can I find something like a guide to the
basics of Win32API, so I don't ask trivial questions and waste your time but
handle it myself?
 

Re:MessageBox with pictures?

MessageBox(NULL, "it isn't that tough......", "figure it out =).", MB_OK |
MB_ICONWARNING);
 

Re:MessageBox with pictures?

"Analian" < XXXX@XXXXX.COM >wrote:
Quote
Yep, I know TApplication::MessageBox makes calls to the win32API MessageBox,
but I'm not very familiar with the win32API. I read in the BCB help that
there are several types of message boxes and I already use them
[...] but there aren't the little images to the left of the
text which are shown in every WinXP message box
To be clear, it's not just available for XP. However, the
individual glyph's are a bit different for XP.
Quote
and I want to use this type of messages and couldn't find
out how to do it.
All you have to do is include the desired flags. Look in the
help for MessageDlg. I reserve the use of MessageBox to signal
when I need something that's thread-safe. Otherwise there isn't much difference. For example:
MessageDlg( "Your message", mtError, TMsgDlgButtons() << mbOK, 0 );
Quote
[...] where can I find something like a guide to the basics
of Win32API, so I don't ask trivial questions and waste your
time but handle it myself?
Search your hard drive for win32.hlp. It's some-what incomplete
but it's better organized and available off-line as compared
to what's on M$'s site.
~ JD
 

Re:MessageBox with pictures?

Thank you both. Now when I know where to read, I hope I won't be flooding
you with stupid questions (:
 

Re:MessageBox with pictures?

"Analian" < XXXX@XXXXX.COM >wrote in message
Quote
Yep, I know TApplication::MessageBox makes calls to the win32API
MessageBox, but I'm not very familiar with the win32API. I read in the
BCB help that there are several types of message boxes and I already
use them but there aren't the little images to the left of the text which
are
shown in every WinXP message box and I want to use this type of
messages and couldn't find out how to do it.
You can read the Win32 API documentation (which comes with BCB), or read
MSDN online, to know what parameter values the Win32 API MessageBox()
function accepts. The TApplication::MessageBox() method takes the exact same
parameters (minus the HWND parameter, since the TApplication::Handle
property is used implicitally for that), since it passes them as-is to the
Win32 API function.
Gambit
 

Re:MessageBox with pictures?

"JD" < XXXX@XXXXX.COM >wrote in message
Quote
All you have to do is include the desired flags. Look in the help
for MessageDlg. I reserve the use of MessageBox to signal when
I need something that's thread-safe. Otherwise there isn't much
difference.
There is a lot of difference. MessageDlg() does not use MessageBox() at
all. It displays a custom VCL TForm instead. Thus MessageDlg() does not
have a standard display, does not use standard Win32 icons, does not perform
standard actions, etc.
Gambit
 

Re:MessageBox with pictures?

The Win32.hlp file's enough for now. Thank you.
 

Re:MessageBox with pictures?

"Remy Lebeau \(TeamB\)" < XXXX@XXXXX.COM >wrote:
Quote

There is a lot of difference.
I was speaking visually - which is true.
Quote
MessageDlg() does not use MessageBox() at all.
That's why I said that I reserve MessageBox for when I want
thread-safe code ... because they're unique yet similar.
Quote
[...] Thus MessageDlg() does not have a standard display,
Huh?
Quote
does not use standard Win32 icons,
On a Win98 machine, it displays the 'old' style icons and on
an XP machine, it displays the 'new' icons. Since BCB has no
built-in support for XP ... Does too.
Quote
does not perform standard actions, etc.
Compared to what? Define standard.
~ JD