Jump to content

WinSetTitle for third party software

Recommended Posts

  • 4 weeks later...
On 2/12/2017 at 6:09 AM, R0G said:

Are you sure the Window title is not being changed with WinSetTitle?

The title that you may think is not changing could be a label and not the Window title.

Thanks. The title I request with WinList is not changed... 

On 2/12/2017 at 5:23 PM, InunoTaishou said:

Try running your script as admin. Depending on the application you're interacting with, you need admin privileges from your script.

Thanks, I already do that. 

Link to post
Share on other sites
16 hours ago, InunoTaishou said:

Time for some debugging then. What window are you interacting with? Can you get the handle to the window?

Yes I can. As a matter of fact I am using the handle to add to the window title. So I tested it on Notepad and there it works, but not on this 3rd party software. 

Link to post
Share on other sites

Update: it is not caused by the software but  it rather has to do with user rights etc.

When software is located in c:\users\UserA\Desktop\Software

I could not change the title, with the tool running from the same location, with the same logged in user, even with adding #RequireAdmin

on a different computer I installed the software in :

If I install it in c:\Software

and the the tool on the desktop of userA, and it works....


So it could be this, or another difference between the computers. I will test some more

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By AndyS01
      I have a function that opens Notepad and sets its window title.  However, the title reverts to whatever its default was when the Notepad window gets focus.
      To reproduce, run my script and do not move the cursor or type anything.  Note that the Notepad window has a title of "abc 123".  Now, move the mouse over the Notepad window.  The title reverts to the default "Untitled - Notepad".  Note: This behavior is also produced when running the F1 Help example script WinSetTitle.au3.  Just move the mouse during the 2 second delay.
      My test script:
      Global $_Hwnd = 0 _OpenNotepad("abc 123") Func _OpenNotepad($sTitle) Local $pNotepad , $ret = 0 If $_Hwnd = 0 And WinExists($sTitle) Then $_Hwnd = WinGetHandle($sTitle) If IsHWnd($_Hwnd) Then ; Another session already started, so use it If WinExists($_Hwnd) Then $ret = 2 ; The session is still active EndIf EndIf If ($ret = 0) Then Local $exe, $class ; Start Notepad and save its window handle $exe = "Notepad" $class = "[CLASS:Notepad]" $pNotepad = Run($exe) WinWait($class) $_Hwnd = WinGetHandle($class) If $pNotepad = WinGetProcess($_Hwnd) Then Local $rrr1, $rrr2 $rrr1 = WinActivate($_Hwnd) $rrr2 = WinSetTitle($_Hwnd, "", String($sTitle)) ConsoleWrite("+++: $rrr1 = " & $rrr1 & ", $rrr2 = " & $rrr2 & @CRLF) Else $ret = 3 EndIf EndIf Return SetError($ret, 0, 0) EndFunc ;=>_OpenNotepad  
    • By AutoitMike
      I saw a post dated 2013 about WinSetTitle not working in Win7 64bit. No answer there for me.
      I am trying to set the title of a window, the function returns success and the title is changed for about 50 ms and then reverts back to its original value.
      #RequireAdmin makes no difference in operation.
      I have tried using the handle, the title and the class to define the window. Operation is the same for all three ways.
      WinSetTitle("Old Title", "", "New Title")
      WinSetTitle("[Class:Class name]","","New Title")
      WinSetTitle(handle,"","New Title")
      All functions report success.
      WinActivate("PxxCXpbHG", "Text")
      WinSetTitle("PxxCXpbHG ", "Text","New title")
      sleep (100)
      MsgBox(0,"", $M1 & "  " & $M2) ;------------------> "New Title"  "PxxCXpbHG"
      If I change Sleep to 50 , then it is "New Title", "New Title" so somewhere between 50 and 100 ms it gets changed back,but by what??
      Thanks for any help in this matter.
  • Create New...