Solved

Why GetMenu(hwnd) always return 0

Posted on 2000-04-06
6
646 Views
Last Modified: 2012-05-04
Why GetMenu(hwnd)always retrun 0 when called inside a usercontrol. Usercontrol is having a menu defined.
0
Comment
Question by:VBGuru
  • 4
  • 2
6 Comments
 
LVL 6

Author Comment

by:VBGuru
Comment Utility
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
 
LVL 32

Expert Comment

by:Erick37
Comment Utility
If GetMenu returns 0, then it means the window has no menu.

How are you adding the menu to a Usercontrol?
0
 
LVL 6

Author Comment

by:VBGuru
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 32

Accepted Solution

by:
Erick37 earned 50 total points
Comment Utility
See:

"Getting a handle on Menus with UserControls"

http://www.developer.com/experts/visualbasic/answer020.html
0
 
LVL 6

Author Comment

by:VBGuru
Comment Utility
I will check it out and update you.
0
 
LVL 6

Author Comment

by:VBGuru
Comment Utility
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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now