G
G
Gariks2013-02-07 20:56:00
C++ / C#
Gariks, 2013-02-07 20:56:00

How to make the main menu item POPUP (WinAPI) active?

I am writing a C program using WinAPI to create an interface.
There is a resource file in which a not tricky menu is written

IDR_MENU1 MENU
BEGIN
    POPUP "История"
    BEGIN
        MENUITEM "Открыть",                     IDM_OPEN
        POPUP "Сохранить", GRAYED
        BEGIN
            MENUITEM "Список контактов",            ID_40002, GRAYED
            MENUITEM "Переписку как...",            ID_40002, GRAYED
        END
        MENUITEM "Закрыть",                     IDM_CLOSE, GRAYED
        MENUITEM SEPARATOR
        MENUITEM "Выход",                       IDM_EXIT
    END
END

As you can see POPUP's "Save" option is GRAYED.
Question: how to make this item active using WinAPI?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Power, 2013-02-10
@Power

You need

EnableMenuItem(hHistoryMenu, 1, MF_BYPOSITION | MF_ENABLED);

where hHistoryMenushould point to a submenu that opens from the "History" item (to get, apparently, you need to use GetSubMenu(hMenu, 0)).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question