Results 1 to 2 of 2

Thread: How to replace a form's menu with one, created with WinAPI?

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    2

    Angry

    How to replace a form's menu with one, created with WinAPI?
    I create a menu with CreateMenu() func, popupulate it with items and then use SetMenu() to make it belonging to the form. But a VB form always sets its own menu back in some cases (when receives WM_ACTIVATE, or while resizing child windows).
    Maybe is there a some more optimal way to set a menu, then subclassing a form and searching every message causing the form to set its own menu back?

  2. #2

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    2

    Wink Solution

    I tried to put a menu on a form without its own menu.
    The solution is really easy.
    First I create any menu for the form in design time and then in runtime destroy it and assign to the form my menu:

    Call DestroyMenu(GetMenu(Form1.hWnd))
    Call SetMenu(Form1.hWnd, hMyMenu)

    It works.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width