vbscript >> Bring to Front

by Florian Liefers » Fri, 05 Mar 2004 00:58:32 GMT

"Hello world\n",

how can i bring an opened window to front using visual vbscript and activex?


vbscript >> Bring to Front

by Evertjan. » Fri, 05 Mar 2004 01:43:48 GMT

Florian Liefers wrote on 04 mrt 2004 in


The Netherlands.
(Please change the x'es to dots in my emailaddress)

vbscript >> Bring to Front

by Torgeir Bakken (MVP) » Fri, 05 Mar 2004 01:57:39 GMT


WSH's builtin AppActivate is not to be trusted for this. AutoItX is much
better at this.

AutoIt/AutoItX is free and can be found here:

AutoItX is an ActiveX control version of AutoIt and can be used from
a vbscript.

An example:

Set oAutoIt = CreateObject("AutoItX.Control")
oAutoIt.SetTitleMatchMode 2

oAutoIt.WinActivate "Microsoft Visual C++", ""

AutoIt(X) window handling defaults to match the start of a window title that
you specify, use "SetTitleMatchMode 2" to specify ANY substring of the window
title you want to match.

And for the difference on window titles and window text, from the help file:

Window Titles and Window Text

A number of script commands have "Window Title" and "Window Text" as

"Window Title" is text that appears in the windows title bar.

"Window Text" is any other text on that window, e.g. text on buttons such as
"OK" and "Cancel". If you don't wish to specify window text, you must use a
blank string instead, i.e. ""

Having "Window Text" allows you to distinguish between multiple windows that
have the same title.

Neither the title nor text needs to be completely specified.
i.e. "Untitled - No" will match a window with the title "Untitled - Notepad".
See the text on the SetTitleMatchMode command for additions to this.

Hint: Use the "/reveal" mode of the full AutoIt product to see what text is
present on a window.
N.B. Windows titles and text are CASE SENSITIVE!!!!!


Bring to Front

by Florian Liefers » Fri, 05 Mar 2004 18:45:06 GMT

That did not work :-(.
I have the following code:

Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
Set connection = application.Children(0)
Set session = connection.Children(0)
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If


Bring to Front

by Florian Liefers » Fri, 05 Mar 2004 18:45:56 GMT

The problem is, that i am not allowed to install additional software.


Similar Threads

1. How do I "Bring to Front" in VBA?

I have a form which is divided into sections where each background is a box. 
This makes it easier to manage the info for the user.  However there are 
some functions I have placed on one of the boxed areas that I don't want all 
users to see.  I am looking for a setting that will cause this box to use 
the "Bring to Font" property, rather than make all of the controls on it not 
visible.  When I look at the proprties in Intellisense, Bring To Front and 
Send to Back are not there.  How do I do this?

2. Bring to front in VBA - Access Forms Programming

3. Bring to front

I copied the following code from the internet  to creat a tray icon
and  ballon notice   I would like to set showtaskbar to false and if
the form is in back (BUT NOT MINIMIZED)  and I mouse over the tray
icon it brings it to the front.  Any ideas

    Private Sub frmExample_Load(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Load
        NotifyIcon1.Icon = Me.Icon
        '//and now in your form put this code in the load event 
        '// Adds the icon 
        With uNIF
            .cbSize = Marshal.SizeOf(uNIF)
            .hwnd = Me.Handle
            .uID = 1
            '.dwInfoFlags = NIF_ICON Or NIF_MESSAGE
            .uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
            .uCallbackMessage = New IntPtr(&H500)
            .uVersion = NOTIFYICON_VERSION
            .hIcon = Me.Icon.Handle
        End With
        Result = Shell_NotifyIcon(NIM_ADD, uNIF)
        '// Send a balloon message 
        'With uNIF
        '    .uFlags = NIF_INFO
        '    .uVersion = 2000
        '    .szInfoTitle = "Test"
        '    .szInfo = "Testing 1,2,3 Testing"
        '    .dwInfoFlags = NIIF_INFO
        'End With
        'Result = Shell_NotifyIcon(NIM_MODIFY, uNIF)
        '//if you want to send a balloon message with
        '//the error icon just change de dwInfoFlags to
        '//NIIF_ERROR, or for a warning NIIF_WARNING and
        '//so on, if you want to send messages in other
        '//parts of your project just put the code that
        '//sends the balloon message in the event,
        '//CAUTION: if you don't put the Add icon code
        '//in your main form load event you will not be 
        '//able to receive balloon messages. 
End Sub

4. Problems with Send to Back & Bring to Front - VB.Net

5. Bring to front - by VBA code

In A2000 is it certain that one cannot perfoem 'Bring to front' using

Is is also the case that 'Visible = True or =False' is different and
separate from a control's zorder and thus that if two or more controls
are positioned directly above one another simply setting 'Visible =
True' will not bring that control up to be visible and clickable.


6. To bring to front existing process...

7. Bring to Front- Sent to Back in run-time

In design-time it is possible to define if a control is "in front" other by 
specifying "Bring to Front" or "Sent to Back", but; How to do this in 

Beforehand, thank you very much.

Luis Garcia
IT Consultant

8. Bring To Front - Visual Basic/VB