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

Re: Current process


  • Subject: Re: Current process
  • From: Renaud Boisjoly <email@hidden>
  • Date: Tue, 11 Jun 2002 08:28:25 -0400

Hi Nathan

Thanks for the tip! Being a newbie, and Cocoa-only person right now, I'm somewhat confused by your code... sorry if this is obvious. So I simply tried to copy and paste your code, but it doesn't compile completely. I think this is Carbon code is it? I do have some Carbon calls in my app, but this doesn't quite add up.

If I copy and paste all this, I cannot compile it, I get "Invalid operands to binary &"

I'm not certain what to do, and I would not want your response to be wasted, so obviously there is something I did not get right.

I need to wrap this in a Cocoa method so I can simply check if the frontmost app is a classic app. Your code seems to return YES if this is the case...

Any clues? Thanks a lot for your time

Renaud

On Tuesday, June 11, 2002, at 04:47 AM, Nathan Day wrote:

Using the process manager and LaunchServices, something like this

ProcessSerialNumber theProccessSerialNumber;
FSSpec theSpec;
ProcessInfoRec theInfoRec;
FSRef theRef;
LSItemInfoRecord theItemInfo;

GetFrontProcess( &theProccessSerialNumber );

theInfoRec.processInfoLength = sizeof(ProcessInfoRec);
theInfoRec.processName = NULL;
theInfoRec.processAppSpec = &theSpec;

GetProcessInformation( & theProccessSerialNumber, &theInfoRec );

FSpMakeFSRef ( &theSpec, &theRef );

LSCopyItemInfoForRef( &theRef, kLSRequestBasicFlagsOnly, & theItemInfo);

return (theItemInfo & kLSItemInfoAppPrefersClassic) != 0;
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Current process
      • From: Nathan Day <email@hidden>
References: 
 >Re: Current process (From: Nathan Day <email@hidden>)

  • Prev by Date: Re: Sample Cocoa Core Foundation XML Parsing Code
  • Next by Date: Re: Current process
  • Previous by thread: Re: Current process
  • Next by thread: Re: Current process
  • Index(es):
    • Date
    • Thread