BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

problem with InsertMenuItem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (WinAPI)
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Sun Feb 12, 2006 2:03 pm    Post subject: problem with InsertMenuItem Reply with quote



I am creating a system tray icon that shows up a bunch of menus on
right click.
I try to populate a pop-up menu with the following function.

void CPimonTray::populatePopupMenu(HMENU hPopMenu)
{
MENUITEMINFO menuItem;
menuItem.cbSize = sizeof(MENUITEMINFO);
menuItem.fMask =
IIM_FTYPE|MIIM_STRING|MIIM_TYPE|MIIM_STATE|MIIM_ID ;
menuItem.fType = MFT_STRING;
menuItem.fState = MFS_ENABLED;
menuItem.wID = ID_LAUNCH_PI;
std::string menuName = "Sign In";
menuItem.dwTypeData = menuName.c_str();
menuItem.cch = menuName.length() + 1;
bool res = InsertMenuItem(hPopMenu,0xFFFFFFFF,true,&menuItem);
DWORD errorcode = GetLastError();



}


When i do this I always get an error code:87 [ Invalid parameters ]

Can someone please help me out of this?


Thanks in advance!
-manojna
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (WinAPI) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.