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