shell32.dll

How can I use the images within shell32.dll in my C# project?

天涯浪子 提交于 2019-11-27 14:12:00
How can I use the images within shell32.dll in my C# project? You can extract icons from a DLL with this code: public class IconExtractor { public static Icon Extract(string file, int number, bool largeIcon) { IntPtr large; IntPtr small; ExtractIconEx(file, number, out large, out small, 1); try { return Icon.FromHandle(largeIcon ? large : small); } catch { return null; } } [DllImport("Shell32.dll", EntryPoint = "ExtractIconExW", CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)] private static extern int ExtractIconEx(string sFile, int iIndex, out

Launch associated program or show “Open with” dialog from another program

元气小坏坏 提交于 2019-11-27 05:13:06
Under Window Seven, the following command displays a dialog box then terminates without any other action, why? The expected effect is launching the associated program Notepad++ or at least Notepad RUNDLL32.EXE SHELL32.DLL,OpenAs_RunDLL D:\doc\toto.txt Firstly, note that OpenAs_RunDLL is an undocumented entry point so the only reason to expect it to work is that it appears in the HKEY_CLASSES_ROOT registry as an implementation for the Open With shell verb (in at least some versions of Windows). This only means it can be expected to work when called by the appropriate shell functions. It does

How can I use the images within shell32.dll in my C# project?

∥☆過路亽.° 提交于 2019-11-26 16:32:54
问题 How can I use the images within shell32.dll in my C# project? 回答1: You can extract icons from a DLL with this code: public class IconExtractor { public static Icon Extract(string file, int number, bool largeIcon) { IntPtr large; IntPtr small; ExtractIconEx(file, number, out large, out small, 1); try { return Icon.FromHandle(largeIcon ? large : small); } catch { return null; } } [DllImport("Shell32.dll", EntryPoint = "ExtractIconExW", CharSet = CharSet.Unicode, ExactSpelling = true,

Launch associated program or show “Open with” dialog from another program

泄露秘密 提交于 2019-11-26 11:28:02
问题 Under Window Seven, the following command displays a dialog box then terminates without any other action, why? The expected effect is launching the associated program Notepad++ or at least Notepad RUNDLL32.EXE SHELL32.DLL,OpenAs_RunDLL D:\\doc\\toto.txt 回答1: Firstly, note that OpenAs_RunDLL is an undocumented entry point so the only reason to expect it to work is that it appears in the HKEY_CLASSES_ROOT registry as an implementation for the Open With shell verb (in at least some versions of