I'm trying to test something with VBS

Is it possible to have a message box show during the execution of the
script.... what I mean is during the scripts execution process I have a
box that just says something like "please wait while script executes" I
don't need to have any buttons but just the box show during the scripts
execution..... is there a way to do this.............

Secondly can I block keyboard input using VBS ........ does such a
command exist.......

Thanks

Momo

Re: message box and blocking keyboard input..... by McKirahan

McKirahan
Sun Nov 06 12:57:20 CST 2005

"Momo" <louey-3@excite.com> wrote in message
news:1131303005.215043.109010@g43g2000cwa.googlegroups.com...
> I'm trying to test something with VBS
>
> Is it possible to have a message box show during the execution of the
> script.... what I mean is during the scripts execution process I have a
> box that just says something like "please wait while script executes" I
> don't need to have any buttons but just the box show during the scripts
> execution..... is there a way to do this.............
>
> Secondly can I block keyboard input using VBS ........ does such a
> command exist.......
>
> Thanks
>
> Momo
>

This will stop the execution to display a popup for 2 seconds.

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Popup "Please wait while script executes...", 2, "Job In
Process", vbInformation
Set WshShell = Nothing



Re: message box and blocking keyboard input..... by mr_unreliable

mr_unreliable
Tue Nov 08 12:15:23 CST 2005

This is a multi-part message in MIME format.
--------------080105010700070609000802
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

hi Momo,

As you probably know, the graphical interfaces available in
script (the msgbox and askbox) are extremely limited -- and
are MODAL, i.e., your script stops running until the gui is
dismissed.

To get something non-modal, you are going to have to use
something else. The most commonly recommended "else" thing
is Internet Explorer. You can call it to show a gui, and
go on about your business.

There are two ways to use IE, as an actX object, or as an
HTA file.

To find examples of using IE as an actX object, search the ng
archives for this:

CreateObject("InternetExplorer.Application")

To find sample code showing how to use an hta, search the ng
archives for "HTA".

Blocking input is a little more problematical. The most simple
and direct way is to use the autoItX control, which has a
BlockInput method.

Or, you could use dynawrap to call the BlockInput api directly.
(see attachment).

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)

--- <DynaWrap Boilerplate> ---
It is possible to declare-and-call an api from script,
but you must use a third-party control to do so,
or else write one yourself.

It has already been correctly pointed out that there
is no api-capability in "pure" script.

If you are willing to use a third-party control, then
one such control, called "DynaWrap", can be found on
Guenter Born's website (note: Guenter refers to it as
"DynaCall"). Here is the link to it:

http://people.freenet.de/gborn/WSHBazaar/WSHDynaCall.htm

On that page you will find a download for the control,
plus some code samples.

Note: you may find additional sample code by searching
the archives for this ng, and the vbscript ng.

Note also: DynaWrap does have its limitations. There are
certain things it can't do. For example, you can't call
api's which take typedefs as parameters, and you can't call
api's "by ordinal". But it will work for most of the
"usual suspects".

And finally, DynaWrap doesn't work entirely as advertised.
For example, it is supposed to allow for the declaration of
several api definitions in one instance of itself. I could
never get that to work (in win9x). You will need a new
instance of DynaWrap for every api, or else re-instantiate
the object for every api. Someday I'm going to learn enough
c++ to fix that...
--- </DynaWrap Boilerplate> ---




Momo wrote:
> I'm trying to test something with VBS
>
> Is it possible to have a message box show during the execution of the
> script.... what I mean is during the scripts execution process I have a
> box that just says something like "please wait while script executes" I
> don't need to have any buttons but just the box show during the scripts
> execution..... is there a way to do this.............
>
> Secondly can I block keyboard input using VBS ........ does such a
> command exist.......
>
> Thanks
>
> Momo
>

--------------080105010700070609000802
Content-Type: text/plain;
name="wshDynawrapBlockInput.vbs.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="wshDynawrapBlockInput.vbs.txt"

' test "sleep" api call, using DynaWrap, ca 2000, jw
' 25Jan05: revised to show elapsed time explicitly...
' 11May05: revised to show blockinput rather than sleep...

Const CPP_TRUE = 1 ' c++ (i.e., system values - NOT vb values)
Const CPP_FALSE = 0

Dim oDW : Set oDW = CreateObject("DynamicWrapper") ' instantiate dynawrap
oDW.Register "USER32.DLL", "BlockInput", "i=l", "f=s" ' declare api (no return value)

MsgBox("Click OK to start blocking keyboard and mouse input")

Call oDW.BlockInput(CPP_TRUE) ' block any keybd or mouse input...

WScript.Sleep 5000 ' wait-a-bit (5 sec)

Call oDW.BlockInput(CPP_FALSE)

MsgBox("input blocking cleared")

Set oDW = nothing ' clean up
WScript.Quit
--------------080105010700070609000802--