• 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: Tue, 11 Jun 2002 18:17:12 +0930

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;

just about all of these functions return a value of noErr if they succeed so you should really check that

On Tuesday, June 11, 2002, at 03:34 AM, Renaud Boisjoly wrote:

Hullo!

I'm looking for a way to determine if the frontmost app is a Classic app or not. I've looked in the documentation and in the archives, but I cannot find mention of this. Any attempt to get info on the current process does only just that, give me info on my own process.

I just want to be able to tell if the frontmost window is from a classic app or not

thanks for any pointers!
_______________________________________________
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: Renaud Boisjoly <email@hidden>
References: 
 >Current process (From: Renaud Boisjoly <email@hidden>)

  • Prev by Date: Re: ATSU and CGContextRef newbie question
  • Next by Date: IB 2.2 Autoresizing problems
  • Previous by thread: Current process
  • Next by thread: Re: Current process
  • Index(es):
    • Date
    • Thread