Top-Level Menu Items in Owner-Draw Menus

Last reviewed: November 2, 1995
Article ID: Q69969
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) versions 3.0 and 3.1
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows NT versions 3.5 and 3.51
        - Microsoft Windows 95 version 4.0
    

SUMMARY

Microsoft Windows version 3.0 allows an application to specify owner-draw menus. This provides the application with complete control over the appearance of items in the menu. However, Windows 3.0 only supports owner- draw items in a pop-up menu. Top-level menu items with the MF_OWNERDRAW style do not work properly.

In Windows 3.1, Windows NT, and Windows 95, top-level menu items with the MF_OWNERDRAW style work properly.

MORE INFORMATION

An application may append an item with the MF_OWNERDRAW style to a top- level menu. At this point, the parent application should receive a WM_MEASUREITEM message and a WM_DRAWITEM message.

However, a WM_MEASUREITEM message is never sent to the parent window for the menu item. In addition, the WM_DRAWITEM message is sent only when the selection state of the item changes (the action field in the DRAWITEMSTRUCT is equal to ODA_SELECTED). The WM_DRAWITEM message is not sent with the action field in the DRAWITEMSTRUCT equal to ODA_DRAWENTIRE.


Additional reference words: 3.00 3.10 3.50 4.00
KBCategory: kbui
KBSubcategory: UsrMen


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 2, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.