Re: Top-10 Accessibility API Wish List
Re: Top-10 Accessibility API Wish List
- Subject: Re: Top-10 Accessibility API Wish List
- From: Michael Kamprath <email@hidden>
- Date: Thu, 12 Sep 2002 19:50:01 -0700
on 9/11/02 11:12 PM, Eric Schlegel at email@hidden wrote:
>
On Wednesday, September 11, 2002, at 10:57 PM, Michael Kamprath wrote:
>
>
> Just out of curiosity, OS X has Cocoa and Carbon API's, and WNE-based
>
> apps
>
> are really Carbon Event apps layered on top of the Carbon Event model.
>
> I'm
>
> going to assume Classic apps are what you are talking about as
>
> "non-Carbon
>
> Event" windows, or is there are third type of application (Java
>
> Swing???)
>
> that aren't Cocoa-based or can't understand Carbon Events?
>
>
No, Guy is talking about WNE-based apps here. If the app is
>
Carbon-event-based, it's easy for us to send a kEventWindowClose event
>
to the window, and the app should respond to that as if the close box
>
had been clicked. If the app is WNE-based, however, at a minimum we
>
would need to post a mouse-down/mouse-up pair over the close box in
>
order to fool the app into thinking that the user had clicked on the
>
close box, and depending on the app, even that might not be enough.
>
That's the "puppet stringing" that Guy is referring to.
I've already solved this "puppet stringing" problem many years ago ;-)
I did this exact same "puppet stringing" under MacOs 7-9 by simply patching
FindWindow(), which I'm sure you recall from the Classic Mac OS days takes a
Point and returns a window pointer and a window part code. To single closing
a particular window, I'd enter into a private map (keyed by application) the
desired window pointer to close and an associated obscure mouse-down point
uniquely create for signaling the that particular window's closure. The
obscure point was something like ( -8000, -8000 ), a fairly safe bet no one
has screen real estate there. Then I'd post a mouse down event into that
application's event queue for that obscure mouse point.
Then, in my patched FindWindow() method, when ever it got called, I'd check
the mouse location passed against my list of pending window closures. If the
passed point matched one of my obscure points in the list, I'd return the
associated window pointer and a part code of the close box. Of course, I'd
also remove the processed window from my pending list.
This worked like a charm, and I also used the method to select windows to
(return a part code of the window's title bar). It wasn't difficult to code
either - hint hint ;)
Ah, the good old days of being able to patch system traps to get what you
want . . . .
Michael F. Kamprath
email@hidden
Keyboard Maestro - Conduct Your Mac Like a Pro!
Download a free copy today at: www.KeyboardMaestro.com
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.