Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing Pad/Bar Prompt at run-time
Message
De
30/07/2004 05:45:01
Emanuele Bonin
EB Soluzioni Informatiche
Tezze S/B, Italie
 
 
À
30/07/2004 03:19:52
Emanuele Bonin
EB Soluzioni Informatiche
Tezze S/B, Italie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00928219
Message ID:
00929505
Vues:
19
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform