Alternatively, does anyone know of a tool that would spy on the windows and
automatically
raise windows with a given title (or title pattern)?
TIA,
Rob Hegt
--
Bill James
Microsoft MVP - Shell/User
Windows VBScript Utilities » www.billsway.com/vbspage/
Windows Tweaks & Tips » www.billsway.com/notes_public/
"Rob Hegt" <som...@somewhere.org> wrote in message news:41a5...@ottunt1.eu.biomerieux.com...
> I have a COM server (out-of-proc) that starts a VBscript by means of the
> script control.
> The script needs to display an input box. The box shows, but it is not on
> top. Is there any
> way I can make it to appear on top automatically, from within the script?
Hi
With vbSystemModal maybe:
MsgBox "some text", vbInformation + vbSystemModal, "some title"
--
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
--
Bill James
Microsoft MVP - Shell/User
Windows VBScript Utilities » www.billsway.com/vbspage/
Windows Tweaks & Tips » www.billsway.com/notes_public/
"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message news:u4ZLar%230EH...@TK2MSFTNGP10.phx.gbl...
> The OP is asking about InputBox.
>
Oops!
> I have a COM server (out-of-proc) that starts a VBscript by means of the
> script control.
> The script needs to display an input box. The box shows, but it is not on
> top. Is there any
> way I can make it to appear on top automatically, from within the script?
Hi
Disregard my first post, my brain was set for MsgBox.
Using AppActivate from a second script (that e.g. the first script
creates and launches) is an option. Here is an example:
'--------------------8<----------------------
Const OpenAsASCII = 0
Const OverwriteIfExist = -1
sTitle = "Some title" ' Title to be used in InputBox
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sFile = oFSO.GetSpecialFolder(2).ShortPath & "\" & oFSO.GetTempName & ".vbs"
Set fFile = oFSO.CreateTextFile(sFile, OverwriteIfExist, OpenAsASCII)
fFile.WriteLine "Set oShell = CreateObject(""WScript.Shell"")"
fFile.WriteLine "Do While Not oShell.AppActivate(""" & sTitle & """)"
fFile.WriteLine " WScript.Sleep 200"
fFile.WriteLine "Loop"
fFile.Close
oShell.Run "wscript.exe " & sFile, 1, False
sInput = InputBox("something", sTitle)
oFSO.DeleteFile sFile
'--------------------8<----------------------
--
Bill James
Microsoft MVP - Shell/User
Windows VBScript Utilities » www.billsway.com/vbspage/
Windows Tweaks & Tips » www.billsway.com/notes_public/
"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message news:%23Wuu%23z$0EHA...@TK2MSFTNGP14.phx.gbl...
Unfortunately, this code does run but not help. The input box is created,
but it
does not show on top, but only in the task bar.
Thanks anyway,
Rob Hegt
> Unfortunately, this code does run but not help.
> The input box is created, but it
> does not show on top, but only in the task bar.
Hi
AppActivate have it's limitations, you may want to try AutoItX in
the second script instead, it has a much better Appactivate handling.
More about AutoIt/AutoItX here:
http://groups.google.com/groups?selm=OuXrBqBuEHA.3188%40TK2MSFTNGP15.phx.gbl
How about this "mumbo jumbo"?
(use before showing inputbox)
With CreateObject("WScript.Shell")
.SendKeys "{F10}{ESC}", True
End With
--
Miyahn (Masataka Miyashita) JPN
Microsoft MVP (Office Systems - Excel)
HQF0...@nifty.ne.jp