Skip to main content
Participant
November 23, 2020
Question

How can I get the selected file with context menu?

  • November 23, 2020
  • 0 replies
  • 96 views

Hello.

I'm handling a ditamap file with FDK.

I would like to know the selected file name when I exceutes a context menu command at the ditamap pod.

I added my code below.

 

#define GET_FILE_NAME 1

 

VoidT F_ApiInitialize(IntT initialization)

{

   F_ObjHandleT specialMenuId;
/* Get the ID of the special menu. */
specialMenuId = F_ApiGetNamedObject(FV_SessionId, FO_Menu, (ConStringT)"!DitamapContextMenu");
/* Define the commands and add them to the Special menu. */
F_ApiDefineAndAddCommand(GET_FILE_NAME , specialMenuId, (ConStringT)"GetFileName", (ConStringT)"Get File Name", (ConStringT)"");

}

 

VoidT F_ApiCommand(IntT command)
{
  switch (command)
  {
    case GET_FILE_NAME :
       F_ApiAlert((ConStringT)"The file name is...!", FF_ALERT_CONTINUE_NOTE);

      // I want to get the selected file name here.

    break;
  };

}

 

Thanks.

 

This topic has been closed for replies.