COwnMenu – Make Office-style picture menus

By | 2002-06-01

To create an “Office-style menu” (or owner-draw menu) you must register that menu item with Windows as MF_OWNERDRAW and then process the WM_MEASUREITEM and WM_DRAWITEM messages sent to the menu’s parent window. The attached project file simplifies this process by encapsulating all menu drawing operations in a class called “COwnMenu” and hiding the details of working with Windows in a code module entitled “OMenu_h.” With this mini-system in place, all you have to do to get owner-drawn menus in your program is call SetSubclass on the menu’s owner form and RegisterMenu to set a menu item as owner drawn. The provided example project contains complete documentation.

Original Author: Kalani Thielen

Assumptions

Support for this code is not provided, please read the documentation in the project, as you’ll find the answers to most relevant questions there.
The files omenu_h.bas and cownmenu.cls are meant to be included in projects which intend to include owner-draw menus.

Attachments

FileUploadedSize
CODE_UPLOAD1809.zip9/3/2020 3:45:00 PM11616
Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.