• 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: Nathan Day <email@hidden>
  • Date: Wed, 12 Jun 2002 18:12:02 +0930

It might be that the GetFrontProcess function is return the psn number for the 'Classic Startup' app since all classic applications are running inside that, in which case you can use the FSRef struc obtained from the FSpMakeFSRef function and convert it to a path then test if the path is to 'Classic Startup' I think there is a function in carbon File Manager to convert a CFStringRef which is just a NSString* (just cast it) or else you can use the function CFURLCreateFromFSRef( kCFAllocatorDefault, theRef ) to get a CFURLRef which is just an NSURL.

If you have any more questions, you can email me off this mailing list.

On Wednesday, June 12, 2002, at 01:09 AM, Renaud Boisjoly wrote:

Hi again Nathan

It seems I always get a result of 0 from
(theItemInfo & kLSItemInfoAppPrefersClassic)

I tried using NSLog to show its value while SimpleText was running, but it always says 0... am I missing something? Perhaps I'm using this arong. What I did is the following:

- (BOOL)test {
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);
NSLog(@"Classic? %d",(theItemInfo.flags &kLSItemInfoAppPrefersClassic));
return (theItemInfo.flags & kLSItemInfoAppPrefersClassic) != 0;
// return theResult;
}

Which always returns NO it seems...

thanks for all your help!
_______________________________________________
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.

References: 
 >Re: Current process (From: Renaud Boisjoly <email@hidden>)

  • Prev by Date: Re: CFURLRef -> NSFileManager path
  • Next by Date: Re: Forwarding key events to a non first responder?
  • Previous by thread: Re: Current process
  • Next by thread: Sorting a two-dimensional NSMutableArray
  • Index(es):
    • Date
    • Thread