_GetOSPrompt( ) API Library Routine

Returns the text of a specified menu item. If the menu item contains an access key definition, the ampersand character is returned as well.

void _GetOSPrompt(MENUID menuid, ITEMID itemid, char FAR *text)
MENUID menuid;            /* ID of menu from which to get prompt */
MENUID itemuid ;            /* Index (0-based) of menu item. */
char FAR *text;               /* Text of menu command. */

Remarks

Can be used for developing applications with language-independent access keys.

For more information on how to create an API library and integrate it with Visual FoxPro, see Accessing the Visual FoxPro API.

Example

The following example returns the text of the first command on the File menu.

Visual FoxPro Code

SET LIBRARY TO MENUPROMPT

C Code

#include <pro_ext.h>

void FAR menuprompt(ParamBlk FAR *parm)
{
   char prompt[256] ;
   MenuId men ;
      
   men = _MenuId(_FILE);
   _GetOSPrompt(men, 0, prompt); //File New...

   _RetChar(prompt);
}
FoxInfo myFoxInfo[] = {
   {"MENUPROMPT", (FPFI) menuprompt, 0, ""}
};

FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};

See Also

Reference

_GetNewMenuId( ) API Library Routine
_MenuId( ) API Library Routine
_NewMenu( ) API Library Routine

Other Resources

API Library Construction
Accessing the Visual FoxPro API