Jump to content

WinSetTitle Not Working


Amn
 Share

Recommended Posts

I've been trying to use WinSetTitle and other commands on my Shadowbane (a game) window. The command works with all of my other windows, just not the Shadowbane window. I've done a WinList and am sure the windows title is Shadowbane, and if I do a WinActivate it does activate the Shadowbane window, but I can not change the windows title, or send commands to it. A year or two ago I know I was able to do this, but I was using XP as opposed to Vista at the time. So I'm not sure if it is due to Vista (unlikely as I'm able to send commands to other windows and change their titles), or if there is something that's been done to the Shadowbane program to not allow this. Anywho, my question is if anyone knows of a work around for this. Thanks.

Link to comment
Share on other sites

post the code you have tried.

I've tried quite a few different things, but below are some examples.

This didn't work:

$tmpTitle = WinGetTitle("Shadowbane")

WinSetTitle($tmpTitle,"","SB")

This did (with a new notepad window open):

$tmpTitle = WinGetTitle("Untitled - Notepad")

WinSetTitle($tmpTitle,"","SB")

In that case I tried shortening the "Shadowbane" WinGetTitle down to "Sh" which should have worked also.

This worked fine using notepad:

While 1

WinActivate("Untitled - Notepad")

Send("{Space}")

sleep(1000)

Wend

This did activate the Shadowbane window, but did not send the Space being pressed (tried with several other buttons also, none were received by Shadowbane):

While 1

WinActivate("Shadowbane")

Send("{Space}")

sleep(1000)

Wend

I also tried using to use controlsend to both notepad and shadowbane, it worked fine in the case of notepad, not so much for shadowbane. Being that winactivate works with the shadowbane window I know that it's finding the shadowbane window, it's just not successfully interacting with it. Any ideas?

Link to comment
Share on other sites

have u tried?

ControlSend('Shadowbane', '', '', '{SPACE}')
Sure did. I even copy and pasted your code specifically, but no luck. As before though if I replace shadowbane with "Untitled - Notepad" is works fine on the notepad window. Any other ideas?
Link to comment
Share on other sites

post the informations u get with au3 info

This is what I pulled up using au3info, it seems the title is correct at least.

>>>> Window <<<<

Title: Shadowbane

Class: OpenGL

Position: 0, 0

Size: 800, 600

Style: 0x96000000

ExStyle: 0x00000000

Handle: 0x00000000000706A8

Also tried with the addition of Opt("WinTitleMatchMode", 2), but still no luck.

Edited by Amn
Link to comment
Share on other sites

Ok, figured it out, with some assistance from a friend. Wanted to thank you guys for the help though. The issue ended up being Vista (no big surprise). I had to set it up to run as admin, and even with it set that way you have to run them from the script editor in admin mode for it to affect that program. Simply double clicking the au3 won't run them in admin mode, despite the setting. 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...