windows-shell

C#: How to use SHOpenFolderAndSelectItems [duplicate]

你离开我真会死。 提交于 2019-11-30 21:08:07
This question already has an answer here: C#: How to open Windows Explorer windows with a number of files selected 5 answers Could someone give an example on how to use the shell function SHOpenFolderAndSelectItems from C#? I don't quite get how to use these kind of functions and couldn't find it on pinvoke.net ... =/ Say I have three files called X:\Pictures\a.jpg X:\Pictures\s.jpg X:\Pictures\d.jpg I then want to open up the X:\Pictures folder with a.jpg , s.jpg and d.jpg selected. Julien Roncaglia As you seem to have asked twice the same question (the other being C#: How to open Windows

How to resize Windows Icon Overlay?

蓝咒 提交于 2019-11-30 20:36:31
I made a icon overlay to my file, *.myfile , but the overlay size is wrong. When the icon shows in size 16x16, the overlay covers the icon. How can I change the overlay size? ( IShellIconOverlayIdentifier ) You can't change the overlay size. Instead use a multi-resolution icon file where all necessary sizes are available. For a good example take a look into the source of TortoiseSVN . Their will be only one icon file used, but if you open it with an appropiate paint tool, you'll see that this file contains different sizes. Update If you take a look right at the first method, you'll get the

How to create an IconList property in the Windows Property System?

点点圈 提交于 2019-11-30 15:21:36
Currently, my property handler provides properties that can be displayed in Windows Explorer columns of type String . My goal is to extend the handler by a property of (display) type Icon , that can be added as a column to the details view of Windows Explorer. In this column, an icon should be displayed for each file item, e. g. the icon could represent a specific state of the file out of several possible states. However, I did not manage to assemble the necessary parts of creating a property with these characteristics on the base of the Windows Property System correctly. The first step of my

How to get Windows Explorer's selected files from within C#?

≡放荡痞女 提交于 2019-11-30 13:27:55
I need to get the current collection of files that are selected in Windows Explorer. I found the following code from here . I'm not quite there, though. For one thing, where does GetForegroundWindow come from? And for another thing, the compiler complains on the line var shell = new Shell32.Shell(); saying "The type or namespace name 'Shell32' could not be found (are you missing a using directive or an assembly reference?)". I have added SHDocVw as a reference, but I still can't get past the compiler. Can someone please help me get this completed? IntPtr handle = GetForegroundWindow();

Make Windows refresh icon cache

风流意气都作罢 提交于 2019-11-30 09:56:05
I really liked the oxygen appearance of KDE SC 4. I wrote a program to apply these icons to windows. The program is written in NSIS, and is currently nearly fully functional. However, the only way I found to make Windows aware of the icon changes is to kill explorer.exe, delete the icon cache, and respawn explorer.exe. SHChangeNotify with SHCNE_ASSOCCHANGED seems to be unable to make Windows aware of the changes to the Control Panel icon, the My Computer icon, etc. Please suggest a better, less brutal approach to make Windows aware of these changes. EDIT: I found a program called Icon Tweaker

CommonAppData in vbscript

五迷三道 提交于 2019-11-30 09:39:39
A customer's application "AppName" has its configuration files stored in CommonAppData. Under Windows XP that is C:\Documents and Settings\All Users\Application Data\AppName Under Windows Vista that is C:\ProgramData\AppName How do I get the correct foldername with VBScript? Const CommonAppData = &H23& ' the second & denotes a long integer ' Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(CommonAppData) Set objFolderItem = objFolder.Self MsgBox objFolderItem.Name & ": " & objFolderItem.Path The MSDN holds a page that lists the other Shell Special Folder

Create windows right click context menu for SPECIFIC folders

谁说我不能喝 提交于 2019-11-30 08:46:56
问题 How can I create a context menu that appears for files/folders inside a particular folder. Say there is a directory "D:\RandomCodes" How do I create a custom context menu item "Open in MyApp" for any file/folder inside this? This menu item should not appear for any other directory. I know if I add the entry in HKCR/Directory/Shell, it'll work, but then it'll appear for all files and folders everywhere. Please guide me through this. 回答1: Is possible modifing your code for IShellExtInit:

How do you drag and drop a file from Explorer Shell into a VirtualTreeView control in a Delphi application?

♀尐吖头ヾ 提交于 2019-11-30 07:25:15
There is extensive drag and drop support in VirtualTreeView by Mike Lischke, and I am using TVirtualStringTree, which has some on-drag-and-drop events, but I can not figure out how to get it to accept a shell drag-and-drop of some files from the windows explorer shell, into my application. I want to load the files, when they are dragged onto the drop control. I tried using a third-party set of code from Anders Melander, to handle drag and drop, but because VirtualTreeView already registers itself as a drop target, I can't use that. edit: I found a simple workaround: Turn off toAcceptOLEDrop in

WindowChrome ResizeBorderThickness issue

妖精的绣舞 提交于 2019-11-30 05:29:33
I am styling a Window, but I noticed this strange behaviour of WindowChrome (in .NET FW 4.0, from external Microsoft.Windows.Shell dll ). I set the WindowChrome with AllowTransparency = true and WindowStyle = None. If I set the WindowChrome's ResizeBorderThickness <= 7 everything works perfectly, but if I do ResizeBorderThickness="8" or more, when the Window is Maximized I can't drag it from the last top pixel near the top edge of the screen, and for each +1 exceeding 7 I must start dragging 1 pixel more down from the edge. This is annoying 'cause it disable a common behaviour when closing a

How to resize Windows Icon Overlay?

偶尔善良 提交于 2019-11-30 04:44:11
问题 I made a icon overlay to my file, *.myfile , but the overlay size is wrong. When the icon shows in size 16x16, the overlay covers the icon. How can I change the overlay size? ( IShellIconOverlayIdentifier ) 回答1: You can't change the overlay size. Instead use a multi-resolution icon file where all necessary sizes are available. For a good example take a look into the source of TortoiseSVN. Their will be only one icon file used, but if you open it with an appropiate paint tool, you'll see that