Change window title?
Moderators: Dorian (MJT support), JRL
Change window title?
Is there a way to use Macro Scheduler to change a window title?
I have a webpage that provides an online test. I don't want my students to take the test at home, so I don't want them to know the URL.
I turned off the address toolbar, but IE then puts the address in the title. Can I override that title?
Rodger
I have a webpage that provides an online test. I don't want my students to take the test at home, so I don't want them to know the URL.
I turned off the address toolbar, but IE then puts the address in the title. Can I override that title?
Rodger
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Well if this is a web page that you wrote then simply change the TITLE tag in the HTML.
Otherwise, yes, you can do this:
GetWindowHandle>Existing Window Title,hwnd
LibFunc>User32,SetWindowTextA,r,hwnd,New Window Title
Otherwise, yes, you can do this:
GetWindowHandle>Existing Window Title,hwnd
LibFunc>User32,SetWindowTextA,r,hwnd,New Window Title
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
After I turned off the address bar, IE put the URL in the title bar. (it shows up that way on your next load of IE).mtettmar wrote:Well if this is a web page that you wrote then simply change the TITLE tag in the HTML.
Wow, thanks. This was the key. I get what I wanted with this.mtettmar wrote:Otherwise, yes, you can do this:
GetWindowHandle>Existing Window Title,hwnd
LibFunc>User32,SetWindowTextA,r,hwnd,New Window Title
Rodger
Re:
Thanks, this work but after changing the window title, how can I made it become the active window or activate the new window to become active window?Marcus Tettmar wrote:Well if this is a web page that you wrote then simply change the TITLE tag in the HTML.
Otherwise, yes, you can do this:
GetWindowHandle>Existing Window Title,hwnd
LibFunc>User32,SetWindowTextA,r,hwnd,New Window Title
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Change window title?
To activate a window use SetFocus:
SetFocus>window_title
SetFocus>window_title
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: Change window title?
I think you misundertand my question, I mean when after window title changed, sometimes that particular windows is minimise to taskbar, I want to restore/become the active window on my desktop or the top most windows on my computer screen.Marcus Tettmar wrote:To activate a window use SetFocus:
SetFocus>window_title
SetFocus command didnt do/work that way.
Re: Change window title?
That's all the SetFocus> command does do. If it did not restore the window then most likely you have not specified the window name correctly. Actually since in this process you have already acquired the window handle, the best thing would be to SetFocus to the window handle. You need to use the WIN_USEHANDLE variable to do that.SetFocus command didnt do/work that way.
Code: Select all
Let>WIN_USEHANDLE=1
SetFocus>hwnd
Re: Change window title?
Both of you are right, I'm sorry, it only works if I compiled the script into exe file. But theres one problem, if the windows task manager is the active window, the notepad window will change to Confirmed but it wont be on top of the task manager window, it will still be in minimise taskbar state. Any solution to that?
Code: Select all
Let>WIN_USEHANDLE=0
WaitWindowOpen>Untitle*
GetWindowHandle>Untitle*,hwnd
LibFunc>User32,SetWindowTextA,r,hwnd,Confirmed
GetWindowHandle>Confirmed,hwnd
Let>WIN_USEHANDLE=1
SetFocus>hwnd