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

Am 09.02.2011 um 16:23 schrieb Mr. Gecko:

Hello, I am wondering how I can get the last front application ProcessSerialNumber so I can use SetFrontProcess to bring it back to front after they close the window to my application. My application is a UIAgent so it doesn't have a dock icon and I am thinking that the user would like it more if when they close the window to my application it will make the previous application so it's front. The way they open my window is by opening the application via the finder or dock (if they have it in the dock). My application runs in the background to keep track of things and I know my customers would not want a menubar icon as I don't want one as well. I know there is GetFrontProcess, but that is useless when the application becomes front before I call it due to them opening it in the finder and GetNextProcess gets Quick Look Helper.

I hope I explained things well, thanks for any help.
Mr. Gecko_______________________________________________



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to