Having a tough time with Set_Focus and child windows

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
KWiz
Junior Coder
Posts: 30
Joined: Sat Oct 07, 2006 1:43 pm

Having a tough time with Set_Focus and child windows

Post by KWiz » Fri Sep 09, 2011 1:59 pm

I'm using eSignal, which is stock charting software. I can undock the charts from the main software, so they are free-floating. I guess you would call these floating charts "child windows", no?

So one of these charts I simply call 1.ach. When I use the SetFocus command, it sets focus to 1.ach (or whichever chart I choose), but then the main software essentially becomes unusable. I can no longer click open the menu from the main software. I don't really understand the connection there.

I thought it might have something to do with Win_Usehandle, so I tried setting that to 1 to no avail. I thought it might have something to do with WF_type, so I set the WF_type to 1 for child windows, but to no avail.

What I am basically trying to do here is to setfocus to one of my charts, such as 1.ach, and still have my trading platform/software to be usable.

Any thoughts or suggestions?

Thanks,
KWiz

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Sep 12, 2011 5:58 pm

Try getting the handle to the main window at software start or at least prior to setting focus to any of the charts. When you want to return to the main window, Set Win_Usehandle to 1 (one) then set focus to the main window via its handle.

KWiz
Junior Coder
Posts: 30
Joined: Sat Oct 07, 2006 1:43 pm

Post by KWiz » Mon Sep 12, 2011 8:11 pm

Ahh, that worked! You guys are awesome, I tell ya!

Thanks so much,
Kwiz

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