View Single Post
Old 07-01-2009   #8 (permalink)
mr_unreliable


 
 

Re: Pop-up message...

Steven Sinclair wrote:
Quote:

> How can I get this message window to appear with no buttons?
>
hi Steve,

As you know, the "Graphical User Interface" (GUI) available
to vbs scripters is severely limited. Other that msgboxes
and askboxes, the only other option is IE (used as a dialog).

Once upon a time, it was possible to "de-chrome" IE (that is,
remove everything about IE except the client area) so that just
some text could be shown. But apparently ms felt that showing
un-identified messages on the screen was inappropriate, and so
removed that capability.

However, there are 3rd-party controls which allow for an almost
full vb-like GUI interface to be used. If you are courageous
enough (or foolhardy enough) to use a third-party control,
then here is an example that will show only a message on
the screen, using "KixForms"

--- <code> ---
' demo of a KixForms GUI for scripting. 01July09
' Note that KixForms is intended for the KIX Language,
' but works perfectly well with vbs too.
' KixForms may be found here: http://www.kixforms.org/
' and was written by: Shawn Tassie of CGI Canada
'
' This is a rather stilted demo, in that it is intended
' to just show a single line of text on the screen,
' and nothing else. It does this by showing a "form"
' with a "bare" titlebar that contains the message.
' Note also, there is no button shown allowing the
' user to cancel this dialog, (unless he/she is
' fairly knowledgeable)...
' ------------------------------------------------
Option Explicit

Dim oKSF : Set oKSF = CreateObject("Kixtart.System")

Dim oForm : Set oForm = oKSF.Form()

With oForm
.Text = "Hi User, your IT staff will now install Windows 7... "
.Width = 300 ' wd in pixels
.Height = 30 ' ht in pixels
.MinimizeBox = False
.MaximizeBox = False
.ControlBox = False ' a.k.a. the "Close Button" [X]
.Center
End With

oForm.Show

Dim tSecs : tSecs = 0
Const timerLimit = 5 ' seconds

Do
WScript.Sleep 1000 ' sleep one second
tSecs = tSecs + 1
Loop While (tSecs < timerLimit)
oForm.Hide

MsgBox("vbs script quitting now... ")
WScript.Quit
--- <end code> ---

cheers, jw
____________________________________________________________

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


p.s. There is another "Forms" capability called wshDialog,
written by: Peter J.C. van der Klugt, which may be found here:

http://home.hccnet.nl/p.vd.klugt/
My System SpecsSystem Spec