Home Download Buy Blog Forum Support

Add icon in Windows Context Menu

Add icon in Windows Context Menu

Postby Francisc on Thu Sep 22, 2011 8:02 pm

Hello,

I think it would be nice and easier to see if you added the application icon to the left of the context menu label, like Notepad++ does for example.
Attached screenshot.
Attachments
idea.jpg
idea.jpg (11.04 KiB) Viewed 8307 times
Francisc
 
Posts: 55
Joined: Thu Sep 22, 2011 7:14 pm

Re: Add icon in Windows Context Menu

Postby atomi on Wed Sep 28, 2011 4:30 am

You can do this easily by adding an Icon entry to the registry.

Code: Select all
reg add "HKLM\Software\Classes\Applications\sublime_text.exe\shell" /t REG_EXPAND_SZ /v "Icon" /d "c:\path\to\sublime_text.exe,0"


I use the portable version so I'm not sure that is the exact location the installed version of sublime text is registered at.
Remember, registry editing is risky blah blah blah
atomi
 
Posts: 342
Joined: Thu Jan 20, 2011 5:06 pm
Location: Los Angeles CA US

Re: Add icon in Windows Context Menu

Postby Francisc on Wed Sep 28, 2011 7:01 pm

Clever, thanks atomi.
Francisc
 
Posts: 55
Joined: Thu Sep 22, 2011 7:14 pm

Re: Add icon in Windows Context Menu

Postby Francisc on Wed Sep 28, 2011 8:27 pm

The Icon doesn't show.

The key is here:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Applications\sublime_text.exe\shell

And the path to sublime_text.exe is correct.

Any idea why that didn't work?
Francisc
 
Posts: 55
Joined: Thu Sep 22, 2011 7:14 pm

Re: Add icon in Windows Context Menu

Postby atomi on Thu Sep 29, 2011 3:03 am

Francisc wrote:The Icon doesn't show.

The key is here:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Applications\sublime_text.exe\shell

And the path to sublime_text.exe is correct.

Any idea why that didn't work?


I really don't have any idea how the installed version of Sublime sets up it's file associations.
Instead of Icon it might be DefaultIcon.. you might have to google this sorry.
I don't add icons for sublime verb, I set sublime to replace notepad.exe - wish I could help more.

Edit: this might get you going in the right direction
http://www.winhelponline.com/blog/chang ... and-vista/
What I would do is search for the string "Open with Sublime Text 2" in the registry and add a DefaultIcon entry under that registry key (should be in HKLM).
atomi
 
Posts: 342
Joined: Thu Jan 20, 2011 5:06 pm
Location: Los Angeles CA US

Re: Add icon in Windows Context Menu

Postby Francisc on Thu Sep 29, 2011 9:18 am

Hi Atomi, this is what I did last night:

reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "path-to-install-dir\sublime_text.exe,0"

I compared what other files that had icons did and took it from there.

Thanks.
Francisc
 
Posts: 55
Joined: Thu Sep 22, 2011 7:14 pm

Re: Add icon in Windows Context Menu

Postby atomi on Thu Sep 29, 2011 2:00 pm

Francisc wrote:Hi Atomi, this is what I did last night:

reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "path-to-install-dir\sublime_text.exe,0"

I compared what other files that had icons did and took it from there.

Thanks.


Nice. Thanks for posting back here. :)
It's better to put it in HKLM as HKCR is just a copy of HKLM.
The key should be "HKLM/Software/Classes/*/shell/Open with Sublime Text 2"
But glad you got it working. 8-)
atomi
 
Posts: 342
Joined: Thu Jan 20, 2011 5:06 pm
Location: Los Angeles CA US

Re: Add icon in Windows Context Menu

Postby Francisc on Thu Sep 29, 2011 5:23 pm

OK, I'll make the changes.
The reason I added it there was that "Open with Sublime Text 2" was there in the first place and no where to be seen in the Local_Machine.
Francisc
 
Posts: 55
Joined: Thu Sep 22, 2011 7:14 pm


Return to Ideas and Feature Requests

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests