Re: Which app owns the menu bar?
Re: Which app owns the menu bar?
- Subject: Re: Which app owns the menu bar?
- From: Eric Schlegel <email@hidden>
- Date: Thu, 18 Oct 2007 15:31:13 -0700
On Oct 18, 2007, at 1:32 PM, Eric Schlegel wrote:
OK, I asked the Process Manager engineer about this and he explained
what's going on. GetNextProcess actually iterates in bottom-up
order, not top-down. If you start with GetFrontProcess, there is no
other process in front of the front process, so GetNextProcess
returns an error.
Instead, you might try initializing your PSN to {kNoProcess,
kNoProcess}, and then calling GetNextProcess in a loop until you ran
out of processes. As you see each process, make a note of it if it's
not a UIElement or BGOnly process. When the loop is done, the last
process that you recorded is the frontmost non-UIElement/BGOnly app.
Well, drat. It turns out I was wrong in this suggestion.
GetNextProcess is not returning processes in ascending order of the
process z-order (which wouldn't really make sense on Mac OS X
anyways); it's returning processes in ascending ordering of the PSN
value. So you really can't use GetNextProcess to determine which
process is frontmost.
Unfortunately, I think this means there's no good way to determine
which app owns the menubar. GetFrontProcess doesn't do it if a
UIElement is focused, and GetNextProcess won't return the process list
in a useful order.
You might have to fall back on the AppleScript solution that you
mentioned earlier.
-eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden