Click here to Skip to main content
15,920,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalfloat number comparision Pin
act_x22-Apr-03 11:52
act_x22-Apr-03 11:52 
GeneralRe: float number comparision Pin
Maximilien22-Apr-03 12:03
Maximilien22-Apr-03 12:03 
GeneralRe: float number comparision Pin
Anonymous22-Apr-03 12:21
Anonymous22-Apr-03 12:21 
GeneralRe: float number comparision Pin
Phil Hamer22-Apr-03 16:09
Phil Hamer22-Apr-03 16:09 
GeneralRe: float number comparision Pin
Anonymous22-Apr-03 16:03
Anonymous22-Apr-03 16:03 
GeneralOnContextMenu Shows up without text Pin
allcodeluver22-Apr-03 11:14
allcodeluver22-Apr-03 11:14 
GeneralRe: OnContextMenu Shows up without text Pin
valikac22-Apr-03 11:56
valikac22-Apr-03 11:56 
GeneralRe: OnContextMenu Shows up without text Pin
allcodeluver23-Apr-03 4:26
allcodeluver23-Apr-03 4:26 
HMENU hPopMenu = NULL;
MMMENUITEMINFO lpCoolMenuItemInfo, lpCoolMenuItemInfo1;

if (!hPopMenu) hPopMenu = ::CreatePopupMenu();

//lpCoolMenuItemInfo.hSubMenu = NULL;

//lpCoolMenuItemInfo.HotImageListIndex = ::LoadIcon(NULL, MAKEINTRESOURCE(IDI_TEST));
//lpCoolMenuItemInfo.NormalImageIndex = ::LoadIcon(NULL, IDI_TEST);

strcpy(lpCoolMenuItemInfo.szText, "Test 1"); //"Context Menu";
lpCoolMenuItemInfo.uPos = 0;
lpCoolMenuItemInfo.wID = 1;

MENUITEMINFO MenuItemInfo;

MenuItemInfo.fMask = MIIM_TYPE | MIIM_STATE;
MenuItemInfo.fState = MFS_DEFAULT ;

if (lpCoolMenuItemInfo.fType == MFT_SEPARATOR)
{
MenuItemInfo.fType = lpCoolMenuItemInfo.fType;
return InsertMenuItem(hPopMenu,lpCoolMenuItemInfo.uPos,1,&MenuItemInfo);
}
else
{
MenuItemInfo.fMask |= MIIM_DATA | MIIM_ID;
MenuItemInfo.fType = MFT_OWNERDRAW;
MenuItemInfo.wID = lpCoolMenuItemInfo.wID;

MenuItemInfo.cbSize = sizeof(MenuItemInfo);
MMMENUITEMINFOPTR lpcmii = (MMMENUITEMINFOPTR) ::malloc(sizeof(lpCoolMenuItemInfo));
MenuItemInfo.dwItemData = (unsigned long) lpcmii;

::strcpy (lpcmii->szText, "Microsite" ); //lpCoolMenuItemInfo.szText) ;

//lpcmii->HotImageListIndex = lpCoolMenuItemInfo.HotImageListIndex;
//lpcmii->NormalImageIndex = lpCoolMenuItemInfo.NormalImageIndex;
lpcmii->uPos = lpCoolMenuItemInfo.uPos;
lpcmii->fType = MenuItemInfo.fType;
//lpcmii->cAccel = *(p+1);

::InsertMenuItem(hPopMenu,lpCoolMenuItemInfo.uPos,1,&MenuItemInfo);
}

strcpy(lpCoolMenuItemInfo1.szText, "Test Part 2"); //"Context Menu";
lpCoolMenuItemInfo1.uPos = 1;
lpCoolMenuItemInfo1.wID = 2;

MENUITEMINFO MenuItemInfo1;

MenuItemInfo1.fMask = MIIM_TYPE | MIIM_STATE;
MenuItemInfo1.fState = MFS_DEFAULT;

