Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing Pad/Bar Prompt at run-time
Message
De
29/07/2004 06:59:38
 
 
À
29/07/2004 06:02:59
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:
00929106
Vues:
23
>Hi Herman
>
>>I've tried to search the id using VFP API for an hour or so with no luck, hope someone can give you the answer. I only find the way through WINAPI. I can post the code if you still interesting. Also, by using WINAPI, I think you can do it from VFP
>
>I'm very interesting in the code. Can you public it ?

Of course. This code only enumerate the bar menu. To enumerate the drop-down menu you have to modify little bit (set MII.fMask to MIIM_DATA then get the structure that is pointed by MII.dwItemData)
HMENU          hMenu;
HWND           hWnd;
MENUITEMINFO   MII;
int            x, iCount;
char           itemText[80];

hMenu = GetMenu( hWnd );   // hWnd is a handle from Form.hWnd
iCount = GetMenuItemCount( hMenu );
for (x=0; x < iCount; x++)
{
    // Get menu bar
    MII.cbSize = sizeof( MII );
    MII.fMask = MIIM_STRING;
    MII.dwTypeData = itemText;
    MII.cch = sizeof( itemText );
    GetMenuItemInfo( hMenu, x, TRUE, &MII );

    // Set menu bar
    sprintf( itemText, "Menu #&%d", x );
    MII.cch = strlen( itemText );
    SetMenuItemInfo( hMenu, x, TRUE, &MII );
}
DrawMenuBar( hWnd );
Regards
Herman
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform