Set window title for "any" open window

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Set window title for "any" open window

Post by Grovkillen » Tue May 09, 2023 5:41 am

Code: Select all

Let>WINDOW_TITLE_TO_CHANGE=Explorer<---change this to the title of your target window
Let>WINDOW_TITLE_TO_SET=Yo!

GetWindowHandle>WINDOW_TITLE_TO_CHANGE,WINDOW_handle
LibFunc>User32,SetWindowTextA,DID_IT_CHANGE,WINDOW_handle,WINDOW_TITLE_TO_SET
MDL>DID_IT_CHANGE
Observe that some windows will not expose the Windows window frame and thus not comply to the standard = will not change its title this way. Another thing to remember is that the GetWindowHandle command only look for a window which match the title and the first one it is happy with get returned as a handle.
Last edited by Grovkillen on Tue May 09, 2023 8:42 pm, edited 1 time in total.
Let>ME=%Script%

Running: 15.0.27
version history

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1384
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Set window title for "any" open window

Post by Dorian (MJT support) » Tue May 09, 2023 8:55 am

I like it!!
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts