Solved

Menu Icons

Posted on 1998-06-12
7
236 Views
Last Modified: 2010-04-10
Can anyone tell me how to have icons for menu items in Visual C++? (Like the ones
the Visual C++ menus use.)
0
Comment
Question by:onka34
  • 3
  • 3
7 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 100 total points
Comment Utility
Use ModifyMenu with uFlags MF_BITMAP
0
 
LVL 1

Expert Comment

by:V245
Comment Utility
Sure, MF_BITMAP is work partially. I mean that  your icon will have transparent color. In Visual C++ menu they use another way... ;-)
0
 
LVL 8

Expert Comment

by:MikeP090797
Comment Utility
If you want it to be transparent , just open that bitmap in the resource editor, and set it's background color to gray, like the color of the menu itself. 99% of users don't change the color of the menu
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:onka34
Comment Utility
Can you tell me how they do it in Visual C++?
0
 
LVL 1

Expert Comment

by:V245
Comment Utility
Yes, I can but your question is locked!
0
 
LVL 8

Expert Comment

by:MikeP090797
Comment Utility
You can create an owner drawn menu, override the WM_DRAWITEM message, and draw it yourself, using drawing methods. This is much harder, and I'm not sure that it worth the efforts
0
 
LVL 1

Expert Comment

by:V245
Comment Utility
Be sure Mike, because if  MF_BITMAP is used the menu select bar will cover your icon (transparent mode). It isn't similar to VC++ menu. In addition, if MF_BITMAP is used it will be possible to show only two bitmaps for CHECKED and UNCHECKED item states. But if MF_OWNERDRAW is used you will get full control and will can to show 'plain' icon when item isn't selected or 3D-look icon ('pressed' or 'unpressed') when selected bar passes through item. In such case it is possible to show different icons for enabled or disabled item and so on. I guess they made VC++ menu in the same way.
Good luck! :-)
Vladimir
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now