Why GetMenu(hwnd) always return 0

Why GetMenu(hwnd)always retrun 0 when called inside a usercontrol. Usercontrol is having a menu defined.
LVL 6
VBGuruAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Erick37Connect With a Mentor Commented:
See:

"Getting a handle on Menus with UserControls"

http://www.developer.com/experts/visualbasic/answer020.html
0
 
VBGuruAuthor Commented:
I came to know from the documentation of the function that, "If the window is a child window, the return value is undefined."

In that case how to obtain handle to the menu item of a child window?
0
 
Erick37Commented:
If GetMenu returns 0, then it means the window has no menu.

How are you adding the menu to a Usercontrol?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
VBGuruAuthor Commented:
Using the menu editor of the vb. I want to show a popup menu when the user clicks on the user control. It works, but when  wanted to use APIs it is returning 0 always.
0
 
VBGuruAuthor Commented:
I will check it out and update you.
0
 
VBGuruAuthor Commented:
Erick37, thanks for the link.
I will just wait to see someone can make it happen for sometimes. Else I will be happy to accept your answer.

Thanks.
0
All Courses

From novice to tech pro — start learning today.