Solved

Why GetMenu(hwnd) always return 0

Posted on 2000-04-06
6
662 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
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Macro: print each sheet to pdf using ExportAsFixedFormat 11 54
Determine Range to Select 5 53
clicking a shape in a frame array vb6 3 47
Advice in Xamarin 21 97
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

820 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