Re: Getting the host
Re: Getting the host
- Subject: Re: Getting the host
- From: Jim Wintermyre <email@hidden>
- Date: Wed, 3 Sep 2003 22:04:30 -0700
I remember this issue coming up once before, and there were a couple of
suggestions for getting the process name and using that. I saved the code
snippets. One way is this:
unsigned char * appname = LMGetCurApName();
That will get you a Pascal string in return. That I think is sort of a
legacy API, and this is probably the better way:
ProcessSerialNumber currentProcess = { 0, kCurrentProcess };
CFStringRef processName = NULL;
OSStatus status = CopyProcessName(¤tProcess, &processName);
Or, you can call GetProcessInformation and look at the
processSignature field of the ProcessInfoRec. This is the app's
creator code (which should be unique and registered with Apple). If
you had to hard-code something to behave differently under a
particular host app, this check would be safer since it's much less
likely to change than the actual name of the app.
Jim
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.