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