All Forums >> [Scripting] >> Post a VBScript >> Message Box with Timeout Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
'************************************************************************************************************** '* Time Out Message Sample * '* ------------------------------------- * '* Written by: Jeferson Propheta * '* July / 2007 * '************************************************************************************************************** Dim objFSO set objFSO = CreateObject("Scripting.FileSystemObject") Set objShell = CreateObject("Wscript.Shell")
Wait 3, "Copying File - This will automatically close" objFSO.CopyFile "c:\temp\filelist.txt", "c:\temp\filelist2.txt"
Wait 2, "Some Other Message . . ." objShell.exec "c:\WINDOWS\system32\Calc.exe"
Sub Wait(Seconds, Message) On Error Resume Next Dim objFuncShell If IsEmpty(objFuncShell) Then Set objFuncShell = CreateObject("wscript.shell") objFuncShell.Popup Message, Seconds, "Title", 80000 End Sub
set objFSO = nothing
< Message edited by jeferson.propheta -- 8/30/2007 4:09:43 AM >
Posts: 125
Score: 2
Joined: 7/13/2006
From: Australia
Status: offline
When I run it and there is an application already open that covers the centre part of the screen, i.e. notepad for instance, the first popup appears and closes and then notepad gets focus. The second popup hides behind notepad.
The popup method seems to make the script loose focus? Is there a way around that? Tried appactivate.