Wednesday, February 25, 2009

Using Messagebox() Effectively

Q. Is there any way to show an icon such as for Information, warning etc in the following sample call :-
MessageBox(, "Message", "Title")

A. By Marcos Gambeta (marcosgambeta at gmail.com)

Example:

MessageBox(,"Message","Title",MB_ICONEXCLAMATION)

From MSDN:

To display an icon in the message box, specify one of the following values.
  • MB_ICONEXCLAMATION : An exclamation-point icon appears in the message box.
  • MB_ICONWARNING : An exclamation-point icon appears in the message box.
  • MB_ICONINFORMATION : An icon consisting of a lowercase letter i in a circle appears in the message box.
  • MB_ICONASTERISK : An icon consisting of a lowercase letter i in a circle appears in the message box.
  • MB_ICONQUESTION : A question-mark icon appears in the message box.
  • MB_ICONSTOP : A stop-sign icon appears in the message box.
  • MB_ICONERROR : A stop-sign icon appears in the message box.
  • MB_ICONHAND : A stop-sign icon appears in the message box.

1 comment:

  1. Harbour equivalent call :

    Wapi_MessageBox( 0, cMsg, cTitle, WIN_MB_ICONEXCLAMATION )

    ReplyDelete