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 10:52:15 -0700
On Oct 18, 2007, at 10:41 AM, Scott Guelich wrote:
I know this has been asked dozens of times, but unfortunately none
of the answers I've found solves my problem. I'm working on an
accessibility utility and am trying to determine the frontmost
app... specifically the app that owns the menu bar.
The standard answer is "Use GetFrontProcess()," but unfortunately
that can sometimes return LSUIElement apps, even though they don't
have menu bars. For example, if I create an Xcode project and set
LSUIElement to 1, and then run it with the following code, I get
info back info on my own process instead of Xcode (which owns the
menu bar):
GetFrontProcess(&psn);
CFShow( ProcessInformationCopyDictionary( &psn,
kProcessDictionaryIncludeAllInformationMask ) );
Is there some simple way to do this that I've missed? Thanks...
I don't think there's any one-stop way to do this, but I think you
should get the right answer if you iterate over the process list,
starting with GetFrontProcess, and look for the first process that is
not a UIElement or BackgroundOnly process.
Please also file a bug requesting an API to do this; we have this
capability in the OS, it's just not exposed as API.
-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