Hey Peter,

you are right. 
AXUIElementPerformAction(windowElement, kAXIncrementAction); Has no effect.
I also recognized that the AXRaise seems to be not exactly what i wanted.
If I raise a window for the first time it works fine. If I raise other windows 
after that and try to raise the first window
again it sometimes doesn't become the "frontMost" window. I guess I have an 
error in my understanding of AXRaise.

You are right. This is not a suitable solution. I was just happy to see that it 
could work.

The keys I inquire in CGWindowListCopyWindowInfo() are: kCGWindowOwnerPID and 
kCGWindowNumber (but kCGWindowNumber is totally pointless here because i cannot 
use it for accessibility api). I try to gather all windows which belong to the 
same ProcessID so the user can select one and set it front most (using AXRaise).

Cheers
Benedikt





On 28.02.2011, at 16:03, Peter Lübke wrote: 

> 
> Am 28.02.2011 um 15:10 schrieb Benedikt Iltisberger:
> 
>> Hey Peter,
>> 
>> I did it exactly like you proposed. Works perfect :-)
>> I am using following calls to make a selected window front most:
>>  
>> AXUIElementPerformAction(windowElement, kAXRaiseAction);
> 
> This should be sufficient to bring the window to front.
> 
>> AXUIElementPerformAction(windowElement, kAXIncrementAction);
> 
> Are you sure this has any effect? As far as I can see, AXWindow doesn't have 
> a settable AXValue attribute, so why increment a non-existing value?
> 
>> 
>> I simply used the fact that  and kAXWindowsAttribute arrange their arrays in 
>> the same order.
>> I did some testing and its working fine :-)
>> 
> 
> Fine it works for you like this - but I still see a problem:
> The fact that two different APIs return the items in the same order on your 
> configuration doesn't at all prove this is going to be true for other users' 
> configuration, other OS versions...
> 
> Maybe we can find a cleaner solution before I have my Weissbier, so I keep 
> asking for the key / value you inquire in CGWindowListCopyWindowInfo() to 
> decide which is the desired window?
> 
> 
>> Thank you very much and I hope you are going to have a decent bavarian 
>> Weissbier tonight. I am going to have one for sure :-) 
>> 
>> Kind regards,
>> Benedikt
> 

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to