 |

|
It has an Explorer process(It's title "Program Manager") after windows startup. But the explorer don't load my ContextMenuHandlers extension dll.
How to do it?
Thanks
|
|
|
|

|
complete information is provided
|
|
|
|

|
Thank you for the great tutorials. They've been very helpful.
I have a shell extension that is registered to "AllFileObjects" and "Directory\Background" registry keys. The problem occurs when a folder in the Explorer Tree View is right clicked. The shell instantiates my shell extension twice, once with the folder name supplied in the pDataObj argument to Initialize, and once with the folder name supplied in the pidlFolder argument. This results in my menu items being added twice. Not good.
By implementing the registrations one at a time I have determined that (as I expected) the call passing the folder in the pDataObj is coming from the "AllFileObjects" registration and the call passing the folder in the pidlFolder argument is coming from the "Directory\Background" registration.
I need both registrations to be able to provide proper functionality from the Explorer file view pane but don't want two sets of menu items if the user selects in the tree view.
I've been trying to figure a way to identify when the call to Initialize and/or QueryContextMenu is from one of the Tree View entries so I can ensure only one set of menu items is added to the context menu. I've been evaluating the flag values passed through the fifth argument to QueryContextMenu.
I've noted that the 0x00020000 bit is set in the flag when the call is coming from the Explorer file view (even the background) and from any Desktop interaction. This bit is NOT set when the call is coming from the Exporer tree view. However I can't find any documentation about this bit (it is listed as one of the CMF_RESERVED bits in Microsoft documentation so I am reluctant to rely on it.
When a Folder or File is clicked in the Tree view or Desktop the 0x00000080 bit is set. This bit is not set for background clickes in either of these items and it is never set for clicks to the Tree view.
The other item I've been looking at is the registry key passed into IShellExtInit::Initialize as the third argument. I haven't been able to identify what key is actually being passed in. The documentation I've found is pretty vague saying that it is "the registry key for the file object or folder type". I have not been able to figure out what I might be able to do with this to differentiate the call.
I am actually hoping that there is something that I'm overlooking...
I am developing with VS2010 targeting Windows 7 64 bit.
If you or anyone can shed some light on my predicament it would be greatly appreciated.
Thanks in advance!
|
|
|
|

|
Can someone restore it, please?
|
|
|
|
|

|
Peace to all, i have been wanting to add a couple of buttons to Windows Explorer's existing toolbar. but i cant seem to find any starting point. All i know is that it has to be a shell extension. Please point me in the right direction. thnx
|
|
|
|
|

|
Can we implement "show in groups" using the shell namespace extension?
|
|
|
|

|
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?
|
|
|
|

|
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
|
|
|
|

|
This can be done with an explorer bar shell extension.
TiKu
--
www.TimoSoft-Software.de
|
|
|
|

|
Thanks,Can you point me to some existing example. how to do this?
Javed A Ansari
Software Developer
Hyderabad, India
|
|
|
|

|
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.
|
|
|
|

|
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
|
|
|
|

|
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.
|
|
|
|

|
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.
|
|
|
|

|
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
|
|
|
|
|

|
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++.
|
|
|
|

|
I've found one question about using SE on folders but is has no answers
Kirill
|
|
|
|

|
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
|
|
|
|

|
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.
|
|
|
|

|
I note there's a complete PDF in Italian - is there a complete PDF English
|
|
|
|

|
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 (0 != HIWORD(pCmdInfo->lpVerb))
return E_INVALIDARG;
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'; 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;
}
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
|
|
|
|

|
You're using an uninitialized pointer (ss) and passing that around as a buffer.
--Mike--
Visual C++ MVP
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
|
|
|
|

|
Thank you for your great tutorial and quick reply.
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
|
|
|
|
|
|

|
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.
|
|
|
|
|

|
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
|
|
|
|
|

|
That is what many installers do automatically as soon as they fail to remove the files in question (cause they were "in use").
It seems however that the recent Microsoft installer (MSI) has a way to uninstall a dumb (non self-un/registering) shell extension dll without restarting the system/explorer.
Upon deinstallation, the Microsoft System will not ask to restart the explorer even if it has linked the shell extension at that moment. It will however ask for shutting down other applications that may have linked it (e.g. Outlook cause you had file attachments visible that where supported by the extension).
I still am wondering how MSI is doing that as i need to remodel that exact behaviour using a different installer system.
|
|
|
|

|
mmsguru wrote: I still am wondering how MSI is doing that as i need to remodel that exact behaviour using a different installer system.
I know zilch about MSI, ask around on the MS newsgroups, you'll have a better chance of getting an answer there.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|

|
I am new to this forum and am trying to learn a context menu extension that I already have. I found this com dll at a site and it provides just what I need except now there is an issue. I don't think the problem is with this but an explorer issue.
If I select a group of files and execute my process, as expected my registry key is populated with the list of files and my executable called.
If I select a group of .lnk items my registry key is not populated because each .lnk points to the same file with different parameters and my executable is launched with the real file name once. This is not what I want because I need to process the actual shortcuts.
Here is the kicker, If I put a folder in the same parent as the .lnk files and select a group of .lnk files and the folder, as expected my registry key is populated with the list of .lnk files plus the folder and my executable called.
In the source provided with the dll I can see DragQueryFile is called to get the list of files. Has anyone ever encountered this behavior?
|
|
|
|

|
I looked at this a long time ago, so my memory may not be totally accurate here, but if you register your ctx menu handler under HKCR\lnkfile you should get the names of the lnk files themselves.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|

|
Right you are. Thanks.
Also, I enjoyed reading the articles you authored. They are elegantly done and full of information.
I have always been a big fan of context menus and until recently not coded my own utilities. Someone passed me a link to a dll that lets you make your own custom utility without having to create the dll. The creating company gave up on a project and set the code free in the wild. It has proven to be very helpful to “roll your own”.
Thanks again
|
|
|
|

|
I'm in the process of writing a namespace extension and I've come across a problem. I want to launch dialog boxes from within the DLL and there is something wrong. I believe the problem revolves around afx resources and instances, an area which I am woefully unfamiliar with. In DllMain - the initialization for the DLL - i have included the line :
AfxSetResourceHandle(g_hInstance);
Also as the first line in the function that generates the dialog box resource - which is stored in the same DLL - I have placed the line:
AFX_MANAGE_STATE(AfxGetStaticModuleState());
The current behavior is that on the first attempt to open the dialog box I recieve assertions on AfxGetInstanceHandle twice then the dialog opens; but it does not contain any of the controls that I had programmed. On subsequent attempts to open the dialog box I receive one assertion error on AfxGetInstanceHandle and then the dialog opens and appears to function exactly as I had programmed it. All the controls appear and functionally the dialog is fine. Anyone have any clue what would be causing this behavior?
I am compiling with Visual C++ 7.1.3088. Thanks for the help.
-Bryan
|
|
|
|

|
Hi Michael,
Is there a way to extend the folders so that when a folder is dropped on a file, the file is automatically moved/copied into the folder (hence the chomping ). I basically was wondering if the same action that happens when a file is dropped on a folder can be reversed?
"For that one fraction of a second, you were open to options you would never have considered. That is the exploration that awaits you. Not mapping stars and studying nebula, but charting the unknown possibilities of existence." - Q (Star Trek: The Next Generation) ^ Blog
|
|
|
|

|
Your idea would essentially entail registering a drop handler for all file types, but I don't know if the shell will look for drop handlers in the HKCR\*\ShellEx\DropHandler key, you could try it and find out
--Mike--
LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|

|
Hi,
I was thinking of adding my own custom toolbar button in windows explorer. is it possible? if so, can i ask for a complete project that does this?
your help is greatly appreciated.
ty very much.
|
|
|
|
|

|
clayton04 wrote:
I was thinking of adding my own custom toolbar button in windows explorer
AFAIK, you can't add buttons to the file system mode of Explorer, only IE mode. You can get control of the Explorer toolbar only if you build a namespace extension.
--Mike--
Personal stuff:: Ericahist Updated Feb 6! | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
You cannot stop me with paramecium alone!
|
|
|
|

|
Ty for the info. But how can i change the explorer to IE mode? Ty again.
Michael Dunn wrote:
AFAIK, you can't add buttons to the file system mode of Explorer, only IE mode. You can get control of the Explorer toolbar only if you build a namespace extension.
|
|
|
|
|

|
I've try the demo1, it works fine.
But When I click the "File Open" in Word,the dialog doesn't show the virtual folder.
How can I do to make the virtual folder accessible in such Dialog?
|
|
|
|

|
There are lots of 'solutions' for single file property page.
But multiple file properties are not available.
How can I implement this?
I've tried fullpath1+'\0'+fullpath2+'\0'+'\0'.
But it always shows first one(fullpath1)'s property.
|
|
|
|

|
I want to write a service that will treat a file as a folder in windows explorer. The file will have a specific format and so on.
I suppose that it is connected with shell programming but have no ideas how to implement it.
Please help.
|
|
|
|

|
You can do that by writing a namespace extension, and having Explorer invoke it when you try to "run" one of your files. Similar to how ZIP files appear in XP. I've never written this type of extension, however if you can find Dino Esposito's shell programming book, he covers this subject.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
 |