AutoitMike Posted September 5, 2016 Posted September 5, 2016 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.
rcmaehl Posted September 5, 2016 Posted September 5, 2016 (edited) Works for me, what program are you trying to rename? Edited September 5, 2016 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, MSEdgeRedirect Cisco Finesse, Github, IRC UDF, WindowEx UDF
AutoitMike Posted September 5, 2016 Author Posted September 5, 2016 Its a propitiatory inspection reporting program called HomeGauge. You can download a trial version.
rcmaehl Posted September 5, 2016 Posted September 5, 2016 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, MSEdgeRedirect Cisco Finesse, Github, IRC UDF, WindowEx UDF
AutoitMike Posted September 5, 2016 Author Posted September 5, 2016 After installing , Put the attached file under C:------------------>\HMA-HomeGauge\Templates. Then open HomeGauge, select the template you installed and enter a first and last name for Client. You will see in the title bar "PCXpbHG - Smith, Bob" as the title bar name. Thanks again JC Edits of Master Ver 2014-11-06.ht5
AutoitMike Posted September 5, 2016 Author Posted September 5, 2016 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.
AutoBert Posted September 6, 2016 Posted September 6, 2016 (edited) 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 September 6, 2016 by AutoBert
AutoitMike Posted September 6, 2016 Author Posted September 6, 2016 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?
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