Solved

Context Menu

Posted on 2002-04-01
7
362 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
vb6 programatically bring window to front 8 72
to transfer string from C lanaguage to VBA 4 66
using web browser with BING 40 122
Send outlook email from VBS Script 2 30
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

809 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