Jump to content

Load window on top


Papo
 Share

Recommended Posts

Run ("C:\Program Files\Internet Explorer\iexplore.exe")
WinSetOnTop("D-LINK SYSTEMS, INC | WIRELESS ROUTER | LOGIN - Windows Internet Explorer", "", 1)
WinWaitActive ("D-LINK SYSTEMS, INC | WIRELESS ROUTER | LOGIN - Windows Internet Explorer")

Can someone tell me what I'm doing wrong? Im trying to make iexplore.exe load on top of any/all other windows.

Thanks in advance for your guidance.

-Papo

Link to comment
Share on other sites

I doubt that by the time you say "WinSetOnTop" the window exists already. Make sure to add a "WinWait" before doing that, so you make sure it's already been created.

Edited by Nahuel
Link to comment
Share on other sites

Run ("C:\Program Files\Internet Explorer\iexplore.exe")
WinSetOnTop("D-LINK SYSTEMS, INC | WIRELESS ROUTER | LOGIN - Windows Internet Explorer", "", 1)
WinWaitActive ("D-LINK SYSTEMS, INC | WIRELESS ROUTER | LOGIN - Windows Internet Explorer")

Can someone tell me what I'm doing wrong? Im trying to make iexplore.exe load on top of any/all other windows.

Thanks in advance for your guidance.

-Papo

Hi try this one

Run ("C:\Program Files\Internet Explorer\iexplore.exe")
WinWaitActive ("D-LINK SYSTEMS, INC | WIRELESS ROUTER | LOGIN - Windows Internet Explorer")
WinSetOnTop("D-LINK SYSTEMS, INC | WIRELESS ROUTER | LOGIN - Windows Internet Explorer", "", 1)
Edited by manofman
Link to comment
Share on other sites

Thank you very much. In order to understand Autoit more is there a tutorial besides the help file? Also does it help to learn a specific language before jumping into Autoit (besides making autoit ones first language)

Link to comment
Share on other sites

Run ("C:\Program Files\Internet Explorer\iexplore.exe")
WinWaitActive ("D-LINK SYSTEMS, INC | WIRELESS ROUTER | LOGIN - Windows Internet Explorer")
WinSetOnTop("D-LINK SYSTEMS, INC | WIRELESS ROUTER | LOGIN - Windows Internet Explorer", "", 1)

Even with this code the window won't open on Top of other windows such as Firefox. Is their a code/attribute i can put after Run ("C:\Program Files\Internet Explorer\iexplore.exe"

to make it open on top of any window such as firefox

Thanks again

-Papo

Link to comment
Share on other sites

Thank you.

It did not work for me, I assumed that i had to change "Internet Explorer" with the IE title. I will try again with just "Internet Explorer"

Thanks again for helping me

*Edit* I don't know why but The script just doesn't want to load IE on top of Firefox..

Edited by Papo
Link to comment
Share on other sites

No, he's using Opt('WinTitleMatchMode',2) wich means Match any substring in the title. It works for me...

Does this code work for you?

Run("notepad.exe")
WinWait("[CLASS:Notepad]")
WinSetOnTop("[CLASS:Notepad]","",1)
Link to comment
Share on other sites

Yes your code works for me.

But i'm using a seperate program to launch the original script. At first this code wouldn't load IE over Firefox:

Opt('WinTitleMatchMode',2)
Run ("C:\Program Files\Internet Explorer\iexplore.exe")
WinWaitActive ("D-LINK SYSTEMS, INC | WIRELESS ROUTER | LOGIN - Windows Internet Explorer")
WinSetOnTop("D-LINK SYSTEMS, INC | WIRELESS ROUTER | LOGIN - Windows Internet Explorer", "", 1)

but when i changed

Opt('WinTitleMatchMode',2)
to
Opt("WinTitleMatchMode", 2)
it worked. I don't know why or even if it makes sense but it works altogether:

Opt("WinTitleMatchMode", 2)
Run ("C:\Program Files\Internet Explorer\iexplore.exe")
WinWaitActive ("D-LINK SYSTEMS, INC | WIRELESS ROUTER | LOGIN - Windows Internet Explorer")
WinSetOnTop("D-LINK SYSTEMS, INC | WIRELESS ROUTER | LOGIN - Windows Internet Explorer", "", 1)
MouseMove (820,332,0)

Is what i did make sense or did some variable in windows change the result?

I'm trying to learn what i can about Autoit as i go :)

Thanks again

-Papo

Link to comment
Share on other sites

:) Are you sure you didn't change anything else when you changed the ' for " ?

There's no need to put the whole window title if you are using Opt("WinTitleMatchMode", 2). Does removing this line make the code not work anymore? If that's so, it's pretty likely that you have a minor typo in the window title.

But, if that code works, then that's alright. ^_^

Link to comment
Share on other sites

Well when I copied the exact code

Opt('WinTitleMatchMode',2)
Run ("C:\Program Files\Internet Explorer\iexplore.exe")
WinWaitActive ("Internet Explorer")
WinSetOnTop("Internet Explorer", "", 1)
MouseMove (820,332,0)
MouseClick ("left")
Send ("admin")
Send ("{Tab}")
Send ("****")

The password ended up in the address bar.

I not only changed the ' to " but i also added a space between the ",2" I made these changes to make it look exactly like the example in the help file

Link to comment
Share on other sites

In order to understand Autoit more is there a tutorial besides the help file?

Welcome to Autoit 1-2-3 is a great tut for newbies. it's in my signature below

Also does it help to learn a specific language before jumping into Autoit (besides making autoit ones first language)

I don't think so, I didn't!

Autoit is mostly written in C++ ( I think) and makes the tuff stuff easier.

The design is to make scripting easier with Autoit ... and minimal scripting knowledge is required

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Thanks Again everyone for helping. It took some sleep but the reason why

Opt('WinTitleMatchMode',2)
Run ("C:\Program Files\Internet Explorer\iexplore.exe")
WinWaitActive ("Internet Explorer")
WinSetOnTop("Internet Explorer", "", 1)
MouseMove (820,332,0)
MouseClick ("left")

wasn't working was because when the file executes it starts off with "Internet Explorer" as the title causing everything to activate before the Homepage set.

Also while searching the help file i found out about "winactivate" which also helps just in case another windows loads over IE so here is my code i think its logical (for the most part)

Opt("WinTitleMatchMode", 2)
Run ("C:\Program Files\Internet Explorer\iexplore.exe", "", @SW_MAXIMIZE)
WinWait ("D-LINK")
WinActivate("D-LINK", "")
WinSetOnTop("D-LINK", "", 1)
MouseMove (820,332,0)
MouseClick ("left")

Thanks again

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...