windows-shell

Windows 10 equivalent of LaunchAdvancedAssociationUI

馋奶兔 提交于 2019-11-30 00:11:03
Since Windows 10, the IApplicationAssociationRegistrationUI::LaunchAdvancedAssociationUI method does not work anymore. On Windows Vista, 7 and 8, it opens the Control Panel on the Set Program Associations page for specified application. On Windows 10, it does nothing. It's even documented in Microsoft documentation: Starting in Windows 10, this does not launch the association dialog box. It displays a dialog to the user informing them that they can change the default programs used to open file extensions in their Settings (Even the second part of the statement is no longer true in the current

Using 32-bit shell extensions in Windows 7 64-bit

只愿长相守 提交于 2019-11-29 19:04:36
问题 I'd like to develop a shell extension (context menu handler) compatible with both Windows XP SP2 (32-bit) and Windows 7 64-bit. Is it possible to run 32-bit shell extensions in 64-bit Windows, or must the shell extension be ported/rebuilt to 64-bit to be used in Windows 7 64-bit? Are there any disadvantages / known issues in using 32-bit shell extensions in 64-bit operating systems? 32-bit apps run just fine in 64-bit Windows, but I'm not sure about shell extensions, since, if my

Use Delphi to Find Special Drives

风流意气都作罢 提交于 2019-11-29 15:07:20
I am trying to write a small program in Delphi 2007 to access files off of a portable USB drive whenever it is plugged in to a Windows 7 machine. This drive does not show up as a standard drive letter though. It appears under Portable Devices in Windows Explorer. I have written the following code to enumerate all the items under 'Computer': Procedure TfrmMain.ComputerChanged(Var Msg: TMessage); Var Enum: IEnumIDList; Fetched: Longword; Item: PItemIDList; Path: String; Computer: IShellFolder; StrRet: TSTRRET; Begin Status('Computer changed... Checking folders.'); fDesktop.BindToObject(fCompPidl

CommonAppData in vbscript

狂风中的少年 提交于 2019-11-29 14:24:07
问题 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? 回答1: Const CommonAppData = &H23& ' the second & denotes a long integer ' Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(CommonAppData) Set objFolderItem = objFolder.Self MsgBox

How to refresh Windows Explorer

旧城冷巷雨未停 提交于 2019-11-29 11:15:55
A network volume's name can be changed. I changed the name to Spinal Disk To change a network name, I do Write new name in Registry. Attach my network volume using functions like DefineDosDeviceW. In this timing, Windows explorer read registry in my guessing. SHChangeNotify(SHCNE_DRIVEADD, SHCNF_PATH, root, NULL); // To be sure. SendMessageTimeout(HWND_BROADCAST, WM_DEVICECHANGE, message, (LPARAM)(&dbv), - SMTO_ABORTIFHUNG, 200, &dwResult); // To be sure again! It works, but sometimes doesn't work even though I use SHChangeNotify and WM_DEVICECHANGE to be sure. Sometimes, the new name is not

Changing environment variables of the calling process

我与影子孤独终老i 提交于 2019-11-29 10:50:52
This one seems trivial but the answer has eluded me for a few days now. I have a Windows batch file, that calls a C# program to do an extra verification that cannot be done in a batch file. After the verification is complete I need to return a status and a string back to the calling shell. Now the return value is trivial and my C# console app simply sets a return value (exit code if you will). And I thought the string will also be a piece of cake. I attempted to define a new shell variable using the: Environment.SetEnvironmentVariable("ERR", "Some text"); This call should (and does) define a

Recognize Windows Shell Special Folder (i.e. get its CSIDL) via its pIDL (Now determine if pIDLs are equal with C#)

偶尔善良 提交于 2019-11-29 10:49:01
I have a situation where I want to perform special processing on some Windows shell special folders (those corresponding to values in the CSIDL enum.) (My solution must be WinXP compatible.) The problem I'm having is that when I encounter IShellFolders as I work my way down the heirarchy, I cannot find a way to match up the IShellFolders to their CSIDL. This is my current approach: Initialize a static one-to-one data structure ( csidlToFromFullPIdl ) of all CSIDLs to their pIDLs returned by SHGetSpecialFolderLocation . foreach (CSIDL csidl in Enum.GetValues(typeof(CSIDL)) { IntPtr fullPIdl =

Create windows right click context menu for SPECIFIC folders

我们两清 提交于 2019-11-29 07:55:37
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. Is possible modifing your code for IShellExtInit: STDMETHODIMP CShellExt::Initialize(LPCITEMIDLIST pidl,LPDATAOBJECT pDataObj,HKEY hk) { // Initialize can be called

How can I create my custom Shell Context Handlers for Windows?

一世执手 提交于 2019-11-29 05:05:39
Problem Language: C# 2.0 or later I would like to register context handlers to create menues when the user right clicks certain files (in my case *.eic). What is the procedure to register, unregister (clean up) and handle events (clicks) from these menues? I have a clue it's something to do with the windows registry, but considering how much stuff there is in .net, I wouldn't be surprised if there are handy methods to do this clean and easy. Code snippets, website references, comments are all good. Please toss them at me. Update Obviously there is a slight problem creating context menues in

WindowChrome ResizeBorderThickness issue

允我心安 提交于 2019-11-29 04:05:18
问题 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