Comadreja
December 2nd, 2004, 04:11 AM
Hi, I'm working with Visual C++ 6.0 and Directx 8.0 SDK
I'm making a simple GUI with the Control based in Popup Menus.
I make a Menu Resource, then load it, then launch it on Right Mouse Button Click. The problem is that i'm not getting the captions of the menu shown. Instead, the menu appears as if my captions where one blank space each. Still i get all the WM_COMMAND message well on each caption, and even popup submenus appear correctly (Opcion4). Any idea in what I might be doing wrong?
Thx in advance
/**************** RESOURCE.H ********************/
IDR_MENU MENU DISCARDABLE
BEGIN
MENUITEM "Opcion1", IDM_OCION1,
MENUITEM "Opcion2", IDM_OPCION2, CHECKED
MENUITEM "Opcion3", IDM_OPCION3
POPUP "Opcion4"
BEGIN
MENUITEM "Sub1", IDM_OPCION4_SUB1
MENUITEM "Sub2", IDM_OPCION4_SUB2
END
END
/************* MAINAPP.cpp *******************/
[...]
// INIT INSTANCE
m_hMenuPopup = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_MENU));
[...]
// MESSAGE LOOP
case WM_RBUTTONDOWN:
TrackPopupMenuEx(m_hMenuPopup, TPM_LEFTALIGN,
m_cursor.x, m_cursor.y, hWnd, NULL);
[...]
Note: If I append the Captions directly to the Menu, they appear correctly. But I'd like to make the Menus with the resource editor rather that build them line by line in my code
// THIS WORKS
m_hMenuPopup = CreatePopupMenu();
AppendMenu(m_hMenuPopup, MF_STRING, 1, "Opcion1");
AppendMenu(m_hMenuPopup, MF_STRING, 2, "Opcion2");
AppendMenu(m_hMenuPopup, MF_STRING, 3, "Opcion3");
I'm making a simple GUI with the Control based in Popup Menus.
I make a Menu Resource, then load it, then launch it on Right Mouse Button Click. The problem is that i'm not getting the captions of the menu shown. Instead, the menu appears as if my captions where one blank space each. Still i get all the WM_COMMAND message well on each caption, and even popup submenus appear correctly (Opcion4). Any idea in what I might be doing wrong?
Thx in advance
/**************** RESOURCE.H ********************/
IDR_MENU MENU DISCARDABLE
BEGIN
MENUITEM "Opcion1", IDM_OCION1,
MENUITEM "Opcion2", IDM_OPCION2, CHECKED
MENUITEM "Opcion3", IDM_OPCION3
POPUP "Opcion4"
BEGIN
MENUITEM "Sub1", IDM_OPCION4_SUB1
MENUITEM "Sub2", IDM_OPCION4_SUB2
END
END
/************* MAINAPP.cpp *******************/
[...]
// INIT INSTANCE
m_hMenuPopup = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_MENU));
[...]
// MESSAGE LOOP
case WM_RBUTTONDOWN:
TrackPopupMenuEx(m_hMenuPopup, TPM_LEFTALIGN,
m_cursor.x, m_cursor.y, hWnd, NULL);
[...]
Note: If I append the Captions directly to the Menu, they appear correctly. But I'd like to make the Menus with the resource editor rather that build them line by line in my code
// THIS WORKS
m_hMenuPopup = CreatePopupMenu();
AppendMenu(m_hMenuPopup, MF_STRING, 1, "Opcion1");
AppendMenu(m_hMenuPopup, MF_STRING, 2, "Opcion2");
AppendMenu(m_hMenuPopup, MF_STRING, 3, "Opcion3");