Man sollte alles lesen:
Zitat:
Note that you must set MENUITEMINFO.cbSize to sizeof(MENUITEMINFO) before calling this function.
Aber mii.hSubMenu ist immer noch null. Der Menüpunkt "Sprache" ist als Popup deklariert in der Ressource. Und im
PSDK steht:
Zitat:
hSubMenu
Handle to the drop-down menu or submenu associated with the menu item. If the menu item is not an item that opens a drop-down menu or submenu, this member is NULL. Set fMask to MIIM_SUBMENU to use hSubMenu.
Also sollte es das doch tun:
Delphi-Quellcode:
hMenu := GetMenu(hDlg);
hSubMenu := GetSubMenu(hMenu, 3);
ZeroMemory(@mii, sizeof(TMenuItemInfo));
mii.cbSize := sizeof(TMenuItemInfo);
mii.fMask := MIIM_SUBMENU;
GetMenuItemInfo(hSubMenu, 0, True, mii);
AppendMenu(mii.hSubMenu, MF_STRING, 0, 'Test');