Popup Message Box 
Author Message
 Popup Message Box

I want to display a popup message box that will only be displayed for a
couple of seconds with an informational message.  Is it possible to display
this without any buttons, by default if I specify nothing in the display
button option I always get an "OK" button as follows....

Set ObjWshShell = WScript.CreateObject("WScript.Shell")
ObjWshShell.Popup strMsg, 2, strTitle, 64

Many thanks
David



Fri, 26 Sep 2003 19:21:20 GMT  
 Popup Message Box

Quote:

> I want to display a popup message box that will only be displayed
> for a couple of seconds with an informational message.  Is it
> possible to display this without any buttons, by default if I
> specify nothing in the display button option I always get an "OK"
> button as follows....

> Set ObjWshShell = WScript.CreateObject("WScript.Shell")
> ObjWshShell.Popup strMsg, 2, strTitle, 64

> Many thanks
> David

AFAIK, you either need a third party control (no recommendation) or you
need to 'roll your own'.  Here's one example, using IE's controls ...

' Modeless.vbs - An example of using IE to create a modeless
'                message box.
' Tom Lavedas
  set oIE = CreateObject("InternetExplorer.Application")
  Modeless oIE, "This is an important message!"  ' Launch the window
'
' Do something.  For example, ...
'
  With CreateObject("Wscript.Shell")
    for i = 1 to 5 :  .Popup "Count:" & i, 2, "Test" : next
  End With
'
on error resume next ' in case the Task Manager is used to close IE.
oIE.quit ' Close the modeless message box

Sub Modeless(oIE, sPrompt)
With oIE
  .fullscreen = True : .navigate "about:blank"
  While .readystate <> 4 : wscript.sleep 100 : Wend
  With .document
    .title = "Message _________________________________"
    .ParentWindow.resizeto 400,100
    .ParentWindow.moveto (.screen.width  - 400)\2, _
                         (.screen.height - 300)\2
    .write "<body bgcolor=Silver><table width=100% height=100%>" _
         & "<tr><td valign=middle align=center>" _
         & "<h3>" & sPrompt & "</h3></td></tr></table></body>"
    .body.style.borderStyle = "outset"
    .body.style.borderWidth = "4px"
    .body.scroll = "no"
  End With
  .visible = true
End With
End Sub

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/



Fri, 26 Sep 2003 21:20:30 GMT  
 Popup Message Box
<snip>
on error resume next ' in case the Task Manager is used to close IE.
</snip>

or Alt+F4 ;-)...

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--



Sat, 27 Sep 2003 09:23:21 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Disable Popup Message box

2. Popup Warning Message Windows/Dialog Boxes?

3. Disabling IE4 popup error message boxes

4. creating a text box errors message for empty text box

5. Permission denied when using Input boxes and message boxes

6. HOW: popup message when mouse over a text link

7. Help with PopUp message on MouseOver

8. Alert Message popup over all open applications

9. Beep before popup message

10. Message Popup while a line of code is executing

11. Popup Messages

12. Popup Logon Message

 

 
Powered by phpBB® Forum Software