Solved

Context Menu

Posted on 2002-04-01
7
365 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
[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
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 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…

710 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