VBS Msgbox Timeout

Si può utilizzare in VBScript il metodo Popup, il quale ha come proprietà anche l’impostazione del timeout che dopo un determinato tempo fa chiudere la finestra messaggio.

Un esempio:

Const wshYes = 6
Const wshNo = 7
Const wshYesNoDialog = 4
Const wshQuestionMark = 32

Set objShell = CreateObject("Wscript.Shell")

intReturn = objShell.Popup("Test chiusura popup 10 secondi. La presente finestra di chiuderà tra 10 secondi", 10, "Titolo Finestra", wshYesNoDialog + wshQuestionMark)

If intReturn = wshYes Then
    Wscript.Echo "Premuto il tasto Yes."
ElseIf intReturn = wshNo Then
    Wscript.Echo "Premuto il tasto No."
Else
    Wscript.Echo "Nessun tasto premuto."
End If

Per maggiori informazioni:
http://blogs.technet.com/b/heyscriptingguy/archive/2005/03/14/how-can-i-automatically-dismiss-a-message-box-after-a-specified-length-of-time.aspx

This entry was posted in VBScript. Bookmark the permalink.