Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining screen coverage of an application




On Oct 26, 2005, at 7:57 AM, Gregory Cooksey wrote:

I'm developing a testing tool that will be sending random mouse clicks to an application, and I want to make sure that it only sends clicks with valid coordinates for the application. How can I determine whether or not a coordinate point falls within one of my target application's windows? I can walk the AXUIElement tree and figure out the application's window positions and sizes, but that won't help me with the rounded edges on windows and drawers.

The Window Server is able to determine what application the cursor is over so that it can properly route mouse events; is there any way that I can get it to share that knowledge with me about an arbitrary point?

If you're running in-process, I believe you could call FindWindow and see if you get back a WindowRef.


If you're running out-of-process, I think the Accessibility API is your only way. You can use AXUIElementCopyElementAtPosition to find the element at a given position, and then AXUIElementGetPid to determine the process that owns that element.

-eric

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Determining screen coverage of an application (From: Gregory Cooksey <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.