Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Why GetMenu(hwnd) always return 0

Posted on 2000-04-06
6
Medium Priority
?
697 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 6

Author Comment

by:VBGuru
ID: 2689452
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
ID: 2689568
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
ID: 2689738
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 32

Accepted Solution

by:
Erick37 earned 200 total points
ID: 2689903
See:

"Getting a handle on Menus with UserControls"

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

Author Comment

by:VBGuru
ID: 2689923
I will check it out and update you.
0
 
LVL 6

Author Comment

by:VBGuru
ID: 2689943
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

705 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