shell-extensions

Is there a Click Handler for Shell Extension

白昼怎懂夜的黑 提交于 2019-12-13 15:15:16
问题 After going through MSDN Shell Extensions I am not quite sure if I can extend the behaviour of Shell Click or Click Event of explorer. Any suggestion or Code Snipet, article or Walk through? 回答1: There is no such possibility. That would make the shell too vulnerable. Imagine all the malware that exploits this functionality. If you want to capture the click event, there is no easy way. You may SetWindowsHookEx and monitor/capture mouse messages for all windows of CabinetWClass and/or

SHGetFileInfo not return the icon location

我们两清 提交于 2019-12-12 19:34:02
问题 I try to extract the icon of file and return it to GetIconLocation of shell extension. in general I change the icons of files (te.docx.xx) with the extension of xx and returns the icon of file without the xx. (for this I cretae temp file in temp directory with the original extension e.g te.docx) my operating system is windows 7 x64. my code is: STDMETHODIMP CTxtIconShlExt::GetIconLocation ( UINT uFlags, LPTSTR szIconFile, UINT cchMax, int* piIndex, UINT* pwFlags ) { DWORD dwFileSizeLo,

Windows Explorer Shell Extension: create file and enter “rename” mode

孤者浪人 提交于 2019-12-12 09:52:16
问题 For a shell extension (UI is similar to "New/" context menu), I need to create a file, select it and enter "rename" mode, so the user can adjust the default name. Q: How do I enter "rename" mode for a file? 回答1: The correct way to do this is to use IShellView::SelectItem with the SVSI_EDIT flag. 回答2: Have you tried sending "F2" to the window? 来源: https://stackoverflow.com/questions/6258846/windows-explorer-shell-extension-create-file-and-enter-rename-mode

Shell Integrate in Windows for a Specific File Type With C#

孤者浪人 提交于 2019-12-12 09:42:10
问题 So I searched for a guide of how to shell integrate your application (add it to the right click menu) with C#, but I couldn't find how to do that only for a specific file type. I know it is possible because WinRar does that. So how can I do that? 回答1: There are usually two-ish ways you can implement this. Registry Keys - You can write keys and values under HKEY_CLASSES_ROOT. If you look at that hive you'll see the extensions on your pc. Look at this article for the details about the keys and

desktop.ini for root of the drive

孤街浪徒 提交于 2019-12-12 00:47:53
问题 In Windows, you can bind a Shell Namespace Extension to a folder by setting a System or Readonly attribute and placing a desktop.ini with appropriate CLSID inside. However, I can't see a way to set a system attribute to the root of the drive . Does this mean that I can't do it, or am I missing something obvious? 来源: https://stackoverflow.com/questions/11329846/desktop-ini-for-root-of-the-drive

Directory Path from Right Click

一世执手 提交于 2019-12-11 09:13:57
问题 I'm trying to write a program that can password protect individual folders, but I'm having a little trouble. I already have the option added to the context menu, but I don't know how to get the folder path that was right clicked on to open the context menu program. 回答1: The OS should pass the path to your program as an argument. It should be the first one. You would just need to capture the command line arguments in your code. C# - Arguments for application 来源: https://stackoverflow.com

srm.exe install shell extension: Fails with “Cannot cast the underlying exported value”

混江龙づ霸主 提交于 2019-12-11 04:50:11
问题 I have written this simplistic shell extension (explorer context menu) with SharpShell: [ComVisible(true)] [COMServerAssociation(AssociationType.AllFiles)] public class SampleExtension : SharpContextMenu { protected override bool CanShowMenu() { return true; } protected override ContextMenuStrip CreateMenu() { var menu = new ContextMenuStrip(); var item = new ToolStripMenuItem { Text = "Hello world!" }; menu.Items.Add(item); return menu; } } It works in debug with SharpShell Server Manager,

Contextual Menu to a Specific Folder

让人想犯罪 __ 提交于 2019-12-11 01:25:13
问题 I have read how to add a contextual menu though registry to all files or files according the extension. But how can I add a contextual menu that will work ONLY on files of a specific folder (for example on files of folder C:\contmenu)? Can this be done? Thanks a lot. 回答1: If you're implementing a context menu shell extension, you get the path of the item in your IShellExtInit::Initialize() method. Then you can decide depending on the path whether to add your entries to the context menu or not

Reload a namespace extension in explorer.exe that failed to load previously

自古美人都是妖i 提交于 2019-12-11 00:19:33
问题 Background I have a Shell Namespace Extension that is located (using a virtual folder as its junction point) under MyComputer. It is possible to create a shortcut to my namespace extension. Here I show my namespace extension with a shortcut on the desktop. If my namespace extension is not installed, the shortcut that I created when it was installed will be unresolved as expected. When my application starts up, it installs my namespace extension into the registry. When it exits, it removes the

Append to the default tooltip in a shell extension

蓝咒 提交于 2019-12-10 13:31:59
问题 I have a shell extension built using SharpShell. I am wondering if it is possible to append to the tooltip you see when you mouse over a file: I have read and tried to use a Shell Info Tip Handler, but the problem with this is that it overrides the entire tooltip with what you set it to, instead of giving you the ability to append a line of text to the default tooltip you normally would see, which is my desired outcome. I have a feeling this may not be supported in SharpShell, as a result, it