我刚开始使用 C++,我在网上搜索了创建单选菜单项的方法,但我很困惑。
最好的例子将有助于澄清事情。
所以,我希望能够像这样创建一个简单的单选菜单项:http: //i.imgur.com/7UrUtjS.png
但是,我坚持如何创建单选菜单项。到目前为止,我有这个:
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
HRESULT hr;
POINTER_INFO pointerInfo = {};
HMENU hmenu = GetMenu(hWnd);
HMENU hChangeMenu = CreateMenu();
HMENU hGesture = CreateMenu();
HMENU hPointer = CreateMenu();
UNREFERENCED_PARAMETER(hr);
if(changeAPI)
{
AppendMenu(hmenu, MF_POPUP, (UINT_PTR)hChangeMenu, L"API");
**// I want this to be a radio menu item, all I know is the MF_POPUP**
AppendMenu(hChangeMenu, MF_POPUP, (UINT_PTR)hGesture, L"Gesture");
AppendMenu(hChangeMenu, MF_POPUP, (UINT_PTR)hPointer, L"Pointer");
AppendMenu(hChangeMenu, MF_POPUP, (UINT_PTR)hTouch, L"Touch");
changeAPI = false;
}
//....other stuff....