Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing Pad/Bar Prompt at run-time
Message
From
29/07/2004 06:59:38
 
 
To
29/07/2004 06:02:59
Emanuele Bonin
EB Soluzioni Informatiche
Tezze S/B, Italy
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00928219
Message ID:
00929106
Views:
22
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform