• 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: UIElement activation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UIElement activation


  • Subject: Re: UIElement activation
  • From: Thierry Passeron <email@hidden>
  • Date: Thu, 19 Jan 2006 13:44:59 +0100

>> Now the problem is that if I type the hotkey again, the
>> window appears but no keyboard handling, the focus is still on an
>> other app even with my window orderedFront.
>
>Have a look at "-[NSApplication activateIgnoringOtherApps:]". It
>might be what you need.
>Just be careful - applications that steal focus from other apps can
>be very annoying!

Ok, thanks, the activation works. But how can I save the process
number that was active before I activated my app. And then when the
app is not active anymore, make the saved process number the active
process again.

I tried with GetFrontProcess() in the applicationWillBecomeActive:
delegate method but it always returns 0 as the PSN.

- (void) applicationWillBecomeActive:(NSNotification *)aNotification
{
     if(GetFrontProcess(&_activeApp)==noErr)
     {
          NSLog(@"Saved front process: %d",_activeApp);
     }else{
          NSLog(@"Error getting fron process number");
     }
}

also when my app wants to deactivate [NSApp deactivate] doesn't work.

Any suggestion ?

Best regards,
Thierry Passeron
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: does NSMenuItem setMixedStateImage or setOnStateImage work?
  • Next by Date: Re: CORE DATA: derived values from several entities and managed object instances ??
  • Previous by thread: Re: UIElement activation
  • Next by thread: how to generate a map from gis data
  • Index(es):
    • Date
    • Thread