• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Get screen information from a window AXUIElementRef?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get screen information from a window AXUIElementRef?


  • Subject: Re: Get screen information from a window AXUIElementRef?
  • From: James Dempsey <email@hidden>
  • Date: Mon, 31 Aug 2009 10:44:44 -0700

Note that the NSAccessibility APIs are used by an application to return the appropriate accessibility information to an accessibility client. You would be using the AX APIs as an accessibility client to get information about other apps on the system.

That said, your best bet might be to get the AXSize an AXPosition of a window through accessibility. This will give you back the bounds, where the upper left hand corner of the main screen is the origin. (Note this is different than NSScreen, which uses the lower left hand corner of the main screen).

You can then use a CG call:

CGGetDisplaysWithRect() to get returned the display(s) that intersect the bounds of the window. Of course, a window can span multiple displays.

This might be the easiest approach, since both APIs use the same coordinate space. You can then get information about the displays returned using various functions like CGDisplayScreenSize() and CGDisplayIsMain().

When you say "applying controls to other applications' windows", I am guessing you mean some overlay controls in your process that are not part of the actual app itself. One drawback to that, of course, is that it actually makes the application in question less accessible with your utility running, since a VoiceOver user will likely be pretty lost as to what is really going on.

-James


On Aug 30, 2009, at 3:59 PM, aaron smith wrote:

Hello, quick question.

I'm looking for a way to find which screen a window is on from the
accessibility api, and query the screen for information (size, etc).
I've been searching through the NSAccessibility protocol reference and
don't see anything glaringly obvious. I've looked through a few other
accessibility documents and still don't see anything glaring.

Can accessibility give me this info?

Some pointers in the right direction would definitely help.

Oh, and the reason I'm looking through accessibility is because I'm
not just controlling my application (otherwise i'd use NSScreen /
[window screen]), it will be applying controls to other applications'
windows.

Thanks much!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (Accessibility- email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

-------------------------------------------------- James Dempsey AppKit Engineering Apple email@hidden



_______________________________________________
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


References: 
 >Get screen information from a window AXUIElementRef? (From: aaron smith <email@hidden>)

  • Prev by Date: Synth and Voice Examples not working under the new cat
  • Previous by thread: Get screen information from a window AXUIElementRef?
  • Next by thread: Synth and Voice Examples not working under the new cat
  • Index(es):
    • Date
    • Thread