Hi herman!
The only way i found to change the submenu's caption is Hooking the messages sent to menu, below there is a piece of messages hook function that i used to change the first item in the submenu. The Api SetItemInfo seem don't work propwrly in this context.
if( code == MSGF_MENU) // WM_MSGFILTER Hook
{
int nMsg;
nMsg = (((PMSG)lparam)->message & 0x0ffff);
if(nMsg==WM_MENUSELECT) {
int nLowWparam, nHiWparam;
nLowWparam = (((PMSG)lparam)->wParam & 0x0000ffff);
nHiWparam = (((PMSG)lparam)->wParam & 0xffff0000);
if((nHiWparam >> 16) & MF_POPUP) {
MENUITEMINFO MII;
HMENU hSubMenu;
char text[100];
// Get menu bar
GetMenuString((HMENU)(((PMSG)lparam)->lParam), nLowWparam, text, 100, MF_BYPOSITION);
sprintf( text, "Menu %d", nLowWparam);
// Main voice modifycation
ModifyMenu((HMENU)(((PMSG)lparam)->lParam), nLowWparam, MF_BYPOSITION + MF_STRING, 0, text);
hSubMenu = GetSubMenu((HMENU)(((PMSG)lparam)->lParam), nLowWparam);
// Fist submenu voice modifycation
ModifyMenu(hSubMenu, 0, MF_BYPOSITION + MF_STRING, 0, text);
... ecc ....
bye, Emanuele!
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.