cannondale 0 Posted July 16, 2013 Share Posted July 16, 2013 Guys, I'm running the following uncompiled code under Win7 64: msgbox(0, "WinExists", WinExists("ABC")) ;Returns 1 msgbox(0, "WinGetState", WinGetState("ABC")) ;Returns 15 $EC = WinSetTitle("ABC", "", "XYZ") msgbox(0, "WinSetTitle", $EC) ;Returns 0 The WinSetTitle function fails to change the title and returns 0 under Win7. However, the code works correctly under XP. What am I missing? Link to post Share on other sites
Artisan 4 Posted July 16, 2013 Share Posted July 16, 2013 (edited) I tested with the following code on both Win7 x32 and Win7 x64 (I don't have a WinXP copy to test with): $OldTitle = "AutoIt Help" $NewTitle = "This is a test." msgbox(0, "WinExists", WinExists($OldTitle)) ; Returns 1 msgbox(0, "WinGetState", WinGetState($OldTitle)) ; Returns 39 (32 + 4 + 2 + 1) msgbox(0, "WinSetTitle", WinSetTitle($OldTitle, "", $NewTitle)) ; Returns 1 WinSetTitle($NewTitle, "", $OldTitle) It worked as expected on both systems. I looked at the helpfile while the 3rd message box was up, and the title did indeed change. If it's not working for you still, check what you're using for "ABC" and "XYZ". I can't say more without knowing your existing window titles and what your actual strings. Edited July 16, 2013 by Artisan Link to post Share on other sites
Solution wraithdu 85 Posted July 16, 2013 Solution Share Posted July 16, 2013 My guess is a security problem. What window are you trying to change? Does it work if you specify #RequireAdmin? Link to post Share on other sites
cannondale 0 Posted July 16, 2013 Author Share Posted July 16, 2013 Thanks for the tips guys. The #RequireAdmin fixed the issue in Win7. Documenting here for future reference. Thanks Link to post Share on other sites
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now