Badoniya
Badoniya

Reputation: 145

How can i add a Right Click option/options on any specific directory of window

I am creating a directory synch application in java programming application. Now i want to add share option when user right click with in a specific directory, and want to open an dynamic url on clicking that new option. Can anyone help me to find any good solution. Can anyone provide me Registry Script For this task.

Upvotes: 1

Views: 134

Answers (1)

DanielTuzes
DanielTuzes

Reputation: 2754

An msdn resource on Extending Shortcut Menus will be good for you.

Anyway, I'd like to introduce my own "minimal" example. This opens a gnuplot's wgnuplot terminal at the right-clicked directory after choosing "Open gnuplot here" shortcut.

You can add keys into HKEY_CLASSES_ROOT\Directory\shell. I added HKEY_CLASSES_ROOT\Directory\shell\gnuplot with string (name: (Default)) Open gnuplot here, provided an icon string with the program's icon path, a LegacyEnable empty string and a command key that windows have to execute when clicking. You can reach the right clicked directory name with %V (You can find out more special variables on this Q&A thread at SU). Here's the code that creates the structure:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\gnuplot]
@="Open gnuplot here"
"Icon"="\"C:\\Windows\\icons\\wgnuplot.ico\""
"LegacyEnable"=""

[HKEY_CLASSES_ROOT\Directory\shell\gnuplot\command]
@="\"C:\\Users\\Cron\\Documents\\egyetem\\gnuplot\\bin\\pgnuplot.exe\" -e \"cd '%V'\" -persist"

Upvotes: 1

Related Questions