February 28th, 2013

Is there a way to specify an icon to appear next to a menu item via the resource template?

The MENU­ITEM­INFO structure lets you specify a bitmap to appear next to the menu item. Is there a way to do this from a menu resource template?

No.

If you look at the format of menu templates, you’ll see that there is nowhere to specify a bitmap.

Which kind of makes sense, because it is the responsibility of the application to destroy the bitmap referenced by the hbmpItem member when the menu is destroyed, but if you created the menu from a template, you don’t know what that handle is, so you can’t destroy it either!

Topics
Code

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.