from http://www.le-berre.com/perlxtd.htm

MsgBox function

Display a message box.

Syntax

MsgBox($Message,$Type,$Caption); 

 $Message
           Text to be displayed in the dialog box.
 $Type
           Defines the type (Icon & Buttons) of the message box. To define
the value sum the desired
           Buttons option and Icon option.
 $Caption 
           Text to be displayed in window header.

              Buttons Option
                                          Icon Option
                                                                    Returned
Value
       0
           Ok
                                        16
                                            Hand
                                                             1
                                                                 Ok
       1
           Ok, Cancel
                                        32
                                            Question
                                                             2
                                                                 Cancel
       2
           Abort, Retry, Ignore 
                                        48
                                            Exclamation
                                                             3
                                                                 Abort
       3
           Yes, No, Cancel
                                        64
                                            Asterisk
                                                             4
                                                                 Retry
       4
           Yes, No
                                                             5
                                                                 Ignore
       5
           Retry, Cancel
                                                             6
                                                                 Yes
                                                             7
                                                                 No


Example

use Win32;

Win32::MsgBox("A first step for Perl in the Windows GUI world !");

Win32::MsgBox('Bug detected',48,'Alert ! Alert');

$result = Win32::MsgBox('Meet me at the coffee machine ?', 16+4, 'Tired ?');

(($result == 6) ? print "I am on my way !\n" : print "bye !\n");


_______________________________________________________
Stephan Gross       Loral Skynet     908-470-2388     [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 



-----Original Message-----
From: RICHARD A. NAKROSHIS (Contractor)
[mailto:[EMAIL PROTECTED]]
Sent: Monday, June 11, 2001 5:04 PM
To: Perl Beginners
Subject: Win32::MsgBox syntax


While perusing the online documentation for AS 626, I tried out the
Win32::MsgBox module, but ran into a snag.  It says:

Win32::MsgBox(MESSAGE [, FLAGS [, TITLE]])
     [EXT] Create a dialogbox containing MESSAGE. FLAGS specifies the
     required icon and buttons according to the following table: 

             0 = OK
             1 = OK and Cancel
             2 = Abort, Retry, and Ignore
             3 = Yes, No and Cancel
             4 = Yes and No
             5 = Retry and Cancel

             MB_ICONSTOP          "X" in a red circle
             MB_ICONQUESTION      question mark in a bubble
             MB_ICONEXCLAMATION   exclamation mark in a yellow triangle
             MB_ICONINFORMATION   "i" in a bubble

How do you specify FLAGS?  If I use "2", then I'll get the three
buttons.  Or if I use MB_ICONQUESTION, I'll get my question mark in a
bubble.  But what if you wanted BOTH?  How do you do that?

Reply via email to