Jump to content

WinSetTitle not working Win7


Recommended Posts

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.

EG:

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")

$M1=WinGetTitle("[ACTIVE]","")
sleep (100)
$M2=WinGetTitle("[ACTIVE]","")

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.

 

 

 

 

Link to comment
Share on other sites

Works for me, what program are you trying to rename?

del.PNG

del.PNG

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

10 minutes ago, AutoitMike said:

Its a propitiatory inspection reporting program called HomeGauge.

You can download a trial version.

 

Work PC won't let me install it, I'll take a look at it tonight and see what's up.

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

rcmaehl,

I think it might be futile to change the title bar text.

The title bar gets reset every time a new section is selected. I am going to have to get the authors of the program to put the value I need in the title bar.

Otherwise, I would have to have a program running in the background monitoring multiple instances of this program keeping the respective title bars updated.

What i am looking to do is to put the report number as an addition to the existing text or to replace what is in the title bar so that 2 or more reports for the same client produce unique window titles.

 

 

Link to comment
Share on other sites

Seems, this is a behaviour from the app you want to automate, which also uses a feature to change titlebar text. Use a adlib func with short time (maybe 50 ms) to set the text you need.

But title changing don't change the Hwnd returned from WinActivate. So i suggest read about:

  • Window Titles and Text (Basic)

  • Window Titles and Text (Advanced)

in helpfile. The Hwnd can be used for (all?) most Win* functions for example WinWaitActive. And each from your instances have his own Hwnd.

Edited by AutoBert
Link to comment
Share on other sites

Interesting function, Adlib. However, I just got a brainstorm.

Once ANY window is created in windows, under no circumstance, the window handle is duplicated, right ?

Once an instance of the application is opened, I can grab its handle, store it in my automation app. and use it to select the correct window when needed?

 

 

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

×
×
  • Create New...