Click here to Skip to main content
Email Password   helpLost your password?

Since the Idiot's Guide series has become quite large, here is an index of all the articles that gives a quick blurb about each one, so you can quickly find the articles that interest you.

Some other dedicated folks are writing translations of the Guide. Here are the published translations:


Part I - A step-by-step tutorial on writing shell extensions

 [Part 1 screen shot - 9K]

Part I is a simple overview of shell extensions, and discusses how to debug them. The sample extension illustrates adding items to the context menu for text files.

Part II - A tutorial on writing a shell extension that operates on multiple files at once

 [Part 2 screen shot - 5K]

Part II demonstrates how to write a context menu extension that operates on all of the selected files at once. The sample project is a utility that adds registration and unregistration commands to the context menus for DLLs.

Part III - A tutorial on writing a shell extension that shows pop-up info for files

 [Part 3 screen shot - 6K]

Part III demonstrates the QueryInfo extension that customizes the infotip for text files. It also explains how to use MFC in a shell extension.

Part IV - A tutorial on writing a shell extension that provides custom drag and drop functionality

 [Part 4 screen shot - 12K]

Part IV shows how to add items to the menu displayed when the user drags and drops with the right mouse button in Explorer. The sample project is a utility that makes hard links for files. (Note: the extension is functional only on Windows 2000, but you can still compile and run the extension on previous versions of Windows. See the article for instructions.)

Part V - A tutorial on writing a shell extension that adds pages to the properties dialog of files

 [Part 5 screen shot - 23K]

Part V demonstrates how to add new pages to Explorer's Properties dialog. The sample project adds a page on which you can edit the created, modified, and last accessed times of files.

Part VI - A tutorial on writing a shell extension that can be used on the Send To menu

 [Part 6 screen shot - 9K]

Part VI discusses a drop handler extension that gets added to the SendTo menu. The sample project is a clone of the Send To Any Folder power toy.

Part VII - A tutorial on using owner-drawn menus in a context menu shell extensions, and on making a context menu extension that responds to a right-click in a directory background

 [Part 7 screen shot - 6K]

Part VII tackles two topics suggested by readers: owner-drawn menu items and the context menu for the background of directory windows. The sample project contains two extensions: a bitmap viewer (pictured above) that puts a thumbnail of BMP files in the context menu, and a simple extension that adds items to the context menu of directory backgrounds.

Part VIII - A tutorial on adding columns to Explorer's details view via a column handler shell extension

 [Part 8 screen shot - 6K]

Part VIII demonstrates how to add columns to the details view of Explorer on Windows 2000. The sample project adds a few columns that show ID3v1 tag data in MP3 files.. (This extension works only on Windows 2000.)

Part IX - A tutorial on writing an extension to customize the icons displayed for a file type.

 [Part 9 screen shot - 24K]

Part IX shows how to customize file icons on a file-by-file basis. The demo project is an extension that shows 4 different icons for text files, depending on the size of the file.

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralCan we Implement "Show in Groups"
gurjant singh
21:02 7 Oct '09  
Can we implement "show in groups" using the shell namespace extension?
GeneralNew Image File Type Showing Thumbnails?
silentbutdeadly
19:40 6 Apr '09  
I've written a new kind of image file format. It's not a wrapper around BMP or JPG or any other popular image type. It's an entirely new file structure, but of course Windows doesn't show a thumbnail because it doesn't understand my layout. Now, I'm new to C++, I'm a C# guy. I don't know how to do pictures in a standard C++ app, nevertheless a shell extension, but I really want to be able to show a thumbnail image for my files. Can somebody walk me slowly through what I need to do for both creating an image in C++ from the file as well as how to make it load the image in explorer with a shell extension?
QuestionCan we split the browser
Javed Akhtar Ansari
20:06 21 Sep '08  
Hi I want to show some meta data of a file selected in the list view in a separate viewing area similar to list view or tree view.
In other words I want to split the browser so the it has one more viewing area other than already existing list view and tree view. Can anybody comment how is this possible?

Thanks,

Javed A Ansari
Software Developer
Hyderabad, India

AnswerRe: Can we split the browser
Timo Kunze
7:52 18 Oct '08  
This can be done with an explorer bar shell extension.

TiKu

--
www.TimoSoft-Software.de

QuestionRe: Can we split the browser
Javed Akhtar Ansari
21:19 20 Oct '08  
Thanks,Can you point me to some existing example. how to do this?

Javed A Ansari
Software Developer
Hyderabad, India

GeneralShell exec to run sort.exe
Member 455770
23:05 20 Jan '08  
How can i make a call to execute sort.exe such as:-

"sort.exe input.txt > output.txt"

SO far ShellExec is very restrictive - only accepts certain type of file operations.
GeneralIssue with InsertMenu
Jeffrey Walton
17:30 12 Jul '07  
Hi Michael,

