Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Open event on application startup is mangled in 10.4.11?



Hello,

Since 10.4.11 it seems that the open event that is sent to my application when it is started by (for example) dropping a file on the application icon in the Finder has changed compared to earlier releases.
I try to discover the ProcessSerialNumber of the open event. Based on this I determine the application that sent the document. Then I decide a certain action to occur on the document. Up to 10.4.11 and on 10.5.1 this works fine. But on 10.4.11 the source is always the application itself. Once my application is running, any subsequent open event has the correct source ProcessSerialNumber set.
What I'm looking for is an idea on how to find out where the document is coming from in the startup phase of my application. Any ideas anybody?


Here is the code I'm using:
(CFDictionary *)CreateAppInfoFromDescriptor(const AEDesc *event)
{
    OSErr err;
    ProcessSerialNumber appPSN;
    DescType returnedType;
    Size actualSize;
    CFDictionary *appInfo;

appPSN.highLongOfPSN = 0;
appPSN.lowLongOfPSN = kNoProcess;
appInfo = NULL;
// Whodunnit?
err = AEGetAttributePtr(event, keyAddressAttr, typeProcessSerialNumber,
&returnedType, &appPSN, sizeof(appPSN), &actualSize);
if (noErr == err && kNoProcess != appPSN.lowLongOfPSN)
{
appInfo = ProcessInformationCopyDictionary((const ProcessSerialNumberPtr)(&appPSN), kProcessDictionaryIncludeAllInformationMask);
}
return appInfo;
}


Thanks!
Annard
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.