Mailing Lists: Apple Mailing Lists

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

About how to get print queue name in "Utility" button of Printer Setup Utility



Hi Dear all:

I make an application and registe it in ppd file. Then user can click the
"Utility" button to open the application.
I want to know which printer lauch this application. Following is the
message what paul wrote before about this topic.


I have a problem.
In an Carbon application, how to get the luach params.

Paul write
> Print Center launches your utility by calling
> LSOpenFromURLSpec(&launchSpec, NULL). launchSpec contains the url to
> your utility and an Apple Event descriptor record in the
> passThruParams. The latter contains the queue id. The important
> thing to note is that the passThruParams are added to the event with
> the keyAEPropData, rather than keyAEData. So for your Utility to
> find out which printer was selected in the list when the Configure
> button was clicked, your code needs to pass the AEPropData keyword
> when calling targetData.GetOptionalParamDesc().
>
> Your Utility code should look something like this:
>
> if ( inAENumber == ae_OpenApp || inAENumber == ae_ReopenApp )
> {
> StAEDescriptor targetData;
> targetData.GetOptionalParamDesc( inAppleEvent,
keyAEPropData,
> typeWildCard );
> if ( targetData.IsNotNull() )
> {
> Size dataSize =
UExtractFromAEDesc::AEGetDescDataSize(
> targetData.mDesc );
> }
> }

What is the StAEDescriptor?
How to use in Carbon application?
I use err=AEGetAttributeDesc ( inEvent, keyAEPropData,
'prdt',&launchParams);
It seems no return noErr;

Could you give me some advise?
Regards
juwan
_______________________________________________
printing mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/printing
Do not post admin requests to the list. They will be ignored.




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.