Sorry to beat a dead horse. I'm down to a base case which demonstrates the problem: Create 2 different menu Dlls which do nothing other than implements the minimum:

* IShellExtInit::Initialize(LPCITEMIDLIST, LPDATAOBJECT, HKEY);
* IContextMenu::InvokeCommand(LPCMINVOKECOMMANDINFO);
* IContextMenu::GetCommandString(UINT, UINT, UINT*, LPSTR, UINT);
* IContextMenu::QueryContextMenu(HMENU, UINT, UINT, UINT, UINT);

InsertMenu always return TRUE, and GetLastError() always returns ERROR_SUCCESS.

Only one of the Dlls will be present in the Context Menu. However, both will respond to GetCommandString() (per SysInternal's DbgView).

The problem exists on Windows XP and Windows Vista. However, it is not present on Windows 2000. I did not test on Windows 2003 Server since I know I can duplicate on XP and Vista.

At this point, I have not been able to debug further - WinDbg locks my machine when I attach to Explorer.exe. Hindsight being 20/20, this makes sense...

Jeff

Generalwindows file dialog?
madfiddlerchris
3:18 6 Jul '07  
Hi - first off thanks for the series of articles they have been very useful.

However, I have a context menu item showing a dialog from which I want to access the Windows File Open common dialog.

I can;t work out how to do this or if indeed it is possible. I started looking at CfileDialog but cannot include afxwin.h into the project becasue Windows.h is already included (via atlbase.h)

any ideas how I could achieve this?

thasnk in advance.
GeneralRe: windows file dialog?
Michael Dunn
7:37 6 Jul '07  
When you use the AppWizard to start an ATL project, there's a checkbox for adding MFC support. If you make a dummy ATL+MFC project, you can see what changes are necessary to add MFC support, then make those changes in your current project. You can call also just GetOpenFileName() directly.

--Mike--
Visual C++ MVP Cool
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

GeneralShell extension for "system Task" of "My computer" items
pada44
14:45 12 Apr '07  

Hello,
I was wondering if anybody knows how to replace the action performed by the items
in the "System Task" of the "My Computer". More specifically I would like to replace the windows Eject with my own eject for the CD/DVD.
I know how to this for the right click Eject, but not from the system task.

Thanks for your help

pada
QuestionVista Shell - How to set "Tags:" and "Rating:" programatically for Images
Quint King
11:27 22 Nov '06  
In the new Vista RTM release, when you browse to a folder with JPEGs at the bottom of the shell frame there's a thumbnail, image name, image type, date taken, dimensions, and size fields that are non-editable.

There are also two editable fields - “Tags:” and “Rating:”. I'm interested in the get/set of these fields from C++. Poking around the new Vista SDK I'm seeing IPropertyStoreCache - is this the animal?

Here's a link to the MSDN section of possible interest:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_new_vista/buildingpropertyhandlers/properties.asp[^]
AnswerRe: Vista Shell - How to set "Tags:" and "Rating:" programatically for Images
Michael Dunn
17:11 26 Dec '06  
I've only looked at the property system briefly, but check out Ben Karas's[^] blog[^] - he talks about the system and provides some sample code in C++.

--Mike--
Visual C++ MVP Cool
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

Ford, what's this fish doing in my ear?

QuestionAnd what's about folders?:)
Kir0s
5:01 20 Nov '06  
I've found one question about using SE on folders but is has no answers:(

Kirill
GeneralAsk about Shell: change icon & handling events
namphvn
14:33 15 Sep '06  
1. I want to change icon for drives which meet a specific condition (such as which contains a specified file).
Until now I know there are 2 ways:

a. Operate with "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons" key in Registry.
(refer to http://msdn.microsoft.com/library/d...ending/icon.asp)
But: After calling SHUpdateImage function, the icon was not refreshed automatically. I had to press F5 button to refresh manually.
Could we overcome this disadvantage?

b. Operate with "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" key in Registry.
(refer to http://web6.codeproject.com/win32/n....asp?print=true)
But: This method updates icon of all drives which have the same type (hard disk, removable disk...) and it can not change icon of a specific drive.

2. When I insert a USB, floppy disk, CD…I want to change it’s icon. If I use Autorun.inf file to change icon, only WinXP support this feature. Could we solve this problem by Shell Extension?

Thanks in advance
QuestionF2 Handler
Mor FTP
16:55 16 Aug '06  
Is there a way to customize F2 renaming or menu rename function by shell extensions. I actually want to hide extension of files except renaming. I also try to select only filename but not the extension while renaming.

GeneralEnglish PDF
pjd1001
21:00 25 Apr '06  
I note there's a complete PDF in Italian - is there a complete PDF English
GeneralExplorer Crashes!
MohammadAmiry
2:28 2 Sep '05  
Hi
I used your code to make a shell estension that adds two items to the context menu (for all files and folders). When any
of these two items are selected, a temp file is created (in %APPDATA%). Then an exe file should run given this temp file
as its command line argument.
The code compiles and has no problem and anything goes fine, except for when I use the ShellExecute API. When I use this
API, the desired files runs with the correct commandline sent to it, but soon the explorer crashes and the file stops running.
Could you please explain Why? This is my code, the code that I have added is in Bold and the code that makes the
explorer crash is in Italic Bold. (if I comment this code, everything runs fine...)


HRESULT CMyShellExtention::InvokeCommand(LPCMINVOKECOMMANDINFO pCmdInfo)
{

USES_CONVERSION;
// If lpVerb really points to a string, ignore this function call and bail out
if (0 != HIWORD(pCmdInfo->lpVerb))
return E_INVALIDARG;

// Get the command index - the only valid commands are 0 and 1
WORD wCmd = LOWORD(pCmdInfo->lpVerb);
if (wCmd > 1)
return E_INVALIDARG;

string_list::const_iterator it, itEnd;
tchar_string clipBuffer;
tchar_string name;

it = m_lsFiles.begin();
itEnd = m_lsFiles.end();

clipBuffer = it->c_str();

while (++it != itEnd)
{
clipBuffer += '\n';//"\n";
clipBuffer += it->c_str();

}

TCHAR a[MAX_PATH];
SHGetSpecialFolderPath(NULL, (LPTSTR) a,CSIDL_APPDATA,false);
wsprintf(a, _T("%s\\MyFileTemp.tmp"), a);

FILE *f;
f= fopen(T2CA(a),"w");
fprintf(f, (char *) T2CA( clipBuffer.c_str() ));
fclose(f);

TCHAR* ss;
switch (wCmd)
{
case 0:
wsprintf(ss, _T("/s \"%s\""), a);
break;
case 1:
wsprintf(ss, _T("/m /s \"%s\""), a);
break;
}
//MessageBox(NULL, ss ,NULL,MB_OK);

ShellExecuteW(pCmdInfo->hwnd,_T("Open"),
_T("F:\\EasyPC Source\\MyFile.exe"),
ss,
_T("F:\\EasyPC Source"), 1);


return S_OK;
}



-- modified at 7:30 Friday 2nd September, 2005
GeneralRe: Explorer Crashes!
Michael Dunn
7:06 2 Sep '05  
You're using an uninitialized pointer (ss) and passing that around as a buffer.

--Mike--
Visual C++ MVP Cool
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
  -- Buffy

GeneralRe: Explorer Crashes!
MohammadAmiry
20:19 2 Sep '05  
Thank you for your great tutorial and quick reply.
D'Oh! and sorry for asking such a stupid question! Yes you were right! and my compiler also generated a warning that I didn't care to.
By the way, could you please introduce some documents on string conversions in C++!
I found that there are a bunch of string types and structures that they were hard for me (as a VB programmer that also has a limitted knowledge of C++) to convert to each other.
Thanks again
GeneralRe: Explorer Crashes!
Michael Dunn
23:24 2 Sep '05  
The Complete Guide to C++ Strings, Part I - Win32 Character Encodings[^]

The Complete Guide to C++ Strings, Part II - String Wrapper Classes[^]

Cool

--Mike--
Visual C++ MVP Cool
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
Laugh it up, fuzzball.
GeneralRe: Explorer Crashes!
MohammadAmiry
1:44 4 Sep '05  
Thanks again.
GeneralWin_32
Anonymous
15:04 6 Jul '05  
Why does evrything has to be writen in MFC i guess most are to laizy to write.
Could you do a tutorial in win32 without the mfc wraper clasess.

I'm trying to figure out how to do this in non-MFC classes.
It is just to anoying trying to strip it down.

GeneralRe: Win_32
Michael Dunn
16:05 6 Jul '05  
Um, not all of the articles use MFC. Part I doesn't, for example.

--Mike--
Visual C++ MVP Cool
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD

GeneralUninstalling shell extension DLL without reboot.
KalliMan
23:20 31 May '05  
Is it possible? I found many tutorials about Shell extensions, but each of them requere restart when uninstall. Is it possible to uninstall and delete my shell extension dll without restart? What do WinRar and WinZip? They doesn't requere restart duaring the uninstall.

Thanks.
KalliMan


a
GeneralRe: Uninstalling shell extension DLL without reboot.
Michael Dunn
21:18 1 Jun '05  
My guess is those apps register their shell extension DLL(s) to be deleted on the next reboot, using MoveFileEx().

--Mike--
Visual C++ MVP Cool
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD


Last Updated 2 Jun 2002 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2010