windows at foreground but not focused

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
pantik
Junior Coder
Posts: 45
Joined: Sun Dec 13, 2009 5:52 pm

windows at foreground but not focused

Post by pantik » Tue Dec 15, 2009 8:39 pm

i have a application that creates several windows and when one of them requieres a action the application put the windows in top of all but it is not activated, i.e. the windows is at foreground but is not activated (not receive the focus). For that reaseon i cannot use "WaitWindowChanged"or "OnEvent>WINDOW_NEWACTIVE".

Is there any way to detect this?

Thanks by advance.

pantik
Junior Coder
Posts: 45
Joined: Sun Dec 13, 2009 5:52 pm

Post by pantik » Wed Dec 16, 2009 9:41 pm

Any answer ? If you dont understand me (i am spanish) i could try explain it with others words.

Thanks.

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Dec 17, 2009 8:49 am

WaitScreenImage
WaitScreenText
WaitPixelColor
GetActiveWindow (? not sure if that will work in this case)
LibFunc with Win32 API GetForeGroundWindow ?
..
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

pantik
Junior Coder
Posts: 45
Joined: Sun Dec 13, 2009 5:52 pm

Post by pantik » Thu Dec 17, 2009 2:05 pm

mtettmar wrote:WaitScreenImage
WaitScreenText
WaitPixelColor
GetActiveWindow (? not sure if that will work in this case)
LibFunc with Win32 API GetForeGroundWindow ?
..
WiatScreenText-> They are flash windows and it does not work
WatiPixelColor -> All windows are same so i could not identify the windows go to foreground.
GetActiveWindows -> The window is in foreground but it is NOT ACTIVATED. ( i already tried it)
LibFunc with Win32 API GetForeGroundWindow --> I will try.

Thanks.

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Dec 17, 2009 2:09 pm

So these two windows are 100% identical? Really? How do YOU know which one to click on. Surely if one is not active it must be greyed out somewhere or there must be *some* kind of visual cue, otherwise how does a mere human know which one to click on. If there's a visual cue you can surely use WaitScreenImage or WaitPixelColor.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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