Thread View: comp.os.os2.programmer
1 messages
1 total messages
Started by Barry King
Sun, 12 Apr 1992 10:18
Creating Menus Dynamically
Author: Barry King
Date: Sun, 12 Apr 1992 10:18
Date: Sun, 12 Apr 1992 10:18
32 lines
1694 bytes
1694 bytes
Could someone educate me as to the proper dynamic creation of pulldown menus? Here's what I've tried: 1) create a window using WinCreateWindow, WC_MENU class, parent and owner are the frame window, NULL ctl data, FID_EMNU as resource id. Send MM_INSERTITEM messages to add menu items, send WM_UPDAATEFRAME with WC_MENU as mp1. This causes a Trap D (?) of all things - haven't chased it down yet as to why it traps... 2) Create in-memory menu resource using _MT and _MTI structures, call WinCreateMenu, and send WM_UPDATEFRAME etc. This works but is _very_ tedious to create/manage the menu template. 3) create NULL in-memory menu resource and make successive MM_INSERTITEM calls to build the menu. This doesn't appear to work. It simply does nothing even though valid (apparently) window handles are created. I trap now and then after MM_INSERTITEM but even this doesn't happen reliably. I would think that this method should work. WinGetLastError returns no error in the creation of the menu (WinCreateMenu). Same with scenario 1. Any ideas? Barry King bking@ersys.edmonton.ab.ca Edmonton Remote Systems: Celebrating 10 years of service to Northern Alberta
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads