vbscript >> Bring a window to front

by RXJleg » Mon, 11 Apr 2005 16:49:03 GMT


Hi All,

I want to write a script that will being to the front an application window.
I can do it manually by open task manager => Choose application Tab => Right
click on an application => Choose "Bring To Front".
I found a command:

WshShell.AppActivate

But it does not do the job like the command in the task manager.
Can some Help?

Tanks!
Erez



vbscript >> Bring a window to front

by de Graff » Mon, 11 Apr 2005 23:09:03 GMT


Download CMDOW.EXE. It does what you want and a lot more. I run it from
within scripts just fine. It's free from

http://www.commandline.co.uk/cmdow/





Similar Threads

1. Bring another Window to Front - VB.Net

2. Bringing second form to front when first gets focus (keeping both windows on top)

I have a VB.NET application that consists of a toolbar and a subwindow
that I want to function together and not independently.  So when I
give focus to one, I want to make sure that the other is visible on
the screen (brought to front, right behind the one in focus).

I've played with the activated event of each form, but everything I've
tried so far fails, as it's a pretty cyclical process that gets
initiated.  I'd love any help... here's what I have so far that
doesn't work... heh.

-----------------------
'PUBLIC
Dim bIgnoreActivation as Boolean = False
-----------------------
'SUB-WINDOW

Private Sub frmSubWindow_Activated(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Activated

    'IF THIS WAS THE ORIGINAL WINDOW GIVEN FOCUS
    If Not bIgnoreActivation Then
        'SET OUR IGNORE FLAG SO THE OTHER WINDOW
        'KNOWS IT WASN'T ORIGINALLY CALLED
        bIgnoreActivation = True
        frmToolbar.BringToFront()
    End If

    Me.BringToFront()

    'SET THE FLAG BACK
    bIgnoreActivation = False

End Sub

------------------------
'TOOLBAR

Private Sub frmToolbar_Activated(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Activated

    'IF THIS WAS THE ORIGINAL WINDOW GIVEN FOCUS
    If Not bIgnoreActivation Then
        'SET OUR IGNORE FLAG SO THE OTHER WINDOW
        'KNOWS IT WASN'T ORIGINALLY CALLED
        bIgnoreActivation = True
        frmSubWindow.BringToFront()
    End If

    Me.BringToFront()

    'SET THE FLAG BACK
    bIgnoreActivation = False
End Sub

3. How do you bring MDI child windows to the front if MDI parent - VB.Net

4. Bring window to front

I have a VB6 app tha creates a contact using the Outlook object.

When I have populated my contact details, I use the .display method to show 
the contact details on screen.

When I call this program from another, the Outlook contact details form 
dissapears behind the calling program.

Can someone tell me how can I bring my Outlook form to the front?

thanks,

jON


5. Bringing different windows to the front - Word VBA

6. 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?
Mich 


7. Bring to front in VBA - Access Forms Programming

8. Bring an Access form to the front via VBA

This sounds like it should be straightforward, but I cannot find any way of 
doing this: put simply, I wish to bring a specified form to the front. I have 
an Access app which has a client list, alongside the entries of which is a 
'get record' button. When that button is clicked (everytime except the 
first), the updated window stays behind the list window.

Any ideas?

Thanks in advance


Simon