windows-shell

How might I obtain the IContextMenu that is displayed in an IShellView context menu?

Building a file open dialog replacement. Much of it works now, but I would like to generate the view-mode drop-down for the toolbar directly from the shell view object. Looking at IShellView2, I can see IShellView2::GetView() will give me the FOLDERVIEWMODE's supported. However, that doesn't give me the names of these modes, nor forma...

How to tell Windows Explorer to refresh its icons?

Once my installer finishes installing new versions of my application's exe, I'd like to tell Explorer to use the new exe's icons for its shortcuts. However, I cannot figure out how to do this. From reading online, it looks like the problem is that the system image list is caching an old version of the icon. I tried calling SHChangeNot...

How to obtain the PIDL of an IShellFolder

If I have an IShellFolder interface pointer, how might I obtain its PIDL? I can see how to enumerate its children, and I can see how to use it to compare any two children... but how might I get its own pidl? I ask because I'd like to know "Is this IShellFolder == Another IShellFolder". I can use IShellFolder::CompareIDs() - but I have...

What is the "Shell Namespace" way to create a new folder?

Obviously this is trivial to do with win32 api - CreateDirectory(). But I'm trying to host an IShellView, and would like to do this the most shell-oriented way. I would have thought that there would be a createobject or createfolder or some such from an IShellFolder. But neither IShellView nor IShellFolder nor even IFolderView seem to...

Global Shell Hook only registering local events

I am trying to use a global shell hook to listen for windows created and destroyed events, but it seems as though my program is only registering the destroyed event for the local thread. No creation events at all, and definitely not the global events that I think they should be. I have spent the last day scouring the googles as well as ...

Surely there is a way to obtain the full View pulldown for the current folder view?!

Motivation: Creating our own file dialog that looks & acts much like the std common dialog Problem: How to obtain the view pull-down for the current folder/shell container Apparent Dead Ends: Query the IShellFolder for its IContextMenu < NULL interface pointer. Query the IShellView for its IContextMenu < NULL interface pointer. IShel...

IContextMenu3 HandleMenuMsg2 is never called

Hi, I'm trying to implement a shell extension that extends IContextMenu3 and IShellExtInit, and i'm inserting menu items using the method described in section "HBMMENU_CALLBACK method" (http://www.nanoant.com/programming/themed-menus-icons-a-complete-vista-xp-solution) but in my project the method HandleMenuMsg2 or the HandleMenuMsg is...

Drag & drop of a dynamically created shortcut

I have a C# application that creates shortcuts to launch other programs with specific arguments and initial directories. I would like the user to be able to drag a shortcut from the Windows form and drop it anywhere relevant like the desktop, the start menu, and so on but I don't really know how to handle that, could anyone point me in t...

How to reproduce "Show in Folder" / "Find Target" via C#

When using Chrome, if you download a file you can then choose an option (Show in Folder) which will open the containing directory and highlight the file. Similarly, if you view the properties of a shortcut you can choose the "Find Target" button for that same functionality. I have tried numerous searches, as well as looking over a dece...

Send text to standard input of a Windows console app

I am trying to write a .bat file to automate some shell commands. Most of the commands are easy and I can just put them into the batch file directly, but there is one command which instead of taking command line parameters, expects you to type in the options you want using "the standard input". I'm not exactly sure what that means. Ca...

Programatically execute Windows Explorer context menu items

I'm about to tear my hair out for lack of a consistent, foolproof way to get at the context menu items that Explorer shows when I right click on an item. I don't want to show a menu, I just want to parse the items in the background and execute them programatically. I've tried various combinations of IShellFolder, IContextMenu, and other...

What are all of the well-known virtual folder GUIDs?

There seem to be a few virtual folders which have GUIDs associated to them (control panel, desktop) - ::{00021400-0000-0000-c000-000000000046} // desktop Where the blazes are these defined? When are they used? What I want is a way to have a string which represents a virtual folder without any ambiguity. If, for instance, I were to...

How do I extract the thumbnail of a File into an image file in .NET?

I'm trying to create a content catalog program that is used to browse files. I want to show the thumbnail of the files like Explorer does in windows. How can I use C#.Net to extract the thumbnail that windows explorer shows into an instance of System.Drawing.Image? I'm fairly certain I need to use this or something related to IExtractIm...

Manipulating the Windows 7 Explorer navigation pane

Based on the answers I received at superuser, it's clear that I'll have to add the following to a custom Explorer Window launcher. I want to launch a rooted explorer view, and for just that window make the navigation pane look like the old Windows XP folders pane. I already wrote a program to place shortcuts to these folder views on the ...

Windows shell extension with C#

I was wanting to write a simple windows shell extension to add to the context menu, and C# is the language I most use these days. Is it a decent choice for a shell extension? Are the interfaces easy to get to with it? Is there additional overhead that causes the menu to be slower to pop up? Any one have good pointers for getting st...

How to code a new Windows Shell?

How would I go about coding a new Windows Vista Shell? ...

Resolving of shell links in c# under Windows 7 fails

Hello, I try to resolve the paths of shell links, which are contained in the "Recent Documents" folder in Windows 7. I used the code posted here (Answer No 3) How to resolve a .lnk in c#. But the method ResolveShortcut is not able to determine the path of some files (e.g. many .txt-files). The same code works perfectly under Windows XP....

Pass a string containing the * (asterisk) character as a command line argument in Windows Shell

I am looking for a way to pass a string containg the "*" character to an executable via the command line. command.exe 3*2 I want to pass the string 3*2. What Windows does instead is search the current directory for files matching the file mask "3*2", and passes any files it found to command.exe Putting "3*2" between double quotes d...

Manipulation of the right click context menu in windows shell

I have been trying to manipulate my right clicks inside windows, using the registry. I managed to add single lines inside the shell. [HKEY_CLASSES_ROOT\Directory\shell\Notepad [HKEY_CLASSES_ROOT\Directory\shell\notepad\Command] @="\"notepad.exe" \"%1\"" would launch notepad for example. Now, what I really want is a subdirectory i...

Use system tray & icons in VBA (Access)

I've found a few tutorials that explain how to use the windows API to get a custom icon in the system tray. These are all for Visual Basic, and they don't seem to be scaling to VBA well. I'm following this short tutorial: http://atchoo.org/vb/systray.php Basically, you have to set the hIcon value (a 'long' variable) but it does not wo...