Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

![]() |
![]() |
![]() |

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