Re: MsgBox to display while processing

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 03/13/05


Date: Sun, 13 Mar 2005 18:31:47 +0100

D.P. Roberts wrote:

> Hopefully there is a simple solution to my dilemma. I have a script as
> follows:
>
> 1. A MsgBox is displayed to ask user if they want to proceed.
> 2. After they click Yes, the MsgBox disappears and the script begins
> processing.
> 3. Processing takes about 30 seconds to complete.
> 4. After the processing has completed, a MsgBox is displayed to inform the
> user the process has completed.
>
> I'd like to have a MsgBox display during the 30 seconds of processing to
> tell the user to "Please wait." I don't need a progress bar or anything
> fancy like that - just a simple message so the user doesn't think the script
> has hung.
>
> Is this possible?
Hi

Here is a couple of alternatives for you:

A)
You can roll your own MsgBox function, using an Internet Explorer
instance from your VBScript.

See e.g. the two MsgBox examples here for a starting point:

T Lavedas' WSH Scripts
http://www.pressroom.com/~tglbatch/wshindex.html

In this link there is a modified version of an example by Joe Earnest
(progress bar is removed), where I use the window to display the
installation progress of some security updates:
http://groups.google.co.uk/groups?selm=%23hgK37KoEHA.2764%40TK2MSFTNGP11.phx.gbl

Some more examples without a progress bar but where you can dynamically
put out information about what is going on :
http://groups.google.co.uk/groups?selm=3EA302E5.5BAE90EB%40hydro.com

B)
HTA:

You could consider using HTA (HTML Application) instead (*.HTA files
are in a way HTML files hosted by mshta.exe instead of iexplore.exe):

HTML Applications (HTAs)
http://msdn.microsoft.com/workshop/author/hta/hta_node_entry.asp

A couple of HTA examples for you:

http://groups.google.co.uk/groups?selm=%23QAI7UtkAHA.1968%40tkmsftngp04
When running the example in the link above, fill in e.g.
Win32_OperatingSystem in the Enumerate field

http://groups.google.co.uk/groups?selm=%23wIsRfZoCHA.2280%40TK2MSFTNGP12

-- 
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx


Relevant Pages

  • Re: MsgBox to display while processing
    ... I looked at the IE and HTA options, but it appears these are just "dumb" ... Is there no way to make it dynamic so it displays during script ... A MsgBox is displayed to ask user if they want to proceed. ... >> I'd like to have a MsgBox display during the 30 seconds of processing to ...
    (microsoft.public.scripting.vbscript)
  • Re: Displaying text output in one external window
    ... > Oh, and of course, I want to display those messages as ... > somehow embedded into the HTA page? ... scrolling output window. ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.wsh)
  • Re: Open and close Msgbox?
    ... >> I'm trying to find out how to close a msgbox that was opened ... > Here is a couple of alternatives for you (one WSH and one HTA): ... > Some more examples without a progress bar but where you can dynamically ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.scripting.vbscript)
  • Re: do pop up boxes stop all events?
    ... If you display a standard VB MsgBox when your code is running in the VB ... Timers and various other events will still work fine while the dialog is ... sub) are also halted. ...
    (microsoft.public.vb.general.discussion)
  • Re: Bringing Script MsgBox to foreground
    ... SP 2 system) that MsgBox becomes visible, but it does not get focus ... see the Microsoft Win32 documentation). ... which produces a visible Popup in the foreground, ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.scripting.vbscript)