Computing.Net > Forums > Programming > Perl - Win32::MsgBox

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Perl - Win32::MsgBox

Reply to Message Icon

Name: Sumanth Sharma
Date: September 30, 2003 at 02:45:18 Pacific
OS: WinNT SP6
CPU/Ram: P3 656/128 MB
Comment:

I use ActivePerl 5.8

I wan't to know if I can give the message box a default input( auto-input).

Say, the user run's the script and goes away.
So that no one is there to answer the msg box. Can I assign a default input, so that after waiting for 10 seconds(say) the default input yes or no or cancel etc. will be taken.

The Win32 Message box syntax is given below.

$message = Win32::MsgBox("Do you want to save?", 4 | MB_ICONQUESTION, "Save?");

> The options for Flags are:

> 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

> So, for a yes/no box with an info icon you'd use:
> $message = Win32::MsgBox("Press either yes or no", 4 |
> MB_ICONINFORMATION, "Error");

> Then you check the $message variable for the return code.

> The function returns the menu id of the selected push button:

> 0 Error

> 1 OK
> 2 Cancel
> 3 Abort
> 4 Retry
> 5 Ignore
> 6 Yes
> 7 No




Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Perl - Win32::MsgBox

PERL 'Win32::Service' www.computing.net/answers/programming/perl-win32service-/14833.html

Perl Win32::Process::Info www.computing.net/answers/programming/perl-win32processinfo/15268.html

Perl Win32::AD::User www.computing.net/answers/programming/perl-win32aduser/14824.html