• 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: Receiving global window events?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Receiving global window events?


  • Subject: Re: Receiving global window events?
  • From: Eric Schlegel <email@hidden>
  • Date: Wed, 16 Feb 2011 12:50:01 -0800

On Feb 16, 2011, at 12:21 PM, Mr. Gecko wrote:

> eventType.eventClass = kEventClassWindow;
> eventType.eventKind = kEventWindowCollapsing;
>
> I would expect this to work as it works for keyboard and mouse events.

From CarbonEvents.h:

/*
 *  GetEventMonitorTarget()
 *
 *    Currently, the event monitor supports the following event kinds:
 *    kEventRawKeyDown, kEventRawKeyUp, kEventRawKeyRepeat,
 *    kEventRawKeyModifiersChanged, kEventMouseDown, kEventMouseUp,
 *    kEventMouseMoved, kEventMouseDragged, kEventMouseWheelMoved,
 *    kEventTabletPoint, and kEventTabletProximity.

The event monitor target does not support window-class events. It is not possible to install a Carbon event handler on the event target for a window of another process.

The only supported way to detect window events in other processes is to use the accessibility API. In this case, you'd want to use some of these notifications:

kAXWindowMiniaturizedNotification
kAXWindowDeminiaturizedNotification

and kAXUIElementDestroyedNotification for detecting when a window closes.

-eric

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Receiving global window events?
      • From: "Mr. Gecko" <email@hidden>
References: 
 >Receiving global window events? (From: "Mr. Gecko" <email@hidden>)

  • Prev by Date: Receiving global window events?
  • Next by Date: System Prefs trying to relaunch in 32bit mode
  • Previous by thread: Receiving global window events?
  • Next by thread: Re: Receiving global window events?
  • Index(es):
    • Date
    • Thread