Solved

Why GetMenu(hwnd) always return 0

Posted on 2000-04-06
6
678 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
Independent Software Vendors: 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 50 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How does CurrentUser work? 10 45
using web browser with BING 40 152
Passing a Text Box name to a Sub 6 104
Send outlook email from VBS Script 2 67
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

752 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