我用 MinGW 编译器开发了一个 c++ 应用程序。我更改了 CreateWindow() 函数的默认字体,如下所示:
HFONT font;
font = CreateFont(15, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, 0, 0, 0, 0, "Tahoma");
HWND btn;
btn = CreateWindowEx(BS_PUSHBUTTON, "BUTTON", "Title",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
0, 0, 0, 0,
hwnd,
(HMENU)ID_BUTTON,
GetModuleHandle(NULL),
0);
SendMessage(btn, WM_SETFONT, (WPARAM) font, TRUE);
但我创建了菜单:
HMENU hMenu, hSubMenu;
hMenu = CreateMenu();
hSubMenu = CreatePopupMenu();
AppendMenuW(hSubMenu, MF_STRING, ID_FILE_OPEN_BTN, "Open" );
AppendMenuW(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "File" );
但我不知道如何更改 AppendMenuW() 中的字体,有人可以帮我吗?