Re: UIElement activation
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