Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > Components & Controls > Menus & Toolbars

Menus & Toolbars Discussion of menu and toolbar components

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-19-2009, 4:12 AM
VB.NET Forum Fanatic
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Mar 2009
Age: 19
Posts: 131
Reputation: 17
Johnson is on a distinguished programming path ahead
Default add to windows context menu?

What i would like to do is have my application add a entry to the main windows context menu(for when i right click a picture) which will be called host image.

My question is what do i need to read up on to add a context menu entry

When the entry is clicked i want it to get the file it's clicked on location

Does this make some sort of sense to you?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-19-2009, 4:31 AM
jmcilhinney's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Aug 2004
Location: Sydney, Australia
Age: 40
Posts: 6,098
Reputation: 540
jmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalist
Default

[ame=http://www.google.com.au/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=ErY&q=shell+extension+.net&btnG=S earch&meta=]shell extension .net - Google Search[/ame]

It looks like it's easier to find C# examples so you might need to convert some code. I recommend Instant VB.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-19-2009, 7:26 AM
VB.NET Forum Fanatic
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Mar 2009
Age: 19
Posts: 131
Reputation: 17
Johnson is on a distinguished programming path ahead
Default

Right, i found a project to convert to vb.net.

it adds a entry and lets you select what exe to run when click.

My question is, I need to capture the file it was right clicked on, so when my application runs it knows what file to work with.

is this difficult?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-19-2009, 8:40 AM
JohnH's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2005
Location: Norway
Age: 37
Posts: 10,299
Reputation: 1314
JohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond repute
Default

Most likely this info will be available in command line arguments. I don't know if registry path has to be modified in your case, often a %1 is appended.
In applications Startup event you can find this in e.CommandLine. It is also found in My.Application.CommandLineArgs or Environment.GetCommandLineArgs.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-19-2009, 4:34 PM
VB.NET Forum Fanatic
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Mar 2009
Age: 19
Posts: 131
Reputation: 17
Johnson is on a distinguished programming path ahead
Default

This is very confusing
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-20-2009, 6:46 AM
jmcilhinney's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Aug 2004
Location: Sydney, Australia
Age: 40
Posts: 6,098
Reputation: 540
jmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalist
Default

If your Reg entry says "MyApp.exe %1" then, when the user clicks MyFile.txt then Windows executes the commandline "MyApp.exe MyFile.txt" and, in your app, Environment.GetCommandLineArgs returns the array {"MyApp.exe", "MyFile.txt"}. Easy.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 4:53 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.