954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

HMENU Hotkeys & Icons

Hi all,

I have two problems, the first being the most important:

1.
I have a Win32 (Non-MFC) app with a window and a win32 menu on it (HMENU), and I've been searching all day for a way to display shortcuts (like "Ctrl+C") on the menu items. I know there's the RegisterHotkey function but that doesn't make the shortcut to display on the menu item. There MUST be a way to do this without owner drawing the menu! Does anybody know how to achieve this?

2.
How can I display 32-bit icons in the menu items? I know how to use SetMenuItemInfo, but the problem comes when loading the bitmap. LoadBitmap works only with 24-bit bitmaps or less. LoadImage doesn't work either. I can use LoadIcon, but it is not compatible with HBITMAP, required by the MENUITEMINFO structure. Maybe a clue on how to transform a 32-bit PNG resource to an HBITMAP?

Thanks in advance

sixstorm1
Newbie Poster
5 posts since Sep 2009
Reputation Points: 23
Solved Threads: 0
 

Literally, all you have to do is this...

Give the name to AppendMenu like this:

"Open\tCtrl-O"


This will have the effect you're looking for. Very simple, but unfortunately, poorly documented. :)

GC

bheron
Newbie Poster
1 post since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: