Solved

Context Menu

Posted on 2002-04-01
7
359 Views
Last Modified: 2010-05-02
Hi there
I am doing the application in Visual Basic 6.0 and I want to add context menu which can be be seen in
'Windows Explorer' on rigt clicking inside it.
I refered the MSDN Library for the same task but I didn't understand the contents If you know How to make the coding for the same Please let me know the full coding . The proper commentation will help me lot since I am fresher for VB6.0
Thank you.
0
Comment
Question by:amkarambelkar
7 Comments
 
LVL 22

Expert Comment

by:rspahitz
ID: 6910506
I'm assuming you want a "popup" menu.  Try this:

Private Sub SomeControl_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  If Button = vbRightButton Then
    PopupMenu mnuSomeMenu
  End If
End Sub

"SomeControl" is the name of the control which will receive the context menu.
"mnuSomeMenu" is a predefined menu created using the standard menu editor.  This will also include a set of sub-menu entries which will appear in the popup window.
0
 
LVL 1

Author Comment

by:amkarambelkar
ID: 6910544
I think you are getting confused with my Question
The context menu and Popup menu are two different things
Popup menu runs within application
Context menu is the menu which is appeared when  we right click on any file in  'windows explorer'  like Copy, paste, Delete, create shortcut etc.
0
 
LVL 6

Accepted Solution

by:
MELeBlanc earned 100 total points
ID: 6910571
Take a look at this example:

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=12137&lngWId=1

I'm thinking that this is what you are asking for.

-M
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 7

Expert Comment

by:Z_Beeblebrox
ID: 6910584
If I understand you correctly, you want to add your application to the Windows explorer context menu for certain types of files. If this is the case, I don't know how to do it off-hand, but all you need to do is add some entries to the registry, there is no code involved. I am sure someone here knows what entries are required.

Zaphod.
0
 
LVL 1

Author Comment

by:amkarambelkar
ID: 6912407
hi Z_Beeblebrox
You have said rightly but whatyou are suggesting is only valid for Win9x In winNT or win2k we have to creat the Dll
and by registering it and also adding some values in registry we can have the menu in context menu
0
 
LVL 1

Author Comment

by:amkarambelkar
ID: 6913341
Hi MELeBlanc
I have followed your link and got the code file
I am very happy to say that it has worked very good
Thanks a lot.
0
 
LVL 6

Expert Comment

by:MELeBlanc
ID: 6913820
You're most welcome.
Glad I could help.

-M
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

759 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

23 Experts available now in Live!

Get 1:1 Help Now