• 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: Second frontmost app?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Second frontmost app?


  • Subject: Re: Second frontmost app?
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Tue, 28 Apr 2009 18:57:21 +0200

Don't bother with that. I did a try, and it look like the Process Manager order has nothing to do with the cmd + tab order.
it returns -600, probably because psn is the last process in the Process Manager list.
Sorry for the noise.



Le 28 avr. 09 à 17:55, Dave DeLong a écrit :

Well, I got this working with a timer that just keeps track of the activeApplication and the previously activeApplication, but I'm intrigued by this approach, so I'd like to see if this works, too.

Here's what I've got:

	ProcessSerialNumber psn;
	OSErr result = GetCurrentProcess(&psn);
	if (result != 0) {
		NSLog(@"Error for current process: %d", result);
		return;
	}
	result = GetNextProcess(&psn);
	if (result != 0) {
		NSLog(@"Error for next process: %d", result);
		return;
	}

However, when I run that, I always get:

Error for next process: -600 (-600 = No eligible process with specified process serial number.)

Any ideas?

Thanks,

Dave

On Apr 28, 2009, at 1:44 AM, Jean-Daniel Dupas wrote:

You can use the ProcessManager API.
AFAK, the GetNextProcess() will returns the processes in the order you see them in the cmd+tab panel.
_______________________________________________

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


_______________________________________________

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: Second frontmost app?
      • From: "Gary L. Wade" <email@hidden>
    • Re: Second frontmost app?
      • From: Dave DeLong <email@hidden>
References: 
 >Second frontmost app? (From: Dave DeLong <email@hidden>)
 >Re: Second frontmost app? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Second frontmost app? (From: Dave DeLong <email@hidden>)

  • Prev by Date: Re: Bindings confusion
  • Next by Date: Re: Why is NSString->FSRef so hard?
  • Previous by thread: Re: Second frontmost app?
  • Next by thread: Re: Second frontmost app?
  • Index(es):
    • Date
    • Thread