if (lpCoolMenuItemInfo1.fType == MFT_SEPARATOR)
{
MenuItemInfo1.fType = lpCoolMenuItemInfo1.fType;
return InsertMenuItem(hPopMenu,lpCoolMenuItemInfo1.uPos,1,&MenuItemInfo1);
}
else
{
MenuItemInfo1.fMask = MIIM_TYPE | MIIM_DATA;
MenuItemInfo1.fType = MFT_OWNERDRAW;
MenuItemInfo1.wID = lpCoolMenuItemInfo1.wID;

MenuItemInfo1.cbSize = sizeof(MenuItemInfo1);
MMMENUITEMINFOPTR lpcmii1 = (MMMENUITEMINFOPTR) ::malloc(sizeof(lpCoolMenuItemInfo1));
//MenuItemInfo1.dwItemData = (unsigned long) lpcmii1;
MenuItemInfo1.dwTypeData = lpcmii1->szText;
MenuItemInfo1.cch = 256;

::strcpy (lpcmii1->szText, "Test 2" ); //lpCoolMenuItemInfo.szText) ;

//lpcmii->HotImageListIndex = lpCoolMenuItemInfo.HotImageListIndex;
//lpcmii->NormalImageIndex = lpCoolMenuItemInfo.NormalImageIndex;
lpcmii1->uPos = lpCoolMenuItemInfo1.uPos;
lpcmii1->fType = MenuItemInfo1.fType;
//lpcmii->cAccel = *(p+1);

::InsertMenuItem(hPopMenu,lpCoolMenuItemInfo1.uPos,1,&MenuItemInfo1);
}


I have tried doing this using OWNERDRAW and somehow the menu appears but without any text.
Thanks
GeneralWinsock Problems Pin
Ken Mazaika22-Apr-03 10:51
Ken Mazaika22-Apr-03 10:51 
GeneralRe: Winsock Problems Pin
valikac22-Apr-03 11:59
valikac22-Apr-03 11:59 
GeneralRe: Winsock Problems Pin
Ken Mazaika22-Apr-03 13:28
Ken Mazaika22-Apr-03 13:28 
GeneralRe: Winsock Problems Pin
valikac22-Apr-03 14:29
valikac22-Apr-03 14:29 
GeneralRe: Winsock Problems Pin
basementman24-Apr-03 8:10
basementman24-Apr-03 8:10 
GeneralXP Style dialogs Pin
conetti22-Apr-03 10:39
conetti22-Apr-03 10:39 
GeneralRe: XP Style dialogs Pin
Neville Franks22-Apr-03 11:40
Neville Franks22-Apr-03 11:40 
GeneralDouble Click Pin
Anthony988722-Apr-03 10:16
Anthony988722-Apr-03 10:16 
GeneralRe: Double Click Pin
David Crow22-Apr-03 10:22
David Crow22-Apr-03 10:22 
GeneralCreateCompatibleBitmap Pin
georgiek5022-Apr-03 10:13
georgiek5022-Apr-03 10:13 
GeneralRe: CreateCompatibleBitmap Pin
Chris Losinger22-Apr-03 10:40
professionalChris Losinger22-Apr-03 10:40 
GeneralRe: CreateCompatibleBitmap Pin
georgiek5022-Apr-03 14:35
georgiek5022-Apr-03 14:35 
Generalvc++ 6 enviroment question Pin
tasoss22-Apr-03 9:55
tasoss22-Apr-03 9:55 
Question.net and windows forms and why use them? Pin
ns22-Apr-03 8:35
ns22-Apr-03 8:35 
AnswerRe: .net and windows forms and why use them? Pin
Maximilien22-Apr-03 9:10
Maximilien22-Apr-03 9:10 
GeneralRe: .net and windows forms and why use them? Pin
ns22-Apr-03 9:15
ns22-Apr-03 9:15 
AnswerRe: .net and windows forms and why use them? Pin
Ravi Bhavnani22-Apr-03 12:46
professionalRavi Bhavnani22-Apr-03 12:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.