Re: Get ProcessSerialNumber of last front application
Re: Get ProcessSerialNumber of last front application
- Subject: Re: Get ProcessSerialNumber of last front application
- From: "Mr. Gecko" <email@hidden>
- Date: Wed, 9 Feb 2011 10:41:06 -0600
I'm looking for the process that was front before my application became front. I was thinking in getting the process as this is what I did in my menubar applications and I just stole code from them. I can do as Dave DeLong said and hide the application using [[NSApplication sharedApplication] hide:self]; and it does infact brings the finder to the front. This is an option with this application as I don't open any other window than the one when you open the application from the finder. But with other applications, it's not an option as there may be multiple windows for that one application open and when you hide, it will also hide the other windows they had open. I would be wondering how I can get the last front application (kinda how the dock does) so if I need to write an application in the future that needs multiple windows and also needs to be a UIAgent it would do the proper thing. I don't need to know this now, if it's not possible than fine, but if anyone out there knows how and wants to share, please do.
On Feb 9, 2011, at 10:33 AM, Peter Lübke wrote:
> GetNextProcess() doesn't reflect the order in which processes were made front, as the Process Manager doc says:
> "Note that the order of the list of processes is internal to the Process Manager"
> which *seems* to be the order in which processes register with Process Manager; if this is true (I don't know whether you can rely on it), you could at least use GetNextProcess() to track the (backwards) order in which processes registered with process manager.
>
> An easy way to look at this is an AppleScript:
>
> tell application "System Events"
> name of every process
> end tell
>
> I don't quite understand the scenario though: are you looking for the process that was front before the user launched your application?
>
> Cheers
> -Peter
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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