[comp.os.os2.programmer] Menu bars on dialog boxes

jeff@retina.mitre.org (Jeff Graber) (12/18/90)

Could anyone out there help us with this problem?  We need to attach menu bars to dialog boxes.  Do we need to create a window with the menu bar and put a dialog box inside it?  Thanks in advance.


Jeff Graber

gordon@hpbblb.bbn.hp.com (Gordon MacKinney) (12/20/90)

There are three steps to putting a menu in your dialogue box:

1. You need to change your resource definition (.rc file) of the
dialogue box to include a menu. That should look something like
this:

DIALOG "Title" ID_DIALOG 0, 0, 100, 100, WC_FRAME, WS_VISIBILE |
FCF_MENU | ... and whatever else you have.

2.  Next you need to define your menu in the resource as well
using the key word MENU (you've probably already done this).

3. Finally, in the WM_INITDLG of your dialogue procedure, call
the WinLoadMenu command with the ID of your menu.

I don't know if this is correct programming style, but it worked
for me. 

Kristz (these stupid German keyboards...)