Old newbie
Old newbie

Reputation: 831

How can I include a DropDownList in a menu bar using the Windows API?

Assuming programming in C++ for the Win32 API, I would know if it is possible to include a DropDownList (COMBOBOX window with CBS_DROPDOWNLIST style) in a menu bar.

Any light in that matter or where start to learn on the topic would be appreciated.

Upvotes: 1

Views: 1698

Answers (2)

Cody Gray
Cody Gray

Reputation: 244971

Owner drawing is your only option for customizing the built-in API menus. Not only is that a giant pain in the rear, it still won't produce the effect that you want. You'd have to draw the combo box by hand and write code to respond to all the mouse events, instead of just dropping in a standard combo box control.

My suggestion is to use either a toolbar or a rebar control that simulates a menu bar, rather than the standard menu bar. This is what Windows (and Internet) Explorer does to draw its menu bar, and it provides you with a lot more flexibility in what controls can be included.

Upvotes: 2

Boofhead
Boofhead

Reputation: 507

If you're prepared to handle all paint messages you can ultimately do anything to the client area of your application. How much work and code are you prepared to put in?

Upvotes: 0

Related Questions