Sign in to follow this  
Followers 0
Amn

WinSetTitle Not Working

13 posts in this topic

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.

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

have u tried?

ControlSend('Shadowbane', '', '', '{SPACE}')

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

post the informations u get with au3 info

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

one more Tip/Hint,

detect the window using [Class:Name] and then change it's title.

Maybe it will work, but i am not sure. just try it.

Share this post


Link to post
Share on other sites

How do you detect it by the class name. Could you toss an example my way?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Thats why there is #RequireAdmin

Share this post


Link to post
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
Sign in to follow this  
Followers 0