last day (15 days later) » 

10:51 AM
3
A: C++ Win32 notification menu changes

Michael ChourdakisYou are looking for SetMenuItemInfo() and the MENUITEMINFO structure.

 
Trying to not be rude, but that's exactly what every forum response says. And your answer is BOOL SetMenuItemInfoW( HMENU hmenu, UINT item, BOOL fByPositon, LPCMENUITEMINFOW lpmii); If I wanted to know how to use MENUITEMINFO I would have asked that question.
 
@Bradmage You did not state in your question that you didn't want to use SetMenuItemInfo. And actually, even if you would have stated that, you should have a good reason. If the function is too complex for you, get a good C++/Windows book and start learning. it's not what you want to use, it's what it's actually available in Windows according to their documentation.
 
I'm confused by your comment, I didn't say I didn't want to use anything?! My point was I know how to reference those pages, just not what to pass to the functions, why I'm here asking the question...
I was hoping giving my setup, someone could show me WHAT I needed to pass to, for example, SetMenuItemInfo.
 
@Bradmage isn't it clear from the documentation?
 
Being an engineer with expertise in C++, Win32 doesn't mean you have to make me sound stupid. Any other answer would give an anxample, stackoverflow.com/questions/9651038/… for example.
 
10:51 AM
@Bradmage I'm not making you sound stupid. If you want to elaborate on MENUITEMINFO and Win32 API in general, stack overflow is not the place to be. I 'd be happy to help you off-site.
Where do you need help?
 
Thanks for your willing to elaborate, but I thought the question was a pretty simple one.. All I was after was a few lines to add an icon next to the text of a context menu
There are so many questions out there with the same thing, and all the answers come back in MFC.
 
Since the MENUITEMINFO might be complex, did you try SetMenuItemBitmaps()?
SetMenuItemBitmaps(yourMenu,id,MF_BYCOMMAND,bmp1,bmp2);
 
I've used MENUITEMINFO (simply) when I've created menus by code. But I'm learning to use a resource menu, and accessing it is weird. Also I mentioned SetMenuItemBitmaps in my question.
Something like.. Menu = GetMenu(hwnd); SetMenuItemBitmaps(Menu, IDM_MenuItem, MF_BYCOMMAND, LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_IMAGE)), LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_IMAGE)));
 
To get a resource menu you can use LoadMenu()
and then you have a HMENU
 
I can load resources, I use them in dialogs and "favicons" for a lack of a bette term.
I know, that is in my question: hmenu = LoadMenu(NULL, MAKEINTRESOURCE(IDR_MENU1));
I'm not even sure if you know what my question is. You haven't actually addressed anything I've asked..
 
11:08 AM
What's the issue while using LoadMenu to get a HMENU that you can pass it later to SetMenuItemBitmaps?
 
Exactly what my question asked, WTF do I pass into SetMenuItemBitmaps? What I have isn't working, I already sent you an example of this.
 
SetMenuItemBitmaps(yourMenu,id,MF_BYCOMMAND,bmp1,bmp2);
is the id/menu/bitmaps valid?
 

last day (15 days later) »