Re: accessibility vs dock
Re: accessibility vs dock
- Subject: Re: accessibility vs dock
- From: Joshua Kifer <email@hidden>
- Date: Tue, 9 Dec 2003 17:58:12 -0500
On Dec 9, 2003, at 2:33 PM, Eric Schlegel wrote:
It uses notifications sent by CoreGraphics. At the Carbon event level,
these notifications are turned into kEventClassApplication events:
kEventAppFrontSwitched, kEventAppLaunched, kEventAppTerminated.
Currently there's no Carbon event to indicate when some other
application is hidden, though.
Ok, I've implemented like so (below), the return code from
InstallApplicationEventHandler is 0 (success?), yet I'm still not
receive any events. Any ideas why this doesn't work?
@implementation BARDWorkspaceAdditions
+ (id) alloc
{
return nil;
}
+ (void) enable
{
static BOOL enabled = NO;
if (enabled == NO)
{
NSLog(@"Enabling workspace additions.");
enabled = YES;
ProcessSerialNumber junkPSN;
GetCurrentProcess(&junkPSN);
EventHandlerUPP handlerUPP =
NewEventHandlerUPP(BARDWorkspaceAdditionsEventHandler);
EventTypeSpec eventTypes[3];
eventTypes[0].eventClass = kEventClassApplication;
eventTypes[0].eventKind = kEventAppLaunched;
eventTypes[1].eventClass = kEventClassApplication;
eventTypes[1].eventKind = kEventAppTerminated;
eventTypes[2].eventClass = kEventClassApplication;
eventTypes[2].eventKind = kEventAppFrontSwitched;
NSLog(@"%d", InstallApplicationEventHandler(handlerUPP, 3,
eventTypes, NULL, NULL));
}
}
@end
pascal OSStatus BARDWorkspaceAdditionsEventHandler(EventHandlerCallRef
nextHandler,
EventRef event,
void* userData)
{
NSLog(@"Event");
return noErr;
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.