Solved

Finder Get Info

Posted on 2000-04-10
2
333 Views
Last Modified: 2013-12-26
How can I get the Finder to display the Get Info window for a document from an FSSpecPtr to the document? Any suggestions?
0
Comment
Question by:dwp090598
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
roov earned 100 total points
ID: 2703074
You need to send the Finder an appleEvent, requesting for it to display the GetInfo box.

Below is the code, which MUST be called after initializing the Mac toolbox...

Enjoy,
Reuven

do {
      OSErr                  err = noErr, err2;
      AEAddressDesc      finderProcessDesc;
      OSType                  finderProcessSignature = 'MACS';
      AppleEvent            finderAEvent, finderAEventReply;
      AEDescList            docList;

      // Get Finder's process desciptor
      err = AECreateDesc(
                  typeApplSignature,
                  (Ptr)&finderProcessSignature,
                  sizeof(finderProcessSignature),
                  &finderProcessDesc);
      if (err != noErr)
            break;
      // Create AppleEvent to Finder
      err = AECreateAppleEvent(
                        kAEFinderEvents,
                        kAEGetInfoSelection,
                        &finderProcessDesc,
                        kAutoGenerateReturnID,
                        kAnyTransactionID,
                        &finderAEvent);
      // Plugin the file spec
      // This is a three step process:
      // 1. Prepare an AEList
      // 2. Plugin the file spec into the list
      // 3. Plugin the list into the AEvent
            // 1. Prepare an AEList
      err = AECreateList(nil,0,false,&docList);
      if (err != noErr) {
            // We could/should perform the test right after AECreateAppleEvent,
            // but since the bailing is the same...
            err2 = AEDisposeDesc(&finderProcessDesc);
            err2 = AEDisposeDesc(&finderAEvent);
            break;
      }
            // 2. Plugin the file spec into the list
      err = AEPutPtr(&docList,1,typeFSS,&fspec,sizeof(fspec));
      if (err != noErr) {
            err2 = AEDisposeDesc(&finderProcessDesc);
            err2 = AEDisposeDesc(&finderAEvent);
            break;
      }
            // 3. Plugin the list into the AEvent
      err = AEPutParamDesc (&finderAEvent,keyDirectObject,&docList);
      if (err != noErr) {
            err2 = AEDisposeDesc(&finderProcessDesc);
            err2 = AEDisposeDesc(&finderAEvent);
            break;
      }

      // Send the event of it's way...
      err = AESend(
                        &finderAEvent,
                        &finderAEventReply,
                        kAENoReply,
                        kAEHighPriority,
                        kAEDefaultTimeout,
                        NULL,
                        NULL);
      // Cleanup...
      err2 = AEDisposeDesc(&finderProcessDesc);
      err2 = AEDisposeDesc(&finderAEvent);
} while (false);

0
 

Author Comment

by:dwp090598
ID: 2709637
Thanks the  kAEGetInfoSelection worked for me.

Thanks Again
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question