Подскажите пожалуйста, зачем нужна функция CreatePopupMenu ? То есть я понимаю зачем, чтобы, как раз создавать выпадающий список в меню. Но выпадающий в список в меню создается без проблем и без использования CreatePopupMenu, вот два варианта, один с CreatePopupMenu, другой только с AppendMenu:
HMENU My_Main_Menu_Bar = CreateMenu();
HMENU hPopMenuFile = CreatePopupMenu();
AppendMenu(My_Main_Menu_Bar, MF_STRING | MF_POPUP, (UINT)hPopMenuFile, "File");
AppendMenu(My_Main_Menu_Bar, MF_STRING, 1000, "Help");
AppendMenu(hPopMenuFile, MF_STRING , 1001, "Open");
AppendMenu(hPopMenuFile, MF_STRING , 1002, "Close");
SetMenu(hwnd, My_Main_Menu_Bar);
SetMenu(hwnd, hPopMenuFile);
и
HMENU My_Main_Menu_Bar = CreateMenu();
HMENU My_File_Menu = CreateMenu(); HMENU My_Help_Menu = CreateMenu();
Добавим кнопки в само меню: BOOL My_bool_AppendMenu1 = AppendMenuA(My_Main_Menu, MF_POPUP, (UINT_PTR)My_File_Menu, "File"); BOOL My_bool_AppendMenu2 = AppendMenuA(My_Main_Menu, MF_POPUP, (UINT_PTR)My_Help_Menu, L"Help");
Добавим выпадающий список в кнопку File:
BOOL My_bool_Append_to_File1 = AppendMenuA(My_File_Menu, MF_STRING, NULL, "Open"); BOOL My_bool_Append_to_File2 = AppendMenuA(My_File_Menu, MF_STRING, NULL, "Close");
SetMenu(hWnd, My_Main_Menu);
Как делать правильнее с точки зрения эффективности?