|
-
Mar 31st, 2001, 01:08 PM
#1
Thread Starter
New Member
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?
-
Apr 1st, 2001, 09:54 AM
#2
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|