Pops a message box on to the screen, with the ! icon and that annoying
sound. $msg
is what is what you want to say and $caption
appears in the
head of the message box. $caption
defaults to 'Perl Alert'.
Example:
Pops a message box on to the screen, with the ? icon and an annoying
beep. $msg
is what is what you want to know and $caption
appears in the
head of the message box. $caption
defaults to 'Perl Confirm'.
The user may chose between a OK or Cancel buttons. Returns true if the user presses OK, false otherwise.
Example:
Pops a message box on to the screen, with the ? icon and an annoying
noise. $msg
is what is what you want to know and $caption
appears in the
head of the message box. $caption
defaults to 'Perl Question'.
The user may chose between a Yes or No buttons. Returns true if the user presses Yes, false otherwise.
Example:
Prompt the user for a file name those cool Explorer style dialog boxes.
$dir
is the directory to start looking in (default is cwd) and $caption
is what goes in the title (default is 'Open file').
Returns the full pathname to the file, or nada if the user pressed Cancel.
Example:
Prompt the user for several file names those cool Explorer style dialog boxes.
$dir
is the directory to start looking in (default is cwd) and $caption
is what goes in the title (default is 'Open file').
Returns an array of full pathnames to the files,
or an empty array if the user pressed Cancel.
Example:
COMMDLG.H has more constants than you can shake a stick at. Rather than
exporting them into your name space, I set up so little objects that
magically AUTOLOAD from the Win32::CommDlg namespace. $ID->YES
will return the IDYES
constant, $MB->ICONEXCLAIM
is
MB_ICONEXCLAIM
, and so on. These objects are smart enough that they
won't choke on $ID->IDCANCEL
, if you type that my accident.
You may also import the constants with the :ID_FLAGS
, :MB_FLAGS
and
:OFN_FLAGS
import tags. In which case the constants are accessed via &MB_YESNO
,
which is better than &Win32::CommDlg::MB_YESNO
, but only just.
BTW, this is an idea I thought up all by my lonesome. And I'm somewhat
proud of it -:)
Example:
if(MessageBox("Here's something very interesing.",$0
,$MB->YESNO
|$MB->ICONEXCLAMATION
|$MB->TASKMODAL
)==$ID->YES
) { print <<HERE; \$MB->YESNO
=@{[$MB->YESNO
]} \$MB->ICONWARNING
=@{[$MB->ICONWARNING
]} \$ID->YES
=@{[$ID->YES
]} \$ID->ABORT
=@{[$ID->ABORT
]} \$ID->CANCEL
=@{[$ID->CANCEL
]} HERE }