Problem setting focus

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
arroni
Newbie
Posts: 2
Joined: Sat Nov 05, 2005 5:45 pm

Problem setting focus

Post by arroni » Sat Nov 05, 2005 5:47 pm

How can I set focus to a window that has no window title?

Thanks

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sat Nov 05, 2005 7:10 pm

Are you sure it has no title, or does it just not show the title bar? Have you checked under Tools/View System Windows to see if it is there?

Create the following script and assign it to a hotkey:

GetActiveWindow>title,x,y
MessageModal>title

Then when the window in question is active hit the hotkey for this macro and see what the message box says.
MJT Net Support
[email protected]

arroni
Newbie
Posts: 2
Joined: Sat Nov 05, 2005 5:45 pm

Post by arroni » Sun Nov 06, 2005 12:34 pm

Thanks for your reply


I want to switch focus to a application called "Modulolibro". This program has (apparently) no name on window title and in taskbar its tab shows "Modulolibro". Also, it has several child windows without name on window title.

"System Window" utility shows:

>> 66766 - TFLibroTexto "     "
>> 66802 - TPanel "  "
>> 132288 - TApplication "Modulolibro"

I tried your script and the results are that the main program (Modulolibro) has 5 blank spaces on window title and its child windows has 6, 7 and 8 blank spaces on respectives window title.

So when I run SetFocus>     * the focus switchs to one of the child windows instead main program.




P.D. Thanks in advance and I hope you can understand my very poor english ;-)[/b]

Snickers
Macro Veteran
Posts: 150
Joined: Thu Dec 09, 2004 3:01 pm
Location: Somewhere in TX

use GAW

Post by Snickers » Wed Nov 30, 2005 4:49 pm

Use the GAW - GETACTIVEWINDOW command and it will retreive the title of your active window.

example:

Wait>3
GAW>TITLE,X,Y
MSG>TITLE

after you start your script, click on the main window within 3 seconds, or whatever wait time you put in the first line. There will be a message box that pops up after your wait time...whatever wait time you choose is fine. Just copy and paste the returned GAW message and you'll have your window title

EDIT:
I just realized that this message is a total echo of what was said above...

It isn't letting me delete this post ...sorry...disregard.


Instead of putting: SETFOCUS> *
just remove the "*" and it may work.

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