Jump to content

WinSetTitle problems?


Recommended Posts

I'm trying to run a script that will run two instances of a program (that have the same title), move and resize each of them so they don't overlap, and change the title of each. The problem that I'm having though is that sometimes the WinSetTitle doesn't seem to work correctly. Here's my code of what I have so far:

Opt("MouseCoordMode", 1)

Run ("C:\Program Files\Dofus_Beta\Dofus.exe")

Sleep (3000)

WinSetTitle ("Dofus", "", "Dofus1")

Sleep (1000)

WinMove ("Dofus1", "", 0, 0, 960, 768)

Run ("C:\Program Files\Dofus_Beta\Dofus.exe")

Sleep (3000)

WinSetTitle ("Dofus", "", "Dofus2")

Sleep (1000)

WinMove ("Dofus2", "", 960, 0, 960, 768)

Thanks in advance,

Rossy

Link to comment
Share on other sites

This works for me

Opt("MouseCoordMode", 1)

Run ("notepad.exe")
WinWaitActive("")

WinSetTitle ("", "", "Dofus1")
Sleep (1000)
WinMove ("Dofus1", "", 0, 0, 400, 300)

Run ("notepad.exe")
WinWaitActive("")
WinSetTitle ("", "", "Dofus2")
Sleep (1000)
WinMove ("Dofus2", "", 400, 0, 400, 300)

8)

Wow, I'm intregued. I see you are using blanks to find the notepad window. Does that work because you use WinWaitActive and WinSetTitle right after notepad is run? That's pretty cool. Edited by JusGellin
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...