Re: Current process
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.