Issue
I just started C++ and I searched online for ways to create a radio menu item, but I'm quite confused.
Preferrable an example would help clear things up.
So, I want to be able to create a simple radio menu item like this: http://i.imgur.com/7UrUtjS.png
but, I'm stuck on how to create a radio menu item. So far I have this:
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....
Solution
The "radio" logical behavior of the menu items must be provided by your code. After you have created the menu items use ModifyMenu to add/remove a check mark or bitmap to the appropriate items.
Answered By - ScottMcP-MVP Answer Checked By - Willingham (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.