Repository: oleg-shilo/shell-x Branch: master Commit: d4677db7ad87 Files: 20 Total size: 863.4 KB Directory structure: gitextract_oyec51wb/ ├── .gitignore ├── Program.cs ├── README.md ├── shell-x/ │ ├── GenericExtensions.cs │ ├── Program.cs │ ├── Properties/ │ │ └── AssemblyInfo.cs │ ├── Regasm.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── TestForm.Designer.cs │ ├── TestForm.cs │ ├── TestForm.resx │ ├── app.config │ ├── app.manifest │ ├── packages.config │ ├── shell-x.csproj │ ├── shell-x.ruleset │ ├── sign_key.snk │ └── tools/ │ └── SharpShell.xml └── shell-x.sln ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. # User-specific files *.suo *.user *.userosscache *.sln.docstates # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs # Build results [Dd]ebug/ [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ x64/ x86/ bld/ [Bb]in/ [Oo]bj/ # Visual Studio 2015 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* # NUNIT *.VisualState.xml TestResult.xml # Build Results of an ATL Project [Dd]ebugPS/ [Rr]eleasePS/ dlldata.c # DNX project.lock.json artifacts/ *_i.c *_p.c *_i.h *.ilk *.meta *.obj *.pch *.pdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *.log *.vspscc *.vssscc .builds *.pidb *.svclog *.scc # Chutzpah Test files _Chutzpah* # Visual C++ cache files ipch/ *.aps *.ncb *.opendb *.opensdf *.sdf *.cachefile # Visual Studio profiler *.psess *.vsp *.vspx *.sap # TFS 2012 Local Workspace $tf/ # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user # JustCode is a .NET coding add-in .JustCode # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover # NCrunch _NCrunch_* .*crunch*.local.xml nCrunchTemp_* # MightyMoose *.mm.* AutoTest.Net/ # Web workbench (sass) .sass-cache/ # Installshield output folder [Ee]xpress/ # DocProject is a documentation generator add-in DocProject/buildhelp/ DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html # Click-Once directory publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml # TODO: Comment the next line if you want to checkin your web deploy settings # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj # NuGet Packages *.nupkg # The packages folder can be ignored because of Package Restore **/packages/* # except build/, which is used as an MSBuild target. !**/packages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/packages/repositories.config # Microsoft Azure Build Output csx/ *.build.csdef # Microsoft Azure Emulator ecf/ rcf/ # Microsoft Azure ApplicationInsights config file ApplicationInsights.config # Windows Store app package directory AppPackages/ BundleArtifacts/ # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache !*.[Cc]ache/ # Others ClientBin/ ~$* *~ *.dbmdl *.dbproj.schemaview *.pfx *.publishsettings node_modules/ orleans.codegen.cs # RIA/Silverlight projects Generated_Code/ # Backup & report files from converting an old project file # to a newer Visual Studio version. Backup files are not needed, # because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm # SQL Server files *.mdf *.ldf # Business Intelligence projects *.rdl.data *.bim.layout *.bim_*.settings # Microsoft Fakes FakesAssemblies/ # GhostDoc plugin setting file *.GhostDoc.xml # Node.js Tools for Visual Studio .ntvs_analysis.dat # Visual Studio 6 build log *.plg # Visual Studio 6 workspace options file *.opt # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts **/*.DesktopClient/ModelManifest.xml **/*.Server/GeneratedArtifacts **/*.Server/ModelManifest.xml _Pvt_Extensions # Paket dependency manager .paket/paket.exe # FAKE - F# Make .fake/ /support ================================================ FILE: Program.cs ================================================ public static void Execute(string item, string invokeArguments) { lock (typeof(App)) { // Debug.Assert(false); bool showConsole = item.Contains(".c."); bool handleMultiselect = item.Contains(".ms."); bool isPS = item.EndsWithAny(".ps1"); var arguments = new List(); arguments.AddRange(invokeArguments.SplitCommandLine()); arguments = arguments.Select(x => $"\"{x}\"").ToList(); if (!handleMultiselect) arguments = new[] { string.Join(" ", arguments.ToArray()) }.ToList(); foreach (var arg in arguments) { try { var p = new Process(); p.StartInfo.WorkingDirectory = Path.GetDirectoryName(item); p.StartInfo.FileName = item; p.StartInfo.Arguments = arg; if (isPS) { p.StartInfo.FileName = "powershell.exe"; p.StartInfo.Arguments = $"-File \"{item}\" {arg}"; } // save arguments to temp file var tempDir = Path.Combine(Path.GetTempPath(), "shell-x"); Directory.CreateDirectory(tempDir); var tempFile = Path.Combine(tempDir, Path.GetRandomFileName() + ".args.txt"); File.WriteAllText(tempFile, p.StartInfo.Arguments ?? string.Empty); p.StartInfo.Arguments = (p.StartInfo.Arguments ?? string.Empty) .Replace("%ARGS_FILE%", $"\"{tempFile\"") .Replace(" % ARGS_FILE % ", $"\"{tempFile\""); if (showConsole) { // code below works very well though it unconditionally waits. Thus an orthodox execution as // above is adequate particularly because it lets user to pause (with `pause` or with `$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')`) // in the batch file or path through to the exit. // // if (item.EndsWithAny(".ps1")) // { // p.StartInfo.FileName = "cmd.exe"; // p.StartInfo.Arguments = $"/K powershell.exe -File \"\"{item}\"\" {arg}"; // } // else // { // p.StartInfo.FileName = "cmd.exe"; // p.StartInfo.Arguments = $"/K \"\"{item}\"\" {arg}"; // } } else { p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.CreateNoWindow = true; p.StartInfo.EnvironmentVariables["SHELLX.SCRIPTDIR"] = Path.GetDirectoryName(item); } if (!p.StartInfo.UseShellExecute) p.StartInfo.EnvironmentVariables["ARGS_FILE"] = tempFile; p.EnableRaisingEvents = true; p.Exited += (s, e) => { Task.Run(async () => { await Task.Delay(5000); try { File.Delete(tempFile); } catch { } }); }; Debug.WriteLine($"Run: {p.StartInfo.FileName} {p.StartInfo.Arguments}"); p.Start(); } catch (Exception ex) { MessageBox.Show($"Error: {ex}", App.Name); } ; Task.Run(Cleanup); } } } ================================================ FILE: README.md ================================================ # Shell-X [![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://oleg-shilo.github.io/cs-script/Donation.html) _**Dynamic customizable file context menu solution for Windows. Allows creating context menus of any complexity without the need to compile COM shell extensions. The solution is based on the same concept as Windows Explorer native "Send to" context menu.**_ ## Overview In Windows Explorer, context menus are an extremely important part of the User Experience (UX). Just a single right-click on the file allows convenient access to the file type-specific operations. Unfortunately, the creation and customization of context menus were always a pain point. The problem is that Windows implements explorer context menus as so-called _Shell Extensions_. They are a heavy-weight COM servers that is not trivial to implement. And what is even more important they are components that must be rebuilt/recompiled every time user wants to change the menu structure or the associated menu action. And this in turn dramatically affects the user adoption of context menus as an operating system feature. Interestingly enough Windows has introduced an alternative light way for managing a very specific context menu - "Send to". ![image](images/send_to.png) The customisation of the "Send to" is dead simple. The user simply goes to the special folder and creates their shortcut(s) to the desired application. Then at runtime, the shortcut name will become the content menu item. And shortcut itself will be invoked (with the selected file path passed as an argument) when the user selects this menu item. ![image](images/send_to_files.png) This means that the creation and customization of the "Send to" context menu is a simple file creation/editing activity that does not even require user to be an admin (elevated). Shell-X applies the same simplified approach but extends it by allowing the creation of any context menu for any file type. Below are some of Shell-X features that extend Windows "Send to" approach: * Support for complex nested context menus. * Support for console and Windows menu actions. * Support for both batch files and PowerShell scripts as an action associated with a menu item. * Support for custom icons in the menu items. * The action definition is no longer a shortcut but a batch file so a menu action can have multiple steps. * Definitive menu items order thanks to the use of the sortable prefixes in the file names. * Individual context menu definitions for file types based on the file extension. _Note, that intensive use of icons may lead to memory exhaustion. This is a Windows Explorer bug/design flaw. Thus don't overuse this feature. You can read more about this in [this therad](https://github.com/oleg-shilo/shell-x/issues/22)._ ## Installation _With Chocolatey_ Install package _Shell-X_: ```PS choco install shell-x ``` _Manually_ - Download the release package and unzip its content in any location. - Execute the following two commands in the command prompt ``` shell-x -r shell-x -init ``` To uninstall just execute: ``` shell-x -unregister ``` Note, the explorer may lock the extension file so you may need to restart it before you can delete the file. _Configuration_ After the installation, the sample context menu (as described in the next section) will be created. Do modify and extend it as you wish by creating properly named batch files in the configuration folder as described in the next section. You can open the configuration folder at any time by executing the _open_ command in the command prompt: ``` shell-x -open ``` There is also an option (v1.4.0+) for testing the configuration outside of the Windows explorer ``` shell-x -test [path] ``` It is helpful for refining the mapping of the configuration to the selected item (path) actions. ![image](https://user-images.githubusercontent.com/16729806/191431089-d71bbc08-1722-4cae-ae2d-b315129902eb.png) ## How it works Shell-X maintains a global directory, whose file tree structure defines the complex context menu tree to be displayed at runtime on right click. The root folders are named according to the file extension that the context menu is for. Thus the folder `txt` contains context menu definition for all text files, and the `dll` folder is for all DLLs. There are special folder names: - `[any]` that defines the context menu for any selected file or folder. - `[folder]` that defines the context menu for any selected folder. - `[file]` that defines the context menu for any selected file. **Note A**, if you want multiple extension files to be handled the same way (by a single handler) you can achieve this by naming the special folder with the comma-separated extension names enclosed in the square brackets. IE for menu item associated with editing JPEG and BMP Files the folder name should be `[jpeg,bmp]`: **Note B** All special folders have their name enclosed in square brackets (e.g. `[any]` or `[txt,md]`) and all folders for specific file extension have their names exactly matching the extension text (e.g. `txt`). ![image](https://github.com/oleg-shilo/shell-x/assets/16729806/21ad4206-2043-4d66-903c-ec881a84e95e) Below is an example of the configuration for for text files (`txt` file extension). ![image](images/shell_x_files.png) This is how the menu for text files looks at runtime. ![image](images/shell_x_menu.png) In the example above the context menu for txt files has a complex structure containing sub-menus for opening the selected file with Notepad and other file handling operations. The content of _00.Notepad.cmd_ file is an ordinary batch file content: ``` notepad.exe %* ``` Since the menu items are composed according to the configuration folder file structure naming the files it is vital the proper naming convention is followed: * File name ``` .[.c][.ms]. ``` * By default the batch file is executed with the console window hidden. If you prefer console being visible include `.c` suffix before the batch file extension. * `.ms` in the file name has special meaning. It indicates that the batch file supports a multi-select scenario. Thus if multiple files are selected and executed against the shell extension menu item then every file will be executed in its own process of the corresponding batch file. Otherwise, by default, all files are passed to a single batch file. * If you want the menu item to have the icon then place the icon file in the same folder where the corresponding batch file is and give it the same file name as the batch file but with the _".ico"_ extension: ``` 05.Shell-X configure.cmd 05.Shell-X configure.ico ``` Note, you can use wild card expression as the folder name that encodes the pattern for the file name (of the file that is right-clicked). However, since the wild card characters are prohibited by the file system you will need to use special characters that look like the special wild card characters but are in fact special Unicode characters that are safe to use as folder names: ```C# // The Unicode characters that look like ? and * but still allowed in dir and file names string safeQuestionMark = "?"; string safeAsterisk = "⁎"; ``` Simply copy the characters from this description, compose the desired pattern in the text editor and then paste the pattern in the file explorer as a folder name. Thus your desired pattern for files cmn.ar.00, cmn.ar.01,. . . will look like this: ⁎.ar.⁎. ## Naming Convention The naming convention for configuration folders: - ``
Any selected file, whose extension is the same as the name of the folder (e.g. `txt`). - `[any]`
Any selected path - `[file]`
Any selected file - `[folder]`
Any selected folder - `[,,..]`
A selected file, whose extension is one of the comma-delimited values in the folder name (e.g. `[png,bmp,jpeg]`). ## Limitations * When the user right-clicks a file and the plugin is loaded for the very first time there is a noticeable delay (~3-5 seconds) before the menu pops up. This is a Windows Explorer one-off limitation and any subsequent right-clicks bring the context menu instantly. * Be aware of the problems caused by the excessive number of selected files. Windows limits the number of files that can be selected for shell extension or batch operations: https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation
If you configure a custom application to receive the explorer selection input that can exceed the size limt for starting the process with CLI command line (e.g. see #34) then you can specify in the cmd file (cmd/bat/ps1) the environment variable `ARGS_FILE` that will be set at runtime to the path to the temporary file containing list of all arguments that you can read from the application invoked by the shell extension. Passing normal arguments to your command script will be suppressed to avoid the excessive-arguments exception. IE: - **cmd/bat**: *00.TestLongSelection.cmd (00.TestLongSelection.bat)* ```ps1 my_app.exe %ARGS_FILE% ``` - **ps1**: *00.TestLongSelection.ps1* ```ps1 # Expand the environment variable $argsFilePath = [Environment]::ExpandEnvironmentVariables("%ARGS_FILE%") # Check if the file exists if (-not (Test-Path $argsFilePath)) { Write-Error "File not found: $argsFilePath" exit 1 } # Read and print every line Get-Content $argsFilePath | ForEach-Object { Write-Output $_ } ``` ================================================ FILE: shell-x/GenericExtensions.cs ================================================ using System; using System.Collections.Generic; using System.Drawing; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Windows.Forms; using ShellX; static class DSLExtensions { public static string ExpandEnvars(this string text) => Environment.ExpandEnvironmentVariables(text); public static string EnsureDirectory(this string dir) { Directory.CreateDirectory(dir); return dir; } public static bool ContainsAny(this IEnumerable items, params T[] patterns) => patterns.Any(x => items.Contains(x)); public static bool IsRegeiteredComServer(this Type type) { var registered = false; try { Type comType = Type.GetTypeFromCLSID(type.GUID); object instance = Activator.CreateInstance(comType); registered = true; } catch { } return registered; } public static string[][] ParseMultipleExt(this string[] items) { return items.Select(x => !Globals.IsSpecialFolder(x) && x.StartsWith("[") && x.EndsWith("]") ? x.Substring(1, x.Length - 2).Split(',') : null).Where(x => x != null).ToArray(); } public static bool Matching(this string text, string pattern, bool ignoreCase = true) => string.Compare(text, pattern, ignoreCase) == 0; public static bool MatchingAsExpression(this string text, string rawPattern, bool ignoreCase = true) { string safeQuestionMark = "?"; // The unicode characters that look like ? and * but still allowed in dir and file names string safeAsterisk = "⁎"; if (rawPattern.IndexOfAny((safeQuestionMark + safeAsterisk).ToArray()) != -1) { var pattern = rawPattern.Replace(safeQuestionMark, "?").Replace(safeAsterisk, "*"); var wildcard = new Regex(pattern.ConvertSimpleExpToRegExp(), ignoreCase ? RegexOptions.IgnoreCase : RegexOptions.None); return wildcard.IsMatch(text); } return false; } internal static bool EndsWithAny(this string text, params string[] patterns) => patterns.Any(x => text.EndsWith(x, StringComparison.OrdinalIgnoreCase)); public static string GetPath(this Environment.SpecialFolder folder) => Environment.GetFolderPath(folder); public static string PathJoin(this string path, params string[] paths) => Path.Combine(new[] { path }.Concat(paths).ToArray()); public static IEnumerable ForEach(this IEnumerable collection, Action action) { foreach (var item in collection) action(item); return collection; } public static string GetTitle(this Assembly assembly) => assembly.GetCustomAttribute()?.Title; public static bool IsDir(this string path) => File.GetAttributes(path).HasFlag(FileAttributes.Directory); public static bool IsFile(this string path) => !path.IsDir(); public static string ToArgumentsString(this IEnumerable args) => string.Join(" ", args.Select(x => $"\"{x}\"").ToArray()); public static string GetDirName(this string path) => Path.GetDirectoryName(path); public static string GetFileName(this string path) => Path.GetFileName(path); public static string GetExtension(this string path) => Path.GetExtension(path); public static void Save(this Icon icon, string file) { using (var fs = new FileStream(file, FileMode.Create)) icon.Save(fs); } public static string ChangeExtensionTo(this string path, string newExtension) => Path.ChangeExtension(path, newExtension); public static string ToFileMenuText(this string path) => path.GetFileName() .Split(new[] { '.' }, 2) .Last() .Replace(".c.", ".") .Replace(".ms.", ".") .Replace(".cmd", "") .Replace(".bat", "") .Replace(".ps1", ""); public static string ToDirMenuText(this string path) => path.GetFileName().Split(new[] { '.' }, 2).Last(); public static int FromLogicalToPhysical(this int logicalHeight, float dpiY) { float scalingFactor = dpiY / 96f; float physicalHeight = logicalHeight * scalingFactor; return (int)physicalHeight; } [DllImport("user32.dll")] static extern uint GetDpiForSystem(); [DllImport("user32.dll")] static extern IntPtr GetForegroundWindow(); [DllImport("user32.dll")] static extern uint GetDpiForWindow(IntPtr hWnd); [DllImport("kernel32.dll")] private static extern IntPtr GetModuleHandle(string lpModuleName); [DllImport("kernel32.dll", CharSet = CharSet.Ansi)] private static extern IntPtr GetProcAddress(IntPtr hModule, string procName); public static float GetCurrentDpi(this ToolStripItem item) { // cannot use CreateGraphics since there is no owner window, so using interop to get the system DPI IntPtr user32 = GetModuleHandle("user32.dll"); IntPtr proc = GetProcAddress(user32, "GetDpiForWindow"); if (proc == IntPtr.Zero) { // Fallback to system DPI return GetDpiForSystem(); } else { // Per-monitor DPI IntPtr hwnd = GetForegroundWindow(); return GetDpiForWindow(hwnd); } // float dpiY = 96f; // Default DPI // if (item.Owner != null) // { // using (Graphics g = item.Owner.CreateGraphics()) // { // dpiY = g.DpiY; // } // } // else if (item.OwnerItem != null && item.OwnerItem.Owner != null) // { // using (Graphics g = item.OwnerItem.Owner.CreateGraphics()) // { // dpiY = g.DpiY; // } // } // return dpiY; } public static int ToStandardIconSize(this int customSize) { var standardSizes = new[] { 16, 32, 48, 256 }; return standardSizes.OrderBy(x => Math.Abs((long)x - customSize)).First(); } public static string GetFileNameWithoutExtension(this string path) => Path.GetFileNameWithoutExtension(path); //Credit to MDbg team: https://github.com/SymbolSource/Microsoft.Samples.Debugging/blob/master/src/debugger/mdbg/mdbgCommands.cs public static string ConvertSimpleExpToRegExp(this string simpleExp) { // // string pattern = ConvertSimpleExpToRegExp(); // var wildcard = new Regex(pattern, RegexOptions.IgnoreCase); // if (wildcard.IsMatch(dir)) // // var sb = new StringBuilder(); sb.Append("^"); foreach (char c in simpleExp) { switch (c) { case '\\': case '{': case '|': case '+': case '[': case '(': case ')': case '^': case '$': case '.': case '#': case ' ': sb.Append('\\').Append(c); break; case '*': sb.Append(".*"); break; case '?': sb.Append("."); break; default: sb.Append(c); break; } } sb.Append("$"); return sb.ToString(); } } public static class CLIExtensions { public static string TrimMatchingQuotes(this string input, char quote) { if (input.Length >= 2) { //"-sconfig:My Script.cs.config" if (input.First() == quote && input.Last() == quote) { return input.Substring(1, input.Length - 2); } //-sconfig:"My Script.cs.config" else if (input.Last() == quote) { var firstQuote = input.IndexOf(quote); if (firstQuote != input.Length - 1) //not the last one return input.Substring(0, firstQuote) + input.Substring(firstQuote + 1, input.Length - 2 - firstQuote); } } return input; } public static IEnumerable Split(this string str, Func controller) { int nextPiece = 0; for (int c = 0; c < str.Length; c++) { if (controller(str[c])) { yield return str.Substring(nextPiece, c - nextPiece); nextPiece = c + 1; } } yield return str.Substring(nextPiece); } public static string[] SplitCommandLine(this string commandLine) { bool inQuotes = false; bool isEscaping = false; return commandLine.Split(c => { if (c == '\\' && !isEscaping) { isEscaping = true; return false; } if (c == '\"' && !isEscaping) inQuotes = !inQuotes; isEscaping = false; return !inQuotes && Char.IsWhiteSpace(c)/*c == ' '*/; }) .Select(arg => arg.Trim().TrimMatchingQuotes('\"').Replace("\\\"", "\"")) .Where(arg => !string.IsNullOrEmpty(arg)) .ToArray(); } } class ExplorerStub { public static int Test(string path) { TestForm.Show(path); return 0; } } ================================================ FILE: shell-x/Program.cs ================================================ using System; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using static System.Environment; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows.Forms; using static System.Windows.Forms.VisualStyles.VisualStyleElement; using SharpShell; using SharpShell.Attributes; using SharpShell.SharpContextMenu; using ShellX; class App { public static int Main(string[] args) { if (args.Contains("-open")) { Console.WriteLine($"Opening config directory: '{ConfigDir}'"); Process.Start("explorer", $"\"{ConfigDir}\""); } else if (args.ContainsAny("-init")) { var dir = ConfigDir.PathJoin("txt", "01.=== Shell-X for .txt file ===").EnsureDirectory(); File.WriteAllText(dir.PathJoin("..", "00.separator"), ""); File.WriteAllText(dir.PathJoin("..", "02.separator"), ""); File.WriteAllText(dir.PathJoin("00.Notepad.cmd"), "notepad.exe %*"); File.WriteAllText(dir.PathJoin("01.Notepad++.cmd"), "notepad++.exe %*"); File.WriteAllText(dir.PathJoin("02.separator"), ""); File.WriteAllText(dir.PathJoin("03.Show Info.c.cmd"), $"dir %*{NewLine}pause"); File.WriteAllText(dir.PathJoin("03.Show Path.c.ps1"), $"Write-Host \"File: $($args[0])\" \n" + $"Write-Host -NoNewLine 'Press any key to continue...'; " + $"$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');"); File.WriteAllText(dir.PathJoin("04.separator"), ""); File.WriteAllText(dir.PathJoin("05.Shell-X configure.cmd"), $"explorer \"{ConfigDir}\""); Resources.logo.Save(dir.PathJoin("05.Shell-X configure.ico")); dir = ConfigDir.PathJoin(Globals.AnyPath).EnsureDirectory(); File.WriteAllText(dir.PathJoin("01.Shell-X configure.cmd"), $"explorer \"{ConfigDir}\""); Resources.logo.Save(dir.PathJoin("01.Shell-X configure.ico")); dir = ConfigDir.PathJoin("txt"); Console.WriteLine($"Configured context menu for '*.*' and '*.txt' files: '{ConfigDir}'"); if (!args.ContainsAny("-noui")) Process.Start("explorer", $"\"{ConfigDir}\""); } else if (args.ContainsAny("-test")) { return ExplorerStub.Test(args.Where(x => x != "-test").FirstOrDefault()); } else if (args.ContainsAny("-register", "-r")) { return Regasm.Register(Assembly.GetExecutingAssembly().Location, Is64BitOperatingSystem) ? 0 : -1; } else if (args.ContainsAny("-unregister", "-u")) { return Regasm.Unregister(Assembly.GetExecutingAssembly().Location, Is64BitOperatingSystem) ? 0 : -1; } else { var serverType = typeof(DynamicContextMenuExtension); string cpuType = Environment.Is64BitProcess ? "x64" : "x32"; Console.WriteLine($"Dynamic context menu manager. Version {Assembly.GetExecutingAssembly().GetName().Version}"); Console.WriteLine($"Copyright (C) 2019-2020 Oleg Shilo (github.com/oleg-shilo/shell-x)"); Console.WriteLine(); Console.WriteLine("=================================================================="); Console.WriteLine($" Config directory: {ConfigDir}"); Console.WriteLine($" Shell Extension server: {serverType.GUID}"); Console.WriteLine($" Registered ({cpuType}): {serverType.IsRegeiteredComServer()}"); Console.WriteLine("=================================================================="); // Console.WriteLine("-----------------------"); Console.WriteLine(); Console.WriteLine($"Options:"); Console.WriteLine($" -open Opens configuration folder."); Console.WriteLine($" You can edit the context menus by changing the content of this folder"); Console.WriteLine($" -init Creates the sample configuration (e.g. for *.txt files)."); Console.WriteLine($" -test Creates the context menu for a given path and shows it without the need to " + $" interact with the explorer."); Console.WriteLine($" -register|-r Registers shell extension server"); Console.WriteLine($" -unregister|-u Unregisters shell extension server"); Console.WriteLine("-----------------------"); Console.WriteLine(); Console.WriteLine($"The naming convention for configuration folders:"); Console.WriteLine($"Read more at https://github.com/oleg-shilo/shell-x/blob/master/README.md#how-it-works"); Console.WriteLine(""); Console.WriteLine($"- "); Console.WriteLine($" Any selected file, whose extension is the same as the name of the folder (e.g. `txt`)."); Console.WriteLine($"- [any]"); Console.WriteLine($" Any selected path"); Console.WriteLine($"- [file]"); Console.WriteLine($" Any selected file"); Console.WriteLine($"- [folder]"); Console.WriteLine($" Any selected folder"); Console.WriteLine($"- [,,..]"); Console.WriteLine($" A selected file, whose extension is one of the comma-delimited values in the folder " + $"name (e.g. `[png,bmp,jpeg]`)."); } return 0; } static public string Name = Assembly.GetExecutingAssembly().GetTitle(); static public string ConfigDir => SpecialFolder.ApplicationData .GetPath() .PathJoin(Name.ToLower()) .EnsureDirectory(); } public class ExplorerSelectionStub { DynamicContextMenuExtension extension = new DynamicContextMenuExtension(); public ExplorerSelectionStub(params string[] selection) { SetItemPaths(selection.ToList()); } public void SetItemPaths(List selection) { var field = typeof(ShellExtInitServer).GetField("selectedItemPaths", BindingFlags.NonPublic | BindingFlags.Instance); var paths = (List)field.GetValue(extension); paths.AddRange(selection); } public bool CanShowMenu() { var result = (bool) extension.GetType() .GetMethod("CanShowMenu", BindingFlags.NonPublic | BindingFlags.Instance) .Invoke(extension, new object[0]); return result; } public ContextMenuStrip CreateMenu() { var result = (ContextMenuStrip) extension.GetType() .GetMethod("CreateMenu", BindingFlags.NonPublic | BindingFlags.Instance) .Invoke(extension, new object[0]); return result; } } class Globals { public const string AnyPath = "[any]"; public const string AnyFile = "[file]"; public const string AnyFolder = "[folder]"; public static bool IsSpecialFolder(string path) => path.Matching(AnyPath) || path.Matching(AnyFile) || path.Matching(AnyFolder); } [ComVisible(true)] // [COMServerAssociation(AssociationType.ClassOfExtension, ".dll", ".txt", ".cs")] [COMServerAssociation(AssociationType.AllFiles)] [COMServerAssociation(AssociationType.DirectoryBackground)] [COMServerAssociation(AssociationType.Folder)] public class DynamicContextMenuExtension : SharpContextMenu { static int lastPopupTime = 0; protected override bool CanShowMenu() { // Debug.Assert(true); // MessageBox.Show("CanShowMenu", Process.GetCurrentProcess().Id.ToString()); if ((Environment.TickCount - lastPopupTime) < 1000) { Debug.WriteLine("Ignoring duplicate query"); return false; // the query is executed twice if the clicked item is a folder on the folder tree. so exit to avoid duplication } lastPopupTime = Environment.TickCount; #if DEBUG Debug.WriteLine("--------------------"); Debug.WriteLine("this.SelectedItemPaths.Count: " + this.SelectedItemPaths.Count()); Debug.WriteLine("this.FolderPath: " + this.FolderPath); Debug.WriteLine("ConfiguredFileExtensions: " + String.Join(", ", this.ConfiguredFileExtensions)); Debug.WriteLine("Configured Multi File Extensions: " + String.Join(", ", new DynamicContextMenuExtension().ConfiguredFileExtensions.ParseMultipleExt().Select(x => "group(" + String.Join(", ", x) + ")"))); Debug.WriteLine("--------------------"); #endif bool result; if (this.SelectedItemPaths.Count() == 1) { // Debug.Assert(false); var path = this.SelectedItemPaths.First(); // Debug.Assert(false, "file/folder\n" + path); var ext = Path.GetExtension(path).Replace(".", ""); result = Directory.Exists(path) || // always allow for folders as it is the only way to invoke shell-x config (single menu item) ConfiguredFileExtensions.Any(x => x.Matching(ext)) || ConfiguredFileExtensions.Any(x => Path.GetFileName(path).MatchingAsExpression(x)) || ConfiguredFileExtensions.Any(x => x.Matching(Globals.AnyPath)) || (ConfiguredFileExtensions.Any(x => x.Matching(Globals.AnyFile)) && path.IsFile()) || (ConfiguredFileExtensions.Any(x => x.Matching(Globals.AnyFolder)) && path.IsDir()) || ConfiguredFileExtensions.ParseMultipleExt().Any(x => x != null ? x.Any(e => e.Matching(ext)) : false); } else { var extensions = ConfiguredFileExtensions.SelectMany(x => { if (x.StartsWith("[") && x.EndsWith("]") && x.Contains(",")) return x.Substring(1, x.Length - 2).Split(','); else return new[] { x }; }); foreach (string item in extensions) { var ext = "." + item; if (this.SelectedItemPaths.All(x => x.EndsWith(ext, StringComparison.OrdinalIgnoreCase))) { result = true; break; } } if (this.SelectedItemPaths.Any()) result = ConfiguredFileExtensions.Any(x => x.Matching(Globals.AnyPath)); else result = ConfiguredFileExtensions.Any(x => x.Matching(Globals.AnyFolder)); } Debug.WriteLine("CanShowMenu: " + result); return result; } protected override ContextMenuStrip CreateMenu() { // if we are here then every selected item is guaranteed to: // - have an extension // - all extensions are the same // - extension is configured for having context menu // Debug.Assert(false); var selectedItemPaths = new List(this.SelectedItemPaths); if (!selectedItemPaths.Any() && this.FolderPath.Any()) selectedItemPaths.Add(this.FolderPath); var configDir = GetConfigDirFor(selectedItemPaths.First()); var items = BuildMenuFrom(configDir, selectedItemPaths.ToArgumentsString()); try { if (ConfiguredFileExtensions.Any(x => x.Matching(Globals.AnyPath))) { var extraItems = BuildMenuFrom(GetConfigDirForAny(), selectedItemPaths.ToArgumentsString()); items = items.Concat(extraItems).ToArray(); } if (ConfiguredFileExtensions.Any(x => x.Matching("[file]")) && selectedItemPaths[0].IsFile()) { var extraItems = BuildMenuFrom(GetConfigDirByPath("[file]"), selectedItemPaths.ToArgumentsString()); items = items.Concat(extraItems).ToArray(); } var multiItemConfiguredFileExt = ConfiguredFileExtensions.ParseMultipleExt().Where(x => x.Any(xe => selectedItemPaths.All(e => Path.GetExtension(e)?.Matching(xe) != null))); if (multiItemConfiguredFileExt.Count() > 0) { multiItemConfiguredFileExt.ForEach(extList => { if (selectedItemPaths.All(File.Exists)) // all files, not dirs { var configuredExtensions = extList.Select(x => x.ToLower()).ToArray(); // ensure matching is case-insensitive bool selectedExtensionIsConfigured = selectedItemPaths.Select(Path.GetExtension) // .ext .Select(x => x.TrimStart('.').ToLower()) // ext .All(x => configuredExtensions.Contains(x)); // present in the configured extensions if (selectedExtensionIsConfigured) { var extraItems = BuildMenuFrom(GetConfigDirByPath("[" + string.Join(",", extList) + "]"), selectedItemPaths.ToArgumentsString()); items = items.Concat(extraItems).ToArray(); } } }); } } catch { } var menu = new ContextMenuStrip(); menu.Items.AddRange(items); DisposeLastMenu(); lastOpenedMenu = menu; return menu; } static ContextMenuStrip lastOpenedMenu; void DisposeLastMenu() { if (lastOpenedMenu != null) { foreach (var item in lastOpenedMenu.Items.OfType()) { try { var img = item.Image; item.Image = null; img?.Dispose(); } catch { } } lastOpenedMenu.Close(); lastOpenedMenu.Dispose(); } } static Image LookupImageFor(string path) { return LookupImageFor(path, ".ico") ?? LookupImageFor(path, ".png") ?? LookupImageFor(path, ".gif"); } static Image LookupImageFor(string path, string imgExtension) { var imgFile = path.IsDir() ? path + imgExtension : path.ChangeExtensionTo(imgExtension); var img = File.Exists(imgFile) ? imgFile.ReadImage() : null; return img; } internal static ToolStripItem[] BuildMenuFrom(string configDir, string invokeArguments) { var menus = new List(); var dirsToProcess = new Queue(); dirsToProcess.Enqueue(new BuildItem { AddItem = menus.Add, dir = configDir }); while (dirsToProcess.Any()) { BuildItem current = dirsToProcess.Dequeue(); if (!Directory.Exists(current.dir)) continue; var items = Directory.GetFiles(current.dir) .Concat(Directory.GetDirectories(current.dir)) .OrderBy(Path.GetFileName); foreach (var item in items) { if (item.IsDir()) { var parentMenu = new ToolStripMenuItem { Text = item.ToDirMenuText(), Image = LookupImageFor(item) }; try { var dpi = parentMenu.GetCurrentDpi(); var size = parentMenu.ContentRectangle.Height .FromLogicalToPhysical(dpi) .ToStandardIconSize(); parentMenu.Image = parentMenu.Image?.Resize(size, size); } catch { } current.AddItem(parentMenu); dirsToProcess.Enqueue(new BuildItem { AddItem = x => parentMenu.DropDownItems.Add(x), dir = item }); } else { if (item.EndsWithAny(".separator")) { current.AddItem(new ToolStripSeparator()); } else if (item.EndsWithAny(".cmd", ".bat", ".ps1")) { var menu = new ToolStripMenuItem { Text = item.ToFileMenuText(), Image = LookupImageFor(item) }; try { var dpi = menu.GetCurrentDpi(); var size = menu.ContentRectangle.Height .FromLogicalToPhysical(dpi) .ToStandardIconSize(); menu.Image = menu.Image?.Resize(size, size); } catch { } menu.Click += (s, e) => { Execute(item, invokeArguments); }; current.AddItem(menu); } } } } return menus.ToArray(); } public static void Cleanup() { try { var except = Process.GetCurrentProcess().Id.ToString(); Directory.GetFiles(App.ConfigDir.PathJoin(".run").EnsureDirectory(), "*.*.ps1") .Select(x => new { path = x, pid = x.GetFileName().Split('.').First() }) .Where(x => x.pid != except) .ToList() .ForEach(x => { try { File.Delete(x.path); } catch { } }); } catch { } } public static string CloneScript(string script) { var hash = (Path.GetFullPath(script) + File.GetLastWriteTimeUtc(script)).GetHashCode(); var clone = App.ConfigDir.PathJoin(".run") .EnsureDirectory() .PathJoin($"{Process.GetCurrentProcess().Id}.{hash}.ps1"); if (!File.Exists(clone)) { var content = File.ReadAllBytes(script); File.WriteAllBytes(clone, content); } return clone; } static bool ReferencesArgsFileEnvVar(string filePath) { try { if (string.IsNullOrWhiteSpace(filePath) || !File.Exists(filePath)) return false; var ext = Path.GetExtension(filePath); bool isCmd = ext.Equals(".cmd", StringComparison.OrdinalIgnoreCase) || ext.Equals(".bat", StringComparison.OrdinalIgnoreCase); bool isPs1 = ext.Equals(".ps1", StringComparison.OrdinalIgnoreCase); if (!isCmd && !isPs1) return false; var content = File.ReadAllText(filePath); if (isCmd) { // %ARGS_FILE% or !ARGS_FILE! return Regex.IsMatch(content, @"%ARGS_FILE%|!ARGS_FILE!", RegexOptions.IgnoreCase); } // PowerShell: $env:ARGS_FILE or ${env:ARGS_FILE} or %ARGS_FILE% (in case of using env var in the script without $env: prefix) return Regex.IsMatch(content, @"\$env:ARGS_FILE|\$\{env:ARGS_FILE\|%ARGS_FILE%", RegexOptions.IgnoreCase); } catch { return false; } } public static void Execute(string item, string invokeArguments) { lock (typeof(App)) { // Debug.Assert(false); bool showConsole = item.Contains(".c."); bool handleMultiselect = item.Contains(".ms."); bool isPS = item.EndsWithAny(".ps1"); var arguments = new List(); arguments.AddRange(invokeArguments.SplitCommandLine()); arguments = arguments.Select(x => $"\"{x}\"").ToList(); if (!handleMultiselect) arguments = new[] { string.Join(" ", arguments.ToArray()) }.ToList(); foreach (var arg in arguments) { try { var p = new Process(); p.StartInfo.WorkingDirectory = Path.GetDirectoryName(item); p.StartInfo.FileName = item; p.StartInfo.Arguments = arg; p.StartInfo.UseShellExecute = false; // needed to allow setting envars fro the child process if (isPS) { p.StartInfo.FileName = "powershell.exe"; p.StartInfo.Arguments = $"-File \"{item}\" {arg}"; } // save arguments to temp file var tempDir = Path.Combine(Path.GetTempPath(), "shell-x"); Directory.CreateDirectory(tempDir); var tempFile = Path.Combine(tempDir, Path.GetRandomFileName() + ".args.txt"); File.WriteAllText(tempFile, p.StartInfo.Arguments ?? string.Empty); if (ReferencesArgsFileEnvVar(p.StartInfo.FileName)) { // arguments are passed through environment variable, so clear them to avoid duplication p.StartInfo.Arguments = ""; } if (showConsole) { // code below works very well though it unconditionally waits. Thus an orthodox execution // is adequate particularly because it lets user to pause (with `pause` or with `$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')`) // in the batch file or path through to the exit. // // if (item.EndsWithAny(".ps1")) // { // p.StartInfo.FileName = "cmd.exe"; // p.StartInfo.Arguments = $"/K powershell.exe -File \"\"{item}\"\" {arg}"; // } // else // { // p.StartInfo.FileName = "cmd.exe"; // p.StartInfo.Arguments = $"/K \"\"{item}\"\" {arg}"; // } } else { p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.CreateNoWindow = true; } if (!p.StartInfo.UseShellExecute) { p.StartInfo.EnvironmentVariables["SHELLX.SCRIPTDIR"] = Path.GetDirectoryName(item); p.StartInfo.EnvironmentVariables["ARGS_FILE"] = tempFile; } p.EnableRaisingEvents = true; p.Exited += (s, e) => { Task.Run(async () => { await Task.Delay(5000); try { File.Delete(tempFile); } catch { } }); }; Debug.WriteLine($"Run: {p.StartInfo.FileName} {p.StartInfo.Arguments}"); p.Start(); } catch (Exception ex) { MessageBox.Show($"Error: {ex}", App.Name); } ; Task.Run(Cleanup); } } } class BuildItem { public Action AddItem; public string dir; } #if DEBUG public string[] ConfiguredFileExtensions #else string[] ConfiguredFileExtensions #endif => Directory.GetDirectories(App.ConfigDir) .Select(x => x.GetFileName()) // gets dir name only without the rest of the path .ToArray(); string GetConfigDirFor(string file) { var dir = (Directory.Exists(file)) ? App.ConfigDir.PathJoin("[folder]") : App.ConfigDir.PathJoin(file.GetExtension().Replace(".", "")); if (Directory.Exists(dir)) return dir; var match = Directory .GetDirectories(App.ConfigDir) .Where(x => Path.GetFileName(file).MatchingAsExpression(Path.GetFileName(x))) .FirstOrDefault(); return match; } string GetConfigDirForAny() => App.ConfigDir.PathJoin(Globals.AnyPath); string GetConfigDirByPath(string dir) => App.ConfigDir.PathJoin(dir); } static class Utils { static Dictionary loadedImages = new Dictionary(); public static Image ReadImage(this string file) { var imageId = $"{file}{File.GetLastWriteTimeUtc(file).ToFileTimeUtc()}"; if (loadedImages.ContainsKey(imageId)) return loadedImages[imageId]; using (var ms = new MemoryStream(File.ReadAllBytes(file))) { Image image; if (string.Compare(Path.GetExtension(file), ".ico", StringComparison.OrdinalIgnoreCase) == 0) { using (var temp = new Icon(ms)) image = temp.ToBitmap(); } else { image = Image.FromStream(ms); } loadedImages[imageId] = image; return image; } } public static Bitmap Resize(this Image image, int width, int height) { var destRect = new Rectangle(0, 0, width, height); var destImage = new Bitmap(width, height); destImage.SetResolution(image.HorizontalResolution, image.VerticalResolution); using (var graphics = Graphics.FromImage(destImage)) { graphics.CompositingMode = CompositingMode.SourceCopy; graphics.CompositingQuality = CompositingQuality.HighQuality; graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; graphics.SmoothingMode = SmoothingMode.HighQuality; graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; using (var wrapMode = new ImageAttributes()) { wrapMode.SetWrapMode(WrapMode.TileFlipXY); graphics.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, wrapMode); } } return destImage; } } ================================================ FILE: shell-x/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Shell-X")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Shell-X")] [assembly: AssemblyCopyright("Copyright © Oleg Shilo 2019-2024")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("b80a4faa-4c08-4057-b9f0-57fd692be278")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.6.0.0")] [assembly: AssemblyFileVersion("1.6.0.0")] ================================================ FILE: shell-x/Regasm.cs ================================================ using System; using System.Diagnostics; using System.IO; using System.Linq; using Microsoft.Win32; using SharpShell.Extensions; using SharpShell.ServerRegistration; static class Regasm { public static Action OnError = Console.WriteLine; public static Action OnOut; static bool Run(string exe, string arguments) { var regasm = new Process { StartInfo = { FileName = exe, Arguments = arguments, UseShellExecute = false, RedirectStandardOutput = true, RedirectStandardError = true, CreateNoWindow = true } }; regasm.Start(); regasm.WaitForExit(); if (regasm.ExitCode == 0) OnOut?.Invoke(regasm.StandardOutput.ReadToEnd()); else OnError?.Invoke(regasm.StandardError.ReadToEnd()); return regasm.ExitCode == 0; } public static bool Register(string assemblyPath, bool is64) => Run(GetRegasm(is64), $"/codebase \"{assemblyPath}\""); public static bool Unregister(string assemblyPath, bool is64) => Run(GetRegasm(is64), $"/u \"{assemblyPath}\""); static string GetRegasm(bool is64) { // C:\WINDOWS\Microsoft.Net\Framework\v1.1.4322\regasm.exe // C:\WINDOWS\Microsoft.Net\Framework\v2.0.50727\regasm.exe // C:\WINDOWS\Microsoft.Net\Framework\v4.0.30319\regasm.exe var frameworkFolder = is64 ? "Framework64" : "Framework"; var searchRoot = Path.Combine("%WINDIR%", "Microsoft.Net", frameworkFolder).ExpandEnvars(); var path = Directory.GetDirectories(searchRoot, "v*") .OrderByDescending(s => s) .Select(c => c.PathJoin("regasm.exe")) .FirstOrDefault(File.Exists); if (path == null) throw new InvalidOperationException($@"Failed to find regasm in '{searchRoot}\v*\regasm.exe'."); return path; } } public class ServerRegistration { public static bool IsExtensionApproved(Guid serverClsid, bool is64) { // Open the approved extensions key. using (var approvedKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, is64 ? RegistryView.Registry64 : RegistryView.Registry32) .OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved", RegistryKeyPermissionCheck.ReadSubTree)) { // If we can't open the key, we're going to have problems. if (approvedKey == null) throw new InvalidOperationException("Failed to open the Approved Extensions key."); return approvedKey.GetValueNames().Any(vn => vn.Equals(serverClsid.ToRegistryString(), StringComparison.OrdinalIgnoreCase)); } } // public static ShellExtensionRegistrationInfo GetServerRegistrationInfo(Guid serverCLSID, RegistrationType registrationType) // { // // We can very quickly check to see if the server is approved. // bool serverApproved = IsExtensionApproved(serverCLSID, registrationType); // // Open the classes. // using (var classesKey = OpenClassesKey(registrationType, RegistryKeyPermissionCheck.ReadSubTree)) // { // // Do we have a subkey for the server? // using (var serverClassKey = classesKey.OpenSubKey(serverCLSID.ToRegistryString())) // { // // If there's no subkey, the server isn't registered. // if (serverClassKey == null) // return null; // // Do we have an InProc32 server? // using (var inproc32ServerKey = serverClassKey.OpenSubKey(KeyName_InProc32)) // { // // If we do, we can return the server info for an inproc 32 server. // if (inproc32ServerKey != null) // { // // Get the default value. // var defaultValue = GetValueOrEmpty(inproc32ServerKey, null); // // If we default value is null or empty, we've got a partially registered server. // if (string.IsNullOrEmpty(defaultValue)) // return new ShellExtensionRegistrationInfo(ServerRegistationType.PartiallyRegistered, serverCLSID); // // Get the threading model. // var threadingModel = GetValueOrEmpty(inproc32ServerKey, KeyName_ThreadingModel); // // Is it a .NET server? // if (defaultValue == KeyValue_NetFrameworkServer) // { // // We've got a .NET server. We should have one subkey, with the assembly version. // var subkeyName = inproc32ServerKey.GetSubKeyNames().FirstOrDefault(); // // If we have no subkey name, we've got a partially registered server. // if (subkeyName == null) // return new ShellExtensionRegistrationInfo(ServerRegistationType.PartiallyRegistered, serverCLSID); // // Otherwise we now have the assembly version. // var assemblyVersion = subkeyName; // // Open the assembly subkey. // using (var assemblySubkey = inproc32ServerKey.OpenSubKey(assemblyVersion)) // { // // If we can't open the key, we've got a problem. // if (assemblySubkey == null) // throw new InvalidOperationException("Can't open the details of the server."); // // Read the managed server details. // var assembly = GetValueOrEmpty(assemblySubkey, KeyName_Assembly); // var @class = GetValueOrEmpty(assemblySubkey, KeyName_Class); // var runtimeVersion = GetValueOrEmpty(assemblySubkey, KeyName_RuntimeVersion); // var codeBase = assemblySubkey.GetValue(KeyName_CodeBase, null); // // Return the server info. // return new ShellExtensionRegistrationInfo(ServerRegistationType.ManagedInProc32, serverCLSID) // { // ThreadingModel = threadingModel, // Assembly = assembly, // AssemblyVersion = assemblyVersion, // Class = @class, // RuntimeVersion = runtimeVersion, // CodeBase = codeBase != null ? codeBase.ToString() : null, // IsApproved = serverApproved // }; // } // } // // We've got a native COM server. // // Return the server info. // return new ShellExtensionRegistrationInfo(ServerRegistationType.NativeInProc32, serverCLSID) // { // ThreadingModel = threadingModel, // ServerPath = defaultValue, // IsApproved = serverApproved // }; // } // } // // If by this point we haven't return server info, we've got a partially registered server. // return new ShellExtensionRegistrationInfo(ServerRegistationType.PartiallyRegistered, serverCLSID); // } } ================================================ FILE: shell-x/Resources.Designer.cs ================================================ //------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace ShellX { using System; /// /// A strongly-typed resource class, for looking up localized strings, etc. /// // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ShellX.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// internal static System.Drawing.Icon logo { get { object obj = ResourceManager.GetObject("logo", resourceCulture); return ((System.Drawing.Icon)(obj)); } } } } ================================================ FILE: shell-x/Resources.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 logo.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ================================================ FILE: shell-x/TestForm.Designer.cs ================================================ namespace ShellX { partial class TestForm { /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; /// /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.button1 = new System.Windows.Forms.Button(); this.pathTextBox = new System.Windows.Forms.TextBox(); this.button2 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.selectionCount = new System.Windows.Forms.NumericUpDown(); this.label2 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.selectionCount)).BeginInit(); this.SuspendLayout(); // // contextMenuStrip1 // this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Size = new System.Drawing.Size(61, 4); // // button1 // this.button1.Location = new System.Drawing.Point(12, 61); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(105, 23); this.button1.TabIndex = 1; this.button1.Text = "Popup Menu"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // pathTextBox // this.pathTextBox.Location = new System.Drawing.Point(13, 29); this.pathTextBox.Name = "pathTextBox"; this.pathTextBox.Size = new System.Drawing.Size(235, 20); this.pathTextBox.TabIndex = 2; this.pathTextBox.TextChanged += new System.EventHandler(this.pathTextBox_TextChanged); // // button2 // this.button2.Location = new System.Drawing.Point(123, 61); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(104, 23); this.button2.TabIndex = 3; this.button2.Text = "Init Config"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // button3 // this.button3.Location = new System.Drawing.Point(233, 61); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(104, 23); this.button3.TabIndex = 4; this.button3.Text = "Open Config"; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(12, 10); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(74, 13); this.label1.TabIndex = 5; this.label1.Text = "Selected Path"; // // selectionCount // this.selectionCount.Location = new System.Drawing.Point(272, 29); this.selectionCount.Maximum = new decimal(new int[] { 10000, 0, 0, 0}); this.selectionCount.Minimum = new decimal(new int[] { 1, 0, 0, 0}); this.selectionCount.Name = "selectionCount"; this.selectionCount.Size = new System.Drawing.Size(63, 20); this.selectionCount.TabIndex = 6; this.selectionCount.Value = new decimal(new int[] { 1, 0, 0, 0}); // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(254, 32); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(12, 13); this.label2.TabIndex = 7; this.label2.Text = "x"; // // TestForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(347, 93); this.Controls.Add(this.label2); this.Controls.Add(this.selectionCount); this.Controls.Add(this.label1); this.Controls.Add(this.button3); this.Controls.Add(this.button2); this.Controls.Add(this.pathTextBox); this.Controls.Add(this.button1); this.Name = "TestForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "TestForm"; ((System.ComponentModel.ISupportInitialize)(this.selectionCount)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.Button button1; private System.Windows.Forms.TextBox pathTextBox; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button3; private System.Windows.Forms.Label label1; private System.Windows.Forms.NumericUpDown selectionCount; private System.Windows.Forms.Label label2; } } ================================================ FILE: shell-x/TestForm.cs ================================================ using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace ShellX { public partial class TestForm : Form { public static void Show(string path) { new TestForm() { initialPath = path }.ShowDialog(); } public TestForm() { InitializeComponent(); this.VisibleChanged += (s, e) => pathTextBox.Text = initialPath ?? Environment.CurrentDirectory; } string initialPath; void Popup() { var selection = new List(); for (int i = 0; i < selectionCount.Value; i++) selection.Add(pathTextBox.Text); var explorerSelction = new ExplorerSelectionStub(selection.ToArray()); if (!explorerSelction.CanShowMenu()) { MessageBox.Show("No menu is configured for the specified path"); return; } var cm = explorerSelction.CreateMenu(); cm.Items.Add(new ToolStripSeparator()); var screen = Screen.FromPoint(Cursor.Position); var left = screen.Bounds.X + screen.Bounds.Width / 2 - 200; var top = screen.Bounds.Y + 150; cm.Show(new Point(left, top)); cm.Focus(); } void button1_Click(object sender, EventArgs e) => Popup(); void button2_Click(object sender, EventArgs e) { if (Directory.Exists(App.ConfigDir) && Directory.GetDirectories(App.ConfigDir).Any()) MessageBox.Show("Directory already exists and it is not empty."); else App.Main(new[] { "-init" }); } void button3_Click(object sender, EventArgs e) { App.Main(new[] { "-open" }); } private void pathTextBox_TextChanged(object sender, EventArgs e) { } } } ================================================ FILE: shell-x/TestForm.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 17, 17 ================================================ FILE: shell-x/app.config ================================================  ================================================ FILE: shell-x/app.manifest ================================================  PerMonitorV2 ================================================ FILE: shell-x/packages.config ================================================  ================================================ FILE: shell-x/shell-x.csproj ================================================  Debug AnyCPU {B80A4FAA-4C08-4057-B9F0-57FD692BE278} Exe Properties ShellX shell-x v4.6.1 512 true true full false bin\Debug\ DEBUG;TRACE prompt 4 false AnyCPU false shell-x.ruleset pdbonly true bin\Release\ TRACE prompt 4 true shell-x.ruleset true sign_key.snk app.manifest logo.ico ..\packages\ServerRegistrationManager.2.7.2\lib\net45\ServerRegistrationManager.exe ..\packages\SharpShell.2.7.2\lib\net40-client\SharpShell.dll True True Resources.resx Form TestForm.cs ResXFileCodeGenerator Resources.Designer.cs TestForm.cs copy "$(TargetPath)" "$(SolutionDir)bin\$(TargetFileName)" copy "$(TargetDir)SharpShell.dll" "$(SolutionDir)bin\SharpShell.dll" ================================================ FILE: shell-x/shell-x.ruleset ================================================  ================================================ FILE: shell-x/tools/SharpShell.xml ================================================ SharpShell The AssociationType determines what kind of associate a COM server is made to a class, such as a file class or a drive. No server association. Create an association to a specific file extension. This attribute is deprecated. Shell extensions should not be registered directly on file extensions, but on the class of the extension. Create an association to the class of a specific file extension. Create an association to a class. Create an association to the 'all files' class. Create an association to the 'all files and folders' class. Create an association to the 'directory' class, i.e. file-system folders. Create an association to the background of folders and the desktop Create an association to the background of the desktop (Windows 7 and higher) Create an association to the drive class. Create an association to the 'folder' class, i.e. all containers. Create an association to the unknown files class. Provides metadata for a predefined shell object. Initializes a new instance of the class. Name of the class in the registry for this object. Gets the class name for a type with a set, or null if none is set. The value. Gets the class name. Specify the registry key name under which a SharpShell server should be registered. By default (without this attribute) a server is registered under the classname. Since each server needs its own registry key name, this attribute does not inherit. Initializes a new instance of the class. The registry key name under which the SharpShell server should be registered. Cannot be null or whitespace. Gets the registry key name under which to register the SharpShell server. Gets the registration name for a type if defined. The type. The registration name of the type if defined, or null otherwise. Gets the registration name for a type. The type. The registration name of the type if defined, or type.Name otherwise. Attribute to associate a SharpShell server with a file extension. Initializes a new instance of the class. Type of the association. The associations. Gets the file extension associations for a specified type. The type. The set of file extension assocations. Gets the type of the association. The type. The association type. The extensions. Gets the type of the association. The type of the association. Gets the associations. Identifies a function as being a static custom registration function. Executes the CustomUnregisterFunction if it exists for a type. The type. Type of the registration. Identifies a function as being a static custom registration function. Executes the CustomRegisterFunction if it exists for a type. The type. Type of the registration. The name attribute can be used to give a class display name. Initializes a new instance of the class. The display name. Gets the display name for a type, if defined. The type. The display name of the type, if defined. Gets the display name of the (if defined and not empty) for a type. If there is no display name, or it is empty, the type name is returned. The type. The display name of the (if defined and not empty) for a type, otherwise the type name. Gets the display name. Attribute to describe handler subkey config. Initializes a new instance of the class. if set to true [allow multiple entries]. The handler subkey. Gets a value indicating whether multiple entries are allowed. true if multiple entries are allowed; otherwise, false. Gets the handler subkey. The handler subkey. The ServerTypeAttribute can be used internally by SharpShell to mark the type of a server base class. By setting this type, classes derived from the decorated class will be able to use the COMServerAssociationAttribute without any extra configuration. Initializes a new instance of the class. Type of the server. Gets the server type of a type of the association. The type. The ServerType of the type, or None if not set. Gets the type of the server. The type of the server. Allows the special class key to be defined. Initializes a new instance of the class. The key. Gets the special class key. The special class key. The CategoryManager class provides methods which allow us to register COM categories for components. It manages the instantiation of an type. Registers a COM category for a given type. The CLSID. The category identifier. Unregisters a COM category for a given type. The CLSID. The category identifier. Creates the category registration manager object. An instance. The CLSID for the standard component category manager. Browsable shell extensions category id. Browse in place category id. The desk band category id. The info band band category id. The Comm band category id. The ExtractIconImpl class is an implementation of and which can return a .NET that contains multiple images sizes to the shell. Gets the location and index of an icon. One or more of the following values. This parameter can also be NULL. A pointer to a buffer that receives the icon location. The icon location is a null-terminated string that identifies the file that contains the icon. The size of the buffer, in characters, pointed to by pszIconFile. A pointer to an int that receives the index of the icon in the file pointed to by pszIconFile. A pointer to a UINT value that receives zero or a combination of the following value Returns S_OK if the function returned a valid location, or S_FALSE if the Shell should use a default icon. If the GIL_ASYNC flag is set in uFlags, the method can return E_PENDING to indicate that icon extraction will be time-consuming. Gets the location and index of an icon. One or more of the following values. This parameter can also be NULL. A pointer to a buffer that receives the icon location. The icon location is a null-terminated string that identifies the file that contains the icon. The size of the buffer, in characters, pointed to by pszIconFile. A pointer to an int that receives the index of the icon in the file pointed to by pszIconFile. A pointer to a UINT value that receives zero or a combination of the following value Returns S_OK if the function returned a valid location, or S_FALSE if the Shell should use a default icon. If the GIL_ASYNC flag is set in uFlags, the method can return E_PENDING to indicate that icon extraction will be time-consuming. Extracts an icon image from the specified location. A pointer to a null-terminated string that specifies the icon location. The index of the icon in the file pointed to by pszFile. A pointer to an HICON value that receives the handle to the large icon. This parameter may be NULL. A pointer to an HICON value that receives the handle to the small icon. This parameter may be NULL. The desired size of the icon, in pixels. The low word contains the size of the large icon, and the high word contains the size of the small icon. The size specified can be the width or height. The width of an icon always equals its height. Returns S_OK if the function extracted the icon, or S_FALSE if the calling application should extract the icon. Extracts an icon image from the specified location. A pointer to a null-terminated string that specifies the icon location. The index of the icon in the file pointed to by pszFile. A pointer to an HICON value that receives the handle to the large icon. This parameter may be NULL. A pointer to an HICON value that receives the handle to the small icon. This parameter may be NULL. The desired size of the icon, in pixels. The low word contains the size of the large icon, and the high word contains the size of the small icon. The size specified can be the width or height. The width of an icon always equals its height. Returns S_OK if the function extracted the icon, or S_FALSE if the calling application should extract the icon. Return an Icon of the requested size. The requested icon size. An Icon of the requested size. Gets or sets a value indicating whether or not to cache icons. true if icons should not be cached; otherwise, false. Gets or sets the underlying icon. The icon. Represents the SharpShell logging mode. Logging is disabled. Win32 debug output, suitable for dbmon or DbgView. Log to the Event Log. Log to file. Represents SharpShell system configuration. Load and save system configuration via the . Initializes a new instance of the class. Only ever created by . Gets a value indicating whether configuration is present. This is a purely informational value that indicates whether there is SharpShell configuration in the registry. true if configuration is present; otherwise, false. Gets or sets the logging mode. The logging mode. Gets or sets the log path. Only used if is set to File. The log path. Represents SharpShell System Configuration on the local machine. This class can be used to read and write the system configuration. The system configuration data itself. Initializes the class. Loads the configuration. The system configuration. Saves the configuration. Gets the configuration. The configuration. A logger which logs to standard debug output. Logs an error. The error. Logs a warning. The warning. Logs a message. The message. A logger which logs to the Windows Event Log. The source created flag. If true, we have a source. Initializes a new instance of the class. Logs an error. The error. Logs a warning. The warning. Logs a message. The message. The event log log. The EventLog Source for SharpShell. SharpShell logger to write to a log file. Safe across processes. Mutex to allow multiple processes to write to the file. The log file path. Initializes a new instance of the class. The log path. Writes the specified line to the log file. The line. Logs an error. The error. Logs a warning. The warning. Logs a message. The message. Defines a contract for a type which can log messages. Logs an error. The error. Logs a warning. The warning. Logs a message. The message. A Helper Class for managing certain features of Windows Explorer Restarts the explorer process. The logging class is used for SharpShell logging. The loggers used. Initializes the class. Logs the specified message. The message. Errors the specified message as an error. The message. The exception. The ExplorerConfigurationManager can be used to manage explorer configuration relating to the shell. Initializes a new instance of the class. Checks the always unload DLL value. True if always unload dll is set. Checks the desktop process value. True if check desktop process is set. Reads the configuration. Sets the always unload DLL value. Sets the desktop process value. Opens the exporer subkey. The hive key. The permission check. The explorer subkey. The AlwaysUnloadDLL key name. The AlwaysUnloadDLL sub key name. The windows explorer key namme. The dekstop process value name. The always unload dll flag. The desktop process flag. Gets or sets a value indicating whether always unload DLL is set. true if always unload DLL is set; otherwise, false. Gets or sets a value indicating whether desktop process is set. true if desktop process is set; otherwise, false. Extension methods for enumerations. Gets the first value of an attribute of the given type, or null. The attribute type. The enum value. The first value of the given type, or null. Extensions for the Guid type. Returns the GUID as a string suitable for the registry. The Guid. The GUID as a string suitable for the registry Extensions for the IDataObject interface. Gets the file list. The IDataObject instance. The file list in the data object. Extensions for cotrols. Calls the window proc. Me. The window handle. The message. The w param. The l param. True if the message was handled. Finds the control inside this control which has focus, if any. The the parent control. The child control with focus, or null. A ComStream is a wrapper around the COM IStream interface, providing direct .NET style access to a COM IStream. Initializes a new instance of the class. The source COM stream. Finalizes an instance of the class. Releases all resources used by the Com Stream. When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device. When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. An array of bytes. When this method returns, the buffer contains the specified byte array with the values between and ( + - 1) replaced by the bytes read from the current source. The zero-based byte offset in at which to begin storing the data read from the current stream. The maximum number of bytes to be read from the current stream. The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. When overridden in a derived class, sets the position within the current stream. A byte offset relative to the parameter. A value of type indicating the reference point used to obtain the new position. The new position within the current stream. When overridden in a derived class, sets the length of the current stream. The desired length of the current stream in bytes. When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. An array of bytes. This method copies bytes from to the current stream. The zero-based byte offset in at which to begin copying bytes to the current stream. The number of bytes to be written to the current stream. The COM stream instance. The buffer pointer. The position of the pointer in the stream. When overridden in a derived class, gets a value indicating whether the current stream supports reading. true if the stream supports reading; otherwise, false. When overridden in a derived class, gets a value indicating whether the current stream supports seeking. true if the stream supports seeking; otherwise, false. When overridden in a derived class, gets a value indicating whether the current stream supports writing. true if the stream supports writing; otherwise, false. When overridden in a derived class, gets the length in bytes of the stream. A long value representing the length of the stream in bytes. When overridden in a derived class, gets or sets the position within the current stream. The current position within the stream. RegAsm provides a simple interface to find and run a locally installed 'regasm.exe' executable. The standard output from the most recent execution. The standard error from the most recent execution. Registers the given assembly, as 32 bit. The assembly path. if set to true set the codebase flag. true if registration succeeded, false otherwise. Registers the given assembly, as 64 bit. The assembly path. if set to true set the codebase flag. true if registration succeeded, false otherwise. Unregisters the given assembly, as 32 bit. The assembly path. true if unregistration succeeded, false otherwise. Unregisters the given assembly, as 64 bit. The assembly path. true if unregistration succeeded, false otherwise. Finds the 'regasm.exe' path, from the given framework folder. The framework folder, which would normally be %WINDIR%\Microsoft.NET\Framework or %WINDIR%\Microsoft.NET\Framework64. The path to the regasm.exe executable, from the most recent .NET Framework installation. Thrown if a valid regasm path cannot be found. Helper for Win32, providing access to some of the key macros which are often used. Gets the LoWord of an IntPtr. The int pointer. The LoWord of an IntPtr. Gets the HiWord of an IntPtr. The int pointer. The HiWord of an IntPtr. Determines whether a value is an integer identifier for a resource. The pointer to be tested whether it contains an integer resource identifier. true if all bits except the least 16 bits are zero, indicating 'resource' is an integer identifier for a resource. Otherwise it is typically a pointer to a string. InitializeWithStreamServer provides a base for SharpShell Servers that must implement IInitializeWithStream (thumbnail handlers, etc). Initializes a handler with a stream. A pointer to an IStream interface that represents the stream source. One of the following STGM values that indicates the access mode for pstream. STGM_READ or STGM_READWRITE. Gets the selected item stream. The selected item stream. Where to obtain association data and the form the data is stored in. One of the following values from the ASSOCCLASS enumeration. The hkClass member names a key found as HKEY_CLASSES_ROOT\SystemFileAssociations\hkClass. The hkClass member provides the full registry path of a ProgID. The pszClass member names a ProgID found as HKEY_CLASSES_ROOT\pszClass. The hkClass member provides the full registry path of a CLSID. The hkClass member names a CLSID found as HKEY_CLASSES_ROOT\CLSID\pszClass. The hkClass member provides the full registry path of an application identifier (APPID). The APPID storing the application information is found at HKEY_CLASSES_ROOT\Applications\FileName where FileName is obtained by sending pszClass to PathFindFileName. The pszClass member names a key found as HKEY_CLASSES_ROOT\SystemFileAssociations\pszClass. Use the association information for folders stored under HKEY_CLASSES_ROOT\Folder. When this flag is set, hkClass and pszClass are ignored. Use the association information stored under the HKEY_CLASSES_ROOT\* subkey. When this flag is set, hkClass and pszClass are ignored. Introduced in Windows 8. Do not use the user defaults to apply the mapping of the class specified by the pszClass member. Introduced in Windows 8. Use the user defaults to apply the mapping of the class specified by the pszClass member; the class is a protocol. Defines information used by AssocCreateForClasses to retrieve an IQueryAssociations interface for a given file association. Where to obtain association data and the form the data is stored in. One of the following values from the ASSOCCLASS enumeration. A registry key that specifies a class that contains association information. A pointer to the name of a class that contains association information. A BITMAPINFOHEADER structure that contains information about the dimensions of color format. An array of RGBQUAD. The elements of the array that make up the color table. Describes a component category. The category identifier for the component. The locale identifier. See Language Identifier Constants and Strings. The description of the category (cannot exceed 128 characters). The COLORREF value is used to specify an RGB color. Initializes a new instance of a from a . The color. The DWORD representation of the color. Gets the color. The color. Contains context menu information used by SHCreateDefaultContextMenu. A handle to the context menu. Set this member to the handle returned from CreateMenu. A pointer to the IContextMenuCB interface supported by the callback object. This value is optional and can be NULL. The PIDL of the folder that contains the selected file object(s) or the folder of the context menu if no file objects are selected. This value is optional and can be NULL, in which case the PIDL is computed from the psf member. A pointer to the IShellFolder interface of the folder object that contains the selected file objects, or the folder that contains the context menu if no file objects are selected. The count of items in member apidl. A pointer to a constant array of ITEMIDLIST structures. Each entry in the array describes a child item to which the context menu applies, for instance, a selected file the user wants to Open. A pointer to the IQueryAssociations interface on the object from which to load extensions. This parameter is optional and thus can be NULL. If this value is NULL and members aKeys and cKeys are also NULL (see Remarks), punkAssociationInfo is computed from the apidl member and cidl via a request for IQueryAssociations through IShellFolder::GetUIObjectOf. If IShellFolder::GetUIObjectOf returns E_NOTIMPL, a default implementation is provided based on the SFGAO_FOLDER and SFGAO_FILESYSTEM attributes returned from IShellFolder::GetAttributesOf. The count of items in member aKeys. This value can be zero. If the value is zero, the extensions are loaded based on the object that supports interface IQueryAssociations as specified by member punkAssociationInfo. If the value is non-NULL, the extensions are loaded based only on member aKeys and not member punkAssociationInfo. Note: The maximum number of keys is 16. Callers must enforce this limit as the API does not. Failing to do so can result in memory corruption. A pointer to an HKEY that specifies the registry key from which to load extensions. This parameter is optional and can be NULL. If the value is NULL, the extensions are loaded based on the object that supports interface IQueryAssociations as specified in punkAssociationInfo. Receives information about a band object. This structure is used with the deprecated IDeskBand::GetBandInfo method. Set of flags that determine which members of this structure are being requested. This will be a combination of the following values: DBIM_MINSIZE ptMinSize is being requested. DBIM_MAXSIZE ptMaxSize is being requested. DBIM_INTEGRAL ptIntegral is being requested. DBIM_ACTUAL ptActual is being requested. DBIM_TITLE wszTitle is being requested. DBIM_MODEFLAGS dwModeFlags is being requested. DBIM_BKCOLOR crBkgnd is being requested. Point structure that receives the minimum size of the band object. The minimum width is placed in the x member and the minimum height is placed in the y member. Point structure that receives the maximum size of the band object. The maximum height is placed in the y member and the x member is ignored. If there is no limit for the maximum height, (LONG)-1 should be used. Point structure that receives the sizing step value of the band object. The vertical step value is placed in the y member, and the x member is ignored. The step value determines in what increments the band will be resized. This member is ignored if dwModeFlags does not contain DBIMF_VARIABLEHEIGHT. Point structure that receives the ideal size of the band object. The ideal width is placed in the x member and the ideal height is placed in the y member. The band container will attempt to use these values, but the band is not guaranteed to be this size. The title of the band. A value that receives a set of flags that define the mode of operation for the band object. This must be one or a combination of the following values. DBIMF_NORMAL The band is normal in all respects. The other mode flags modify this flag. DBIMF_VARIABLEHEIGHT The height of the band object can be changed. The ptIntegral member defines the step value by which the band object can be resized. DBIMF_DEBOSSED The band object is displayed with a sunken appearance. DBIMF_BKCOLOR The band will be displayed with the background color specified in crBkgnd. The background color of the band. This member is ignored if dwModeFlags does not contain the DBIMF_BKCOLOR flag. The view mode of the band object. This is one of the following values. Band object is displayed in a horizontal band. Band object is displayed in a vertical band. Band object is displayed in a floating band. Band object is displayed in a transparent band. The set of flags that determine which members of this structure are being requested by the caller. One or more of the following values: ptMinSize is requested. ptMaxSize is requested. ptIntegral is requested. ptActual is requested. wszTitle is requested. dwModeFlags is requested. crBkgnd is requested. A value that receives a set of flags that specify the mode of operation for the band object. One or more of the following values: The band uses default properties. The other mode flags modify this flag. Windows XP and later: The band object is of a fixed sized and position. With this flag, a sizing grip is not displayed on the band object. DBIMF_FIXEDBMP Windows XP and later: The band object uses a fixed bitmap (.bmp) file as its background. Note that backgrounds are not supported in all cases, so the bitmap may not be seen even when this flag is set. The height of the band object can be changed. The ptIntegral member defines the step value by which the band object can be resized. Windows XP and later: The band object cannot be removed from the band container. The band object is displayed with a sunken appearance. The band is displayed with the background color specified in crBkgnd. Windows XP and later: If the full band object cannot be displayed (that is, the band object is smaller than ptActual, a chevron is shown to indicate that there are more options available. These options are displayed when the chevron is clicked. Windows XP and later: The band object is displayed in a new row in the band container. Windows XP and later: The band object is the first object in the band container. Windows XP and later: The band object is displayed in the top row of the band container. Windows Vista and later: No sizing grip is ever displayed to allow the user to move or resize the band object. Windows Vista and later: A sizing grip that allows the user to move or resize the band object is always shown, even if that band object is the only one in the container. Windows Vista and later: The band object should not display margins. Imports from gdi32.dll. Deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. After the object is deleted, the specified handle is no longer valid. A handle to a logical pen, brush, font, bitmap, region, or palette. If the function succeeds, the return value is true. If the specified handle is not valid or is currently selected into a DC, the return value is false. Deletes the specified device context (DC). A handle to the device context. If the function succeeds, the return value is true. If the function fails, the return value is false. Retrieves the bits of the specified compatible bitmap and copies them into a buffer as a DIB using the specified format. A handle to the device context. A handle to the bitmap. This must be a compatible bitmap (DDB). The first scan line to retrieve. The number of scan lines to retrieve. A pointer to a buffer to receive the bitmap data. If this parameter is , the function passes the dimensions and format of the bitmap to the structure pointed to by the parameter. A pointer to a structure that specifies the desired format for the DIB data. The format of the bmiColors member of the structure. It must be one of the following values. If the lpvBits parameter is non-NULL and the function succeeds, the return value is the number of scan lines copied from the bitmap. If the lpvBits parameter is NULL and GetDIBits successfully fills the structure, the return value is nonzero. If the function fails, the return value is zero. This function can return the following value: ERROR_INVALID_PARAMETER (87 (0×57)) Input GIL flags. Set this flag to determine whether the icon should be extracted asynchronously. If the icon can be extracted rapidly, this flag is usually ignored. If extraction will take more time, GetIconLocation should return E_PENDING Retrieve information about the fallback icon. Fallback icons are usually used while the desired icon is extracted and added to the cache. The icon is displayed in a Shell folder. The icon indicates a shortcut. However, the icon extractor should not apply the shortcut overlay; that will be done later. Shortcut icons are state-independent. The icon is in the open state if both open-state and closed-state images are available. If this flag is not specified, the icon is in the normal or closed state. This flag is typically used for folder objects. Explicitly return either GIL_SHIELD or GIL_FORCENOSHIELD in pwFlags. Do not block if GIL_ASYNC is set. provides methods for registering and unregistering component category information in the registry. This includes both the human-readable names of categories and the categories implemented or required by a given component or class. Registers one or more component categories. Each component category consists of a CATID and a list of locale-dependent description strings. The number of component categories to register. The array of cCategories CATEGORYINFO structures. By providing the same CATID for multiple CATEGORYINFO structures, multiple locales can be registered for the same component category. Removes the registration of one or more component categories. Each component category consists of a CATID and a list of locale-dependent description strings. The number of cCategories CATIDs to be removed. Identifies the categories to be removed. Registers the class as implementing one or more component categories. The class ID of the relevent class for which category information will be set. The number of categories to associate as category identifiers for the class. The array of cCategories CATIDs to associate as category identifiers for the class. Removes one or more implemented category identifiers from a class. The class ID of the relevant class to be manipulated. The number of category CATIDs to remove. The array of cCategories CATID that are to be removed. Only the category IDs specified in this array are removed. Registers the class as requiring one or more component categories. The class ID of the relevent class for which category information will be set. The number of category CATIDs to associate as category identifiers for the class. The array of cCategories CATID to associate as category identifiers for the class. Removes one or more required category identifiers from a class. The class ID of the relevent class to be manipulated. The number of category CATIDs to remove. The array of cCategories CATID that are to be removed. Only the category IDs specified in this array are removed. Exposed by the common file dialog boxes to be used when they host a Shell browser. If supported, ICommDlgBrowser exposes methods that allow a Shell view to handle several cases that require different behavior in a dialog box than in a normal Shell view. You obtain an ICommDlgBrowser interface pointer by calling QueryInterface on the IShellBrowser object. Called when a user double-clicks in the view or presses the ENTER key. A pointer to the view's IShellView interface. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Called after a state, identified by the uChange parameter, has changed in the IShellView interface. A pointer to the view's IShellView interface. Change in the selection state. This parameter can be one of the following values. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Allows the common dialog box to filter objects that the view displays. A pointer to the view's IShellView interface. A PIDL, relative to the folder, that identifies the object. The browser should return S_OK to include the object in the view, or S_FALSE to hide it. Exposes a method that enables the callback of a context menu. For example, to add a shield icon to a menuItem that requires elevation. Enables the callback function for a context menu. A pointer to the IShellFolder interface of the object that supports the IContextMenuCB::CallBack interface. The context menu interface is returned on a call to GetUIObjectOf. A handle to the owner of the context menu. This value can be NULL. A pointer to an IDataObject that contains information about a menu selection. Implement interface IDataObject, or call SHCreateDataObject for the default implementation. A notification from the Shell's default menu implementation. For example, the default menu implementation calls DFM_MERGECONTEXTMENU to allow the implementer of IContextMenuCB::CallBack to remove, add, or disable context menu items in this callback. Use one of the following notifications. Data specific to the notification specified in uMsg. See the individual notification page for specific requirements. Data specific to the notification specified in uMsg. See the individual notification page for specific requirements. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Exposes methods to set default icons associated with an object. Sets GIL_XXX flags. See GetIconLocation Specifies return flags to get icon location. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the registry key from which to load the "DefaultIcon" value. A handle to the registry key. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the normal icon. A pointer to a buffer that contains the full icon path, including the file name and extension, as a Unicode string. This pointer can be NULL. A Shell icon ID. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the icon that allows containers to specify an "open" look. A pointer to a buffer that contains the full icon path, including the file name and extension, as a Unicode string. This pointer can be NULL. Shell icon ID. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the icon for a shortcut to the object. A pointer to a buffer that contains the full icon path, including the file name and extension, as a Unicode string. This pointer can be NULL. Shell icon ID. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the default icon. A pointer to a buffer that contains the full icon path, including the file name and extension, as a Unicode string. This pointer can be NULL. The Shell icon ID. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets information about a band object. Retrieves a handle to one of the windows participating in in-place activation (frame, document, parent, or in-place object window). A pointer to a variable that receives the window handle. This method returns S_OK on success. Determines whether context-sensitive help mode should be entered during an in-place activation session. TRUE if help mode should be entered; FALSE if it should be exited. This method returns S_OK if the help mode was entered or exited successfully, depending on the value passed in fEnterMode. Instructs the docking window object to show or hide itself. TRUE if the docking window object should show its window. FALSE if the docking window object should hide its window and return its border space by calling SetBorderSpaceDW with zero values. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Notifies the docking window object that it is about to be removed from the frame. The docking window object should save any persistent information at this time. Reserved. This parameter should always be zero. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Notifies the docking window object that the frame's border space has changed. In response to this method, the IDockingWindow implementation must call SetBorderSpaceDW, even if no border space is required or a change is not necessary. Pointer to a RECT structure that contains the frame's available border space. Pointer to the site's IUnknown interface. The docking window object should call the QueryInterface method for this interface, requesting IID_IDockingWindowSite. The docking window object then uses that interface to negotiate its border space. It is the docking window object's responsibility to release this interface when it is no longer needed. Reserved. This parameter should always be zero. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets state information for a band object. The identifier of the band, assigned by the container. The band object can retain this value if it is required. The view mode of the band object. One of the following values: DBIF_VIEWMODE_NORMAL, DBIF_VIEWMODE_VERTICAL, DBIF_VIEWMODE_FLOATING, DBIF_VIEWMODE_TRANSPARENT. The pdbi. Exposes methods to enable and query translucency effects in a deskband object. Retrieves a handle to one of the windows participating in in-place activation (frame, document, parent, or in-place object window). A pointer to a variable that receives the window handle. This method returns S_OK on success. Determines whether context-sensitive help mode should be entered during an in-place activation session. TRUE if help mode should be entered; FALSE if it should be exited. This method returns S_OK if the help mode was entered or exited successfully, depending on the value passed in fEnterMode. Instructs the docking window object to show or hide itself. TRUE if the docking window object should show its window. FALSE if the docking window object should hide its window and return its border space by calling SetBorderSpaceDW with zero values. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Notifies the docking window object that it is about to be removed from the frame. The docking window object should save any persistent information at this time. Reserved. This parameter should always be zero. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Notifies the docking window object that the frame's border space has changed. In response to this method, the IDockingWindow implementation must call SetBorderSpaceDW, even if no border space is required or a change is not necessary. Pointer to a RECT structure that contains the frame's available border space. Pointer to the site's IUnknown interface. The docking window object should call the QueryInterface method for this interface, requesting IID_IDockingWindowSite. The docking window object then uses that interface to negotiate its border space. It is the docking window object's responsibility to release this interface when it is no longer needed. Reserved. This parameter should always be zero. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets state information for a band object. The identifier of the band, assigned by the container. The band object can retain this value if it is required. The view mode of the band object. One of the following values: DBIF_VIEWMODE_NORMAL, DBIF_VIEWMODE_VERTICAL, DBIF_VIEWMODE_FLOATING, DBIF_VIEWMODE_TRANSPARENT. The pdbi. Indicates the deskband's ability to be displayed as translucent. When this method returns, contains a BOOL indicating ability. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the composition state. TRUE to enable the composition state; otherwise, FALSE. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets the composition state. When this method returns, contains a BOOL that indicates state. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Exposes methods that allow a client to retrieve the icon that is associated with one of the objects in a folder. Gets the location and index of an icon. One or more of the following values. This parameter can also be NULL. A pointer to a buffer that receives the icon location. The icon location is a null-terminated string that identifies the file that contains the icon. The size of the buffer, in characters, pointed to by pszIconFile. A pointer to an int that receives the index of the icon in the file pointed to by pszIconFile. A pointer to a UINT value that receives zero or a combination of the following value Extracts an icon image from the specified location. A pointer to a null-terminated string that specifies the icon location. The index of the icon in the file pointed to by pszFile. A pointer to an HICON value that receives the handle to the large icon. This parameter may be NULL. A pointer to an HICON value that receives the handle to the small icon. This parameter may be NULL. The desired size of the icon, in pixels. The low word contains the size of the large icon, and the high word contains the size of the small icon. The size specified can be the width or height. The width of an icon always equals its height. Returns S_OK if the function extracted the icon, or S_FALSE if the calling application should extract the icon. Exposes methods that allow a client to retrieve the icon that is associated with one of the objects in a folder. Gets the location and index of an icon. One or more of the following values. This parameter can also be NULL. A pointer to a buffer that receives the icon location. The icon location is a null-terminated string that identifies the file that contains the icon. The size of the buffer, in characters, pointed to by pszIconFile. A pointer to an int that receives the index of the icon in the file pointed to by pszIconFile. A pointer to a UINT value that receives zero or a combination of the following value Extracts an icon image from the specified location. A pointer to a null-terminated string that specifies the icon location. The index of the icon in the file pointed to by pszFile. A pointer to an HICON value that receives the handle to the large icon. This parameter may be NULL. A pointer to an HICON value that receives the handle to the small icon. This parameter may be NULL. The desired size of the icon, in pixels. The low word contains the size of the large icon, and the high word contains the size of the small icon. The size specified can be the width or height. The width of an icon always equals its height. Returns S_OK if the function extracted the icon, or S_FALSE if the calling application should extract the icon. Exposes methods that change UI activation and process accelerators for a user input object contained in the Shell. UI-activates or deactivates the object. Indicates if the object is being activated or deactivated. If this value is nonzero, the object is being activated. If this value is zero, the object is being deactivated. A pointer to an MSG structure that contains the message that caused the activation change. This value may be NULL. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Determines if one of the object's windows has the keyboard focus. Returns S_OK if one of the object's windows has the keyboard focus, or S_FALSE otherwise. Enables the object to process keyboard accelerators. The address of an MSG structure that contains the keyboard message that is being translated. Returns S_OK if the accelerator was translated, or S_FALSE otherwise. Informs the browser that the focus has changed. Informs the browser that the focus has changed. The address of the IUnknown interface of the object gaining or losing the focus. Indicates if the object has gained or lost the focus. If this value is nonzero, the object has gained the focus. If this value is zero, the object has lost the focus. Exposes methods that retrieve information about a folder's display options, select specified items in that folder, and set the folder's view mode. Gets an address containing a value representing the folder's current view mode. A pointer to a memory location at which to store the folder's current view mode. TODO: Use FOLDERVIEWMODE Sets the selected folder's view mode. One of the following values from the FOLDERVIEWMODE enumeration. TODO: Use FOLDERVIEWMODE Gets the folder object. Reference to the desired IID to represent the folder. When this method returns, contains the interface pointer requested in riid. This is typically IShellFolder or a related interface. This can also be an IShellItemArray with a single element. Gets the identifier of a specific item in the folder view, by index. The index of the item in the view. The address of a pointer to a PIDL containing the item's identifier information. Gets the number of items in the folder. This can be the number of all items, or a subset such as the number of selected items. Flags from the _SVGIO enumeration that limit the count to certain types of items. Pointer to an integer that receives the number of items (files and folders) displayed in the folder view. Gets the address of an enumeration object based on the collection of items in the folder view. _SVGIO values that limit the enumeration to certain types of items. Reference to the desired IID to represent the folder. When this method returns, contains the interface pointer requested in riid. This is typically an IEnumIDList, IDataObject, or IShellItemArray. If an error occurs, this value is NULL. Gets the index of an item in the folder's view which has been marked by using the SVSI_SELECTIONMARK in IFolderView::SelectItem. A pointer to the index of the marked item. Gets the index of the item that currently has focus in the folder's view. A pointer to the index of the item. Gets the position of an item in the folder's view. A pointer to an ITEMIDLIST interface. A pointer to a structure that receives the position of the item's upper-left corner. Gets a POINT structure containing the width (x) and height (y) dimensions, including the surrounding white space, of an item. A pointer to an existing structure to be filled with the current sizing dimensions of the items in the folder's view. Gets a pointer to a POINT structure containing the default width (x) and height (y) measurements of an item, including the surrounding white space. Pointer to an existing structure to be filled with the default sizing dimensions of the items in the folder's view. Gets the current state of the folder's Auto Arrange mode. Returns S_OK if the folder is in Auto Arrange mode; S_FALSE if it is not. Selects an item in the folder's view. The index of the item to select in the folder's view. One of the _SVSIF constants that specify the type of selection to apply. Allows the selection and positioning of items visible in the folder's view. The number of items to select. A pointer to an array of size cidl that contains the PIDLs of the items. A pointer to an array of cidl structures containing the locations each corresponding element in apidl should be positioned. One of the _SVSIF constants that specifies the type of selection to apply. Exposes methods that are used to persist item identifier lists. Retrieves the class identifier (CLSID) of the object. A pointer to the location that receives the CLSID on return. The CLSID is a globally unique identifier (GUID) that uniquely represents an object class that defines the code that can manipulate the object's data. If the method succeeds, the return value is S_OK. Otherwise, it is E_FAIL. Sets a persisted item identifier list. A pointer to the item identifier list to set. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets an item identifier list. The address of a pointer to the item identifier list to get. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Enables the saving and loading of objects that use a simple serial stream for their storage needs. Retrieves the class identifier (CLSID) of the object. A pointer to the location that receives the CLSID on return. The CLSID is a globally unique identifier (GUID) that uniquely represents an object class that defines the code that can manipulate the object's data. If the method succeeds, the return value is S_OK. Otherwise, it is E_FAIL. Determines whether this instance is dirty. Initializes an object from the stream where it was saved previously. An IStream pointer to the stream from which the object should be loaded. This method can return the following values. S_OK, E_OUTOFMEMORY, E_FAIL. Saves an object to the specified stream. An IStream pointer to the stream into which the object should be saved. Indicates whether to clear the dirty flag after the save is complete. If TRUE, the flag should be cleared. If FALSE, the flag should be left unchanged. This method can return the following values. S_OK, STG_E_CANTSAVE, STG_E_MEDIUMFULL. Retrieves the size of the stream needed to save the object. The size in bytes of the stream needed to save this object, in bytes. This method returns S_OK to indicate that the size was retrieved successfully. Specifies column format flags. Left aligned. Right aligned. Centered The column has an icon. Returned by the GetThemeMargins function to define the margins of windows that have visual styles applied. Width of left border that retains its size Width of right border that retains its size Height of top border that retains its size Height of bottom border that retains its size Informs the system of the dimensions of an owner-drawn control or menu item. This allows the system to process user interaction with the control correctly. The control type. This member can be one of the values shown in the following table. The identifier of the combo box or list box. This member is not used for a menu. The identifier for a menu item or the position of a list box or combo box item. This value is specified for a list box only if it has the LBS_OWNERDRAWVARIABLE style; this value is specified for a combo box only if it has the CBS_OWNERDRAWVARIABLE style. The width, in pixels, of a menu item. Before returning from the message, the owner of the owner-drawn menu item must fill this member. The height, in pixels, of an individual item in a list box or a menu. Before returning from the message, the owner of the owner-drawn combo box, list box, or menu item must fill out this member. The application-defined value associated with the menu item. For a control, this member specifies the value last assigned to the list box or combo box by the LB_SETITEMDATA or CB_SETITEMDATA message. If the list box or combo box has the LB_HASSTRINGS or CB_HASSTRINGS style, this value is initially zero. Otherwise, this value is initially the value passed to the list box or combo box in the lParam parameter of one of the following messages: Specifies the FMTID/PID identifier that programmatically identifies a property. Replaces . A unique GUID for the property. A property identifier (PID). This parameter is not used as in SHCOLUMNID. It is recommended that you set this value to PID_FIRST_USABLE. Any value greater than or equal to 2 is acceptable. Used with the SHCreateShellFolderViewEx function. The size of the CSFV structure, in bytes. A pointer to the IShellFolder object for which to create the view. A pointer to the parent IShellView interface. This parameter can be NULL. Ignored. A pointer to the LPFNVIEWCALLBACK function used by this folder view to handle callback messages. This parameter can be NULL. CSIDL (constant special item ID list) values provide a unique system-independent way to identify special folders used frequently by applications, but which may not have the same name or location on any given system. For example, the system folder may be "C:\Windows" on one system and "C:\Winnt" on another. These constants are defined in Shlobj.h. Used by an IEnumExtraSearch enumerator object to return information on the search objects supported by a Shell Folder object. A search object's GUID. A Unicode string containing the search object's friendly name. It will be used to identify the search engine on the Search Assistant menu. The URL that will be displayed in the search pane. File attributes are metadata values stored by the file system on disk and are used by the system and are available to developers via various file I/O APIs. For a list of related APIs and topics, see the See Also section. A file or directory that is an archive file or directory. Applications typically use this attribute to mark files for backup or removal. A file or directory that is compressed. For a file, all of the data in the file is compressed. For a directory, compression is the default for newly created files and subdirectories. This value is reserved for system use. The handle that identifies a directory. A file or directory that is encrypted. For a file, all data streams in the file are encrypted. For a directory, encryption is the default for newly created files and subdirectories. The file or directory is hidden. It is not included in an ordinary directory listing. The directory or user data stream is configured with integrity (only supported on ReFS volumes). It is not included in an ordinary directory listing. The integrity setting persists with the file if it's renamed. If a file is copied the destination file will have integrity set if either the source file or destination directory have integrity set. Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This flag is not supported until Windows Server 2012. A file that does not have other attributes set. This attribute is valid only when used alone. The file or directory is not to be indexed by the content indexing service. The user data stream not to be read by the background data integrity scanner (AKA scrubber). When set on a directory it only provides inheritance. This flag is only supported on Storage Spaces and ReFS volumes. It is not included in an ordinary directory listing. Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This flag is not supported until Windows 8 and Windows Server 2012. The data of a file is not available immediately. This attribute indicates that the file data is physically moved to offline storage. This attribute is used by Remote Storage, which is the hierarchical storage management software. Applications should not arbitrarily change this attribute. A file that is read-only. Applications can read the file, but cannot write to it or delete it. This attribute is not honored on directories. For more information, see You cannot view or change the Read-only or the System attributes of folders in Windows Server 2003, in Windows XP, in Windows Vista or in Windows 7. A file or directory that has an associated reparse point, or a file that is a symbolic link. A file that is a sparse file. A file or directory that the operating system uses a part of, or uses exclusively. A file that is being used for temporary storage. File systems avoid writing data back to mass storage if sufficient cache memory is available, because typically, an application deletes a temporary file after the handle is closed. In that scenario, the system can entirely avoid writing the data. Otherwise, the data is written after the handle is closed. This value is reserved for system use. A set of flags that specify folder view options. The flags are independent of each other and can be used in any combination. Windows 7 and later. No special view options. Automatically arrange the elements in the view. This implies LVS_AUTOARRANGE if the list-view control is used to implement the view. Not supported. Not supported. Not supported. Not supported. Make the folder behave like the desktop. This value applies only to the desktop and is not used for typical Shell folders. This flag implies FWF_NOCLIENTEDGE and FWF_NOSCROLL. Do not allow more than a single item to be selected. This is used in the common dialog boxes. Do not show subfolders. Draw transparently. This is used only for the desktop. Not supported. Do not add scroll bars. This is used only for the desktop. The view should be left-aligned. This implies LVS_ALIGNLEFT if the list-view control is used to implement the view. The view should not display icons. This flag is deprecated as of Windows XP and has no effect. Always show the selection. Not supported. Not supported. The view should not be shown as a web view. The view should not display file names. Turns on the check mode for the view. Windows Vista and later. Do not re-enumerate the view (or drop the current contents of the view) when the view is refreshed. Windows Vista and later. Do not allow grouping in the view Windows Vista and later. When an item is selected, the item and all its sub-items are highlighted. Windows Vista and later. Do not display filters in the view. Windows Vista and later. Do not display a column header in the view in any view mode. Windows Vista and later. Only show the column header in details view mode. Windows Vista and later. When the view is in "tile view mode" the layout of a single item should be extended to the width of the view. Windows Vista and later. Not supported. Windows Vista and later. Items can be selected using checkboxes. Windows Vista and later. The view should not save view state in the browser. Windows Vista and later. The view should list the number of items displayed in each group. To be used with IFolderView2::SetGroupSubsetCount. Windows Vista and later. Use the search folder for stacking and searching. Windows Vista and later. Ensure right-to-left reading layout in a right-to-left system. Without this flag, the view displays strings from left-to-right both on systems set to left-to-right and right-to-left reading layout, which ensures that file names display correctly. Contains folder view information. Folder view mode. One of the FOLDERVIEWMODE values. A set of flags that indicate the options for the folder. This can be zero or a combination of the FOLDERFLAGS values. Specifies the folder view type. The view should determine the best option. The minimum constant value in FOLDERVIEWMODE, for validation purposes. The view should display medium-size icons. The view should display small icons. Object names are displayed in a list view. Object names and other selected information, such as the size or date last updated, are shown. The view should display thumbnail icons. The view should display large icons. The view should display icons in a filmstrip format. Windows 7 and later. The view should display content mode. The maximum constant value in FOLDERVIEWMODE, for validation purposes. Font charset values. The ANSI CHARSET The DEFAULT CHARSET The SYMBOL CHARSET The SHIFTJIS_ CHARSET The HANGEUL CHARSET The HANGUL CHARSET The G B2312 CHARSET The CHINESEBIG5 CHARSET The OEM CHARSET The JOHAB_CHARSET The HEBREW_CHARSET The ARABIC_CHARSET The GREEK_CHARSET The TURKISH_CHARSET The VIETNAMESE_CHARSET The THAI_CHARSET The EASTEUROPE_CHARSET The RUSSIAN_CHARSET The MAC_CHARSET The BALTIC_CHARSET The clipping precision. The clipping precision defines how to clip characters that are partially outside the clipping region. It can be one or more of the following values. Specifies default clipping behavior. Not used. Not used by the font mapper, but is returned when raster, vector, or TrueType fonts are enumerated. For compatibility, this value is always returned when enumerating fonts. Not used. When this value is used, the rotation for all fonts depends on whether the orientation of the coordinate system is left-handed or right-handed. If not used, device fonts always rotate counterclockwise, but the rotation of other fonts is dependent on the orientation of the coordinate system. For more information about the orientation of coordinate systems, see the description of the nOrientation parameter Not used. Windows XP SP1: Turns off font association for the font. Note that this flag is not guaranteed to have any effect on any platform after Windows Server 2003. You must specify this flag to use an embedded read-only font. The pitch and family of the font. The two low-order bits specify the pitch of the font, the four high-order bits specify the font family. The default pitch. The fixed pitch. The variable pitch. Use default font. Fonts with variable stroke width and with serifs. MS Serif is an example. Fonts with variable stroke width and without serifs. MS?Sans Serif is an example. Fonts with constant stroke width, with or without serifs. Pica, Elite, and Courier New are examples. Fonts designed to look like handwriting. Script and Cursive are examples. Novelty fonts. Old English is an example. The output precision. The output precision defines how closely the output must match the requested font's height, width, character orientation, escapement, pitch, and font type. It can be one of the following values. The default font mapper behavior. This value is not used by the font mapper, but it is returned when raster fonts are enumerated. Not used. This value is not used by the font mapper, but it is returned when TrueType, other outline-based fonts, and vector fonts are enumerated. Instructs the font mapper to choose a TrueType font when the system contains multiple fonts with the same name. Instructs the font mapper to choose a Device font when the system contains multiple fonts with the same name. Instructs the font mapper to choose a raster font when the system contains multiple fonts with the same name. Instructs the font mapper to choose from only TrueType fonts. If there are no TrueType fonts installed in the system, the font mapper returns to default behavior. This value instructs the font mapper to choose from TrueType and other outline-based fonts. A value that specifies a preference for TrueType and other outline fonts. Instructs the font mapper to choose from only PostScript fonts. If there are no PostScript fonts installed in the system, the font mapper returns to default behavior. The output quality. The output quality defines how carefully GDI must attempt to match the logical-font attributes to those of an actual physical font. It can be one of the following values. Appearance of the font does not matter. Appearance of the font is less important than when the PROOF_QUALITY value is used. For GDI raster fonts, scaling is enabled, which means that more font sizes are available, but the quality may be lower. Bold, italic, underline, and strikeout fonts are synthesized, if necessary. Character quality of the font is more important than exact matching of the logical-font attributes. For GDI raster fonts, scaling is disabled and the font closest in size is chosen. Although the chosen font size may not be mapped exactly when PROOF_QUALITY is used, the quality of the font is high and there is no distortion of appearance. Bold, italic, underline, and strikeout fonts are synthesized, if necessary. Font is never antialiased, that is, font smoothing is not done. Font is antialiased, or smoothed, if the font supports it and the size of the font is not too small or too large. If set, text is rendered (when possible) using ClearType antialiasing method. See Remarks for more information. The cleartype natural quality value. The Font Weight values. The FW_DONTCARE The FW_THIN The FW_EXTRALIGHT The FW_LIGHT The FW_NORMAL The FW_MEDIUM The FW_SEMIBOLD The FW_BOLD The FW_EXTRABOLD The FW_HEAVY Exposes methods that either create or merge a shortcut (context) menu associated with a Shell object. Extends IContextMenu by adding a method that allows client objects to handle messages associated with owner-drawn menu items. Adds commands to a shortcut menu. A handle to the shortcut menu. The handler should specify this handle when adding menu items. The zero-based position at which to insert the first new menu item. The minimum value that the handler can specify for a menu item identifier. The maximum value that the handler can specify for a menu item identifier. Optional flags that specify how the shortcut menu can be changed. This parameter can be set to a combination of the following values. The remaining bits of the low-order word are reserved by the system. The high-order word can be used for context-specific communications. The CMF_RESERVED value can be used to mask the low-order word. If successful, returns an HRESULT value that has its severity value set to SEVERITY_SUCCESS and its code value set to the offset of the largest command identifier that was assigned, plus one. For example, if idCmdFirst is set to 5 and you add three items to the menu with command identifiers of 5, 7, and 8, the return value should be MAKE_HRESULT(SEVERITY_SUCCESS, 0, 8 - 5 + 1). Otherwise, it returns a COM error value. Carries out the command associated with a shortcut menu item. A pointer to a CMINVOKECOMMANDINFO or CMINVOKECOMMANDINFOEX structure containing information about the command. For further details, see the Remarks section. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets information about a shortcut menu command, including the help string and the language-independent, or canonical, name for the command. Menu command identifier offset. Flags specifying the information to return. This parameter can have one of the following values. Reserved. Applications must specify NULL when calling this method and handlers must ignore this parameter when called. The address of the buffer to receive the null-terminated string being retrieved. Size of the buffer, in characters, to receive the null-terminated string. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Enables client objects of the IContextMenu interface to handle messages associated with owner-drawn menu items. The message to be processed. In the case of some messages, such as WM_INITMENUPOPUP, WM_DRAWITEM, WM_MENUCHAR, or WM_MEASUREITEM, the client object being called may provide owner-drawn menu items. Additional message information. The value of this parameter depends on the value of the uMsg parameter. Additional message information. The value of this parameter depends on the value of the uMsg parameter. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Exposes methods that either create or merge a shortcut menu associated with a Shell object. Allows client objects to handle messages associated with owner-drawn menu items and extends IContextMenu2 by accepting a return value from that message handling. Adds commands to a shortcut menu. A handle to the shortcut menu. The handler should specify this handle when adding menu items. The zero-based position at which to insert the first new menu item. The minimum value that the handler can specify for a menu item identifier. The maximum value that the handler can specify for a menu item identifier. Optional flags that specify how the shortcut menu can be changed. This parameter can be set to a combination of the following values. The remaining bits of the low-order word are reserved by the system. The high-order word can be used for context-specific communications. The CMF_RESERVED value can be used to mask the low-order word. If successful, returns an HRESULT value that has its severity value set to SEVERITY_SUCCESS and its code value set to the offset of the largest command identifier that was assigned, plus one. For example, if idCmdFirst is set to 5 and you add three items to the menu with command identifiers of 5, 7, and 8, the return value should be MAKE_HRESULT(SEVERITY_SUCCESS, 0, 8 - 5 + 1). Otherwise, it returns a COM error value. Carries out the command associated with a shortcut menu item. A pointer to a CMINVOKECOMMANDINFO or CMINVOKECOMMANDINFOEX structure containing information about the command. For further details, see the Remarks section. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets information about a shortcut menu command, including the help string and the language-independent, or canonical, name for the command. Menu command identifier offset. Flags specifying the information to return. This parameter can have one of the following values. Reserved. Applications must specify NULL when calling this method and handlers must ignore this parameter when called. The address of the buffer to receive the null-terminated string being retrieved. Size of the buffer, in characters, to receive the null-terminated string. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Enables client objects of the IContextMenu interface to handle messages associated with owner-drawn menu items. The message to be processed. In the case of some messages, such as WM_INITMENUPOPUP, WM_DRAWITEM, WM_MENUCHAR, or WM_MEASUREITEM, the client object being called may provide owner-drawn menu items. Additional message information. The value of this parameter depends on the value of the uMsg parameter. Additional message information. The value of this parameter depends on the value of the uMsg parameter. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Allows client objects of the IContextMenu3 interface to handle messages associated with owner-drawn menu items. The message to be processed. In the case of some messages, such as WM_INITMENUPOPUP, WM_DRAWITEM, WM_MENUCHAR, or WM_MEASUREITEM, the client object being called may provide owner-drawn menu items. Additional message information. The value of this parameter depends on the value of the uMsg parameter. Additional message information. The value of this parameter depends on the value of the uMsg parameter. The address of an LRESULT value that the owner of the menu will return from the message. This parameter can be NULL. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Exposes methods that notify the docking window object of changes, including showing, hiding, and impending removal. This interface is implemented by window objects that can be docked within the border space of a Windows Explorer window. Instructs the docking window object to show or hide itself. TRUE if the docking window object should show its window. FALSE if the docking window object should hide its window and return its border space by calling SetBorderSpaceDW with zero values. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Notifies the docking window object that it is about to be removed from the frame. The docking window object should save any persistent information at this time. Reserved. This parameter should always be zero. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Notifies the docking window object that the frame's border space has changed. In response to this method, the IDockingWindow implementation must call SetBorderSpaceDW, even if no border space is required or a change is not necessary. Pointer to a RECT structure that contains the frame's available border space. Pointer to the site's IUnknown interface. The docking window object should call the QueryInterface method for this interface, requesting IID_IDockingWindowSite. The docking window object then uses that interface to negotiate its border space. It is the docking window object's responsibility to release this interface when it is no longer needed. Reserved. This parameter should always be zero. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. The IDropTarget interface is one of the interfaces you implement to provide drag-and-drop operations in your application. It contains methods used in any application that can be a target for data during a drag-and-drop operation. Indicates whether a drop can be accepted, and, if so, the effect of the drop. A pointer to the IDataObject interface on the data object. This data object contains the data being transferred in the drag-and-drop operation. If the drop occurs, this data object will be incorporated into the target. The current state of the keyboard modifier keys on the keyboard. Possible values can be a combination of any of the flags MK_CONTROL, MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON, MK_MBUTTON, and MK_RBUTTON. A POINTL structure containing the current cursor coordinates in screen coordinates. On input, pointer to the value of the pdwEffect parameter of the DoDragDrop function. On return, must contain one of the DROPEFFECT flags, which indicates what the result of the drop operation would be. This method returns S_OK on success. Provides target feedback to the user and communicates the drop's effect to the DoDragDrop function so it can communicate the effect of the drop back to the source. The current state of the keyboard modifier keys on the keyboard. Valid values can be a combination of any of the flags MK_CONTROL, MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON, MK_MBUTTON, and MK_RBUTTON. A POINTL structure containing the current cursor coordinates in screen coordinates. On input, pointer to the value of the pdwEffect parameter of the DoDragDrop function. On return, must contain one of the DROPEFFECT flags, which indicates what the result of the drop operation would be. This method returns S_OK on success. Removes target feedback and releases the data object. This method returns S_OK on success. Incorporates the source data into the target window, removes target feedback, and releases the data object. A pointer to the IDataObject interface on the data object being transferred in the drag-and-drop operation. The current state of the keyboard modifier keys on the keyboard. Possible values can be a combination of any of the flags MK_CONTROL, MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON, MK_MBUTTON, and MK_RBUTTON. A POINTL structure containing the current cursor coordinates in screen coordinates. On input, pointer to the value of the pdwEffect parameter of the DoDragDrop function. On return, must contain one of the DROPEFFECT flags, which indicates what the result of the drop operation would be. This method returns S_OK on success. A standard OLE enumerator used by a client to determine the available search objects for a folder. Used to request information on one or more search objects. The number of search objects to be enumerated, starting from the current object. If celt is too large, the method should stop and return the actual number of search objects in pceltFetched. A pointer to an array of pceltFetched EXTRASEARCH structures containing information on the enumerated objects. The number of objects actually enumerated. This may be less than celt. Returns S_OK if successful, or a COM-defined error code otherwise. Skip a specified number of objects. The number of objects to skip. Returns S_OK if successful, or a COM-defined error code otherwise. Used to reset the enumeration index to zero. Returns S_OK if successful, or a COM-defined error code otherwise. Used to request a duplicate of the enumerator object to preserve its current state. A pointer to the IEnumExtraSearch interface of a new enumerator object. Returns S_OK if successful, or a COM-defined error code otherwise. Exposes a standard set of methods used to enumerate the pointers to item identifier lists (PIDLs) of the items in a Shell folder. Retrieves the specified number of item identifiers in the enumeration sequence and advances the current position by the number of items retrieved. Number of elements in the array pointed to by the rgelt parameter. Address of an array of ITEMIDLIST pointers that receives the item identifiers. The implementation must allocate these item identifiers using the Shell's allocator (retrieved by the SHGetMalloc function). The calling application is responsible for freeing the item identifiers using the Shell's allocator. Address of a value that receives a count of the item identifiers actually returned in rgelt. The count can be smaller than the value specified in the celt parameter. This parameter can be NULL only if celt is one. Skips over the specified number of elements in the enumeration sequence. Number of item identifiers to skip. Returns to the beginning of the enumeration sequence. Creates a new item enumeration object with the same contents and state as the current one. Address of a pointer to the new enumeration object. The calling application must eventually free the new object by calling its Release member function. Exposes methods that manipulate and interact with image lists. Adds an image or images to an image list. A handle to the bitmap that contains the image or images. The number of images is inferred from the width of the bitmap. A handle to the bitmap that contains the mask. If no mask is used with the image list, this parameter is ignored. When this method returns, contains a pointer to the index of the first new image. If the method fails to successfully add the new image, this value is -1. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Replaces an image with an icon or cursor. A value of type int that contains the index of the image to replace. If i is -1, the function adds the image to the end of the list. A handle to the icon or cursor that contains the bitmap and mask for the new image. A pointer to an int that will contain the index of the image on return if successful, or -1 otherwise. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Adds a specified image to the list of images used as overlay masks. An image list can have up to four overlay masks in Common Controls version 4.70 and earlier, and up to 15 in version 4.71 or later. The method assigns an overlay mask index to the specified image. A value of type int that contains the zero-based index of an image in the image list. This index identifies the image to use as an overlay mask. A value of type int that contains the one-based index of the overlay mask. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Replaces an image in an image list with a new image. A value of type int that contains the index of the image to replace. A handle to the bitmap that contains the image. A handle to the bitmap that contains the mask. If no mask is used with the image list, this parameter is ignored. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Adds an image or images to an image list, generating a mask from the specified bitmap. A handle to the bitmap that contains one or more images. The number of images is inferred from the width of the bitmap. The color used to generate the mask. Each pixel of this color in the specified bitmap is changed to black, and the corresponding bit in the mask is set to 1. A pointer to an int that contains the index of the first new image when it returns, if successful, or -1 otherwise. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Draws an image list item in the specified device context. A pointer to an IMAGELISTDRAWPARAMS structure that contains the drawing parameters. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Removes an image from an image list. A value of type int that contains the index of the image to remove. If this parameter is -1, the method removes all images. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Creates an icon from an image and a mask in an image list. A value of type int that contains the index of the image. A combination of flags that specify the drawing style. For a list of values, see IImageList::Draw. A pointer to an int that contains the handle to the icon if successful, or NULL if otherwise. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets information about an image. A value of type int that contains the index of the image. A pointer to an IMAGEINFO structure that receives information about the image. The information in this structure can directly manipulate the bitmaps of the image. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Copies images from a given image list. A value of type int that contains the zero-based index of the destination image for the copy operation. A pointer to the IUnknown interface for the source image list. A value of type int that contains the zero-based index of the source image for the copy operation. A value that specifies the type of copy operation to be made. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Creates a new image by combining two existing images. This method also creates a new image list in which to store the image. A value of type int that contains the index of the first existing image. A pointer to the IUnknown interface of the image list that contains the second image. A value of type int that contains the index of the second existing image. A value of type int that contains the x-component of the offset of the second image relative to the first image. A value of type int that contains the y-component of the offset of the second image relative to the first image. An IID of the interface for the new image list. A raw pointer to the interface for the new image list. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Clones an existing image list. An IID for the new image list. The address of a pointer to the interface for the new image list. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets an image's bounding rectangle. A value of type int that contains the index of the image. A pointer to a RECT that contains the bounding rectangle when the method returns. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets the dimensions of images in an image list. All images in an image list have the same dimensions. A pointer to an int that receives the width, in pixels, of each image. A pointer to an int that receives the height, in pixels, of each image. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the dimensions of images in an image list and removes all images from the list. A value of type int that contains the width, in pixels, of the images in the image list. All images in an image list have the same dimensions. A value of type int that contains the height, in pixels, of the images in the image list. All images in an image list have the same dimensions. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets the number of images in an image list. A pointer to an int that contains the number of images when the method returns. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Resizes an existing image list. A value that specifies the new size of the image list. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the background color for an image list. This method only functions if you add an icon to the image list or use the IImageList::AddMasked method to add a black and white bitmap. Without a mask, the entire image draws, and the background color is not visible. The background color to set. If this parameter is set to CLR_NONE, then images draw transparently using the mask. A pointer to a COLORREF that contains the previous background color on return if successful, or CLR_NONE otherwise. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets the current background color for an image list. A pointer to a COLORREF that contains the background color when the method returns. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Begins dragging an image. A value of type int that contains the index of the image to drag. A value of type int that contains the x-component of the drag position relative to the upper-left corner of the image. A value of type int that contains the y-component of the drag position relative to the upper-left corner of the image. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Ends a drag operation. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Locks updates to the specified window during a drag operation and displays the drag image at the specified position within the window. A handle to the window that owns the drag image. The x-coordinate at which to display the drag image. The coordinate is relative to the upper-left corner of the window, not the client area. The y-coordinate at which to display the drag image. The coordinate is relative to the upper-left corner of the window, not the client area. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Unlocks the specified window and hides the drag image, which enables the window to update. A handle to the window that contains the drag image. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Moves the image that is being dragged during a drag-and-drop operation. This function is typically called in response to a WM_MOUSEMOVE message. A value of type int that contains the x-coordinate where the drag image appears. The coordinate is relative to the upper-left corner of the window, not the client area. A value of type int that contains the y-coordinate where the drag image appears. The coordinate is relative to the upper-left corner of the window, not the client area. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Creates a new drag image by combining the specified image, which is typically a mouse cursor image, with the current drag image. A pointer to the IUnknown interface that accesses the image list interface, which contains the new image to combine with the drag image. A value of type int that contains the index of the new image to combine with the drag image. A value of type int that contains the x-component of the hot spot within the new image. A value of type int that contains the x-component of the hot spot within the new image. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Shows or hides the image being dragged. A value that specifies whether to show or hide the image being dragged. Specify TRUE to show the image or FALSE to hide the image. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets the temporary image list that is used for the drag image. The function also retrieves the current drag position and the offset of the drag image relative to the drag position. A pointer to a POINT structure that receives the current drag position. Can be NULL. A pointer to a POINT structure that receives the offset of the drag image relative to the drag position. Can be NULL. An IID for the image list. The address of a pointer to the interface for the image list if successful, NULL otherwise. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets the flags of an image. A value of type int that contains the index of the images whose flags need to be retrieved. A pointer to a DWORD that contains the flags when the method returns. One of the following values: If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves a specified image from the list of images used as overlay masks. A value of type int that contains the one-based index of the overlay mask. A pointer to an int that receives the zero-based index of an image in the image list. This index identifies the image that is used as an overlay mask. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Provides a simple way to support communication between an object and its site in the container. Enables a container to pass an object a pointer to the interface for its site. A pointer to the IUnknown interface pointer of the site managing this object. If NULL, the object should call Release on any existing site at which point the object no longer knows its site. This method returns S_OK on success. Retrieves the latest site passed using SetSite. The IID of the interface pointer that should be returned in ppvSite. Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppvSite contains the requested interface pointer to the site last seen in SetSite. The specific interface returned depends on the riid argument—in essence, the two arguments act identically to those in QueryInterface. If the appropriate interface pointer is available, the object must call AddRef on that pointer before returning successfully. If no site is available, or the requested interface is not supported, this method must *ppvSite to NULL and return a failure code. This method returns S_OK on success. The IOleWindow interface provides methods that allow an application to obtain the handle to the various windows that participate in in-place activation, and also to enter and exit context-sensitive help mode. Retrieves a handle to one of the windows participating in in-place activation (frame, document, parent, or in-place object window). A pointer to a variable that receives the window handle. This method returns S_OK on success. Determines whether context-sensitive help mode should be entered during an in-place activation session. TRUE if help mode should be entered; FALSE if it should be exited. This method returns S_OK if the help mode was entered or exited successfully, depending on the value passed in fEnterMode. Provides the CLSID of an object that can be stored persistently in the system. Allows the object to specify which object handler to use in the client process, as it is used in the default implementation of marshaling. Retrieves the class identifier (CLSID) of the object. A pointer to the location that receives the CLSID on return. The CLSID is a globally unique identifier (GUID) that uniquely represents an object class that defines the code that can manipulate the object's data. If the method succeeds, the return value is S_OK. Otherwise, it is E_FAIL. Exposes a method that initializes Shell folder objects. Retrieves the class identifier (CLSID) of the object. A pointer to the location that receives the CLSID on return. The CLSID is a globally unique identifier (GUID) that uniquely represents an object class that defines the code that can manipulate the object's data. If the method succeeds, the return value is S_OK. Otherwise, it is E_FAIL. Instructs a Shell folder object to initialize itself based on the information passed. The address of the ITEMIDLIST (item identifier list) structure that specifies the absolute location of the folder. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Exposes methods that obtain information from Shell folder objects. Retrieves the class identifier (CLSID) of the object. A pointer to the location that receives the CLSID on return. The CLSID is a globally unique identifier (GUID) that uniquely represents an object class that defines the code that can manipulate the object's data. If the method succeeds, the return value is S_OK. Otherwise, it is E_FAIL. Instructs a Shell folder object to initialize itself based on the information passed. The address of the ITEMIDLIST (item identifier list) structure that specifies the absolute location of the folder. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets the ITEMIDLIST for the folder object. The address of an ITEMIDLIST pointer. This PIDL represents the absolute location of the folder and must be relative to the desktop. This is typically a copy of the PIDL passed to Initialize. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. If the folder object has not been initialized, this method returns S_FALSE and ppidl is set to NULL. Exposes methods for the display of rich previews. Sets the parent window of the previewer window, as well as the area within the parent to be used for the previewer window. A handle to the parent window. A pointer to a RECT defining the area for the previewer. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Directs the preview handler to change the area within the parent hwnd that it draws into. A pointer to a RECT to be used for the preview. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Directs the preview handler to load data from the source specified in an earlier Initialize method call, and to begin rendering to the previewer window. This method can return one of these values. Directs the preview handler to cease rendering a preview and to release all resources that have been allocated based on the item passed in during the initialization. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Directs the preview handler to set focus to itself. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Directs the preview handler to return the HWND from calling the GetFocus Function. When this method returns, contains a pointer to the HWND returned from calling the GetFocus Function from the preview handler's foreground thread. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Directs the preview handler to handle a keystroke passed up from the message pump of the process in which the preview handler is running. A pointer to a window message. If the keystroke message can be processed by the preview handler, the handler will process it and return S_OK. If the preview handler cannot process the keystroke message, it will offer it to the host using TranslateAccelerator. If the host processes the message, this method will return S_OK. If the host does not process the message, this method will return S_FALSE. Enables preview handlers to pass keyboard shortcuts to the host. This interface retrieves a list of keyboard shortcuts and directs the host to handle a keyboard shortcut. Gets a list of the keyboard shortcuts for the preview host. A pointer to a PREVIEWHANDLERFRAMEINFO structure that receives accelerator table information. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Directs the host to handle an keyboard shortcut passed from the preview handler. A pointer to a WM_COMMAND or WM_SYSCOMMAND window message that corresponds to a keyboard shortcut. If the keyboard shortcut is one that the host intends to handle, the host will process it and return S_OK; otherwise, it returns S_FALSE. Exposes methods for applying color and font information to preview handlers. Sets the background color of the preview handler. A value of type COLORREF to use for the preview handler background. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the font attributes to be used for text within the preview handler. A pointer to a LOGFONTW Structure containing the necessary attributes for the font to use. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the color of the text within the preview handler. A value of type COLORREF to use for the preview handler text color. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error cod Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects. Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects. The unique identifier of the service (an SID). The unique identifier of the interface that the caller wants to receive for the service. The address of the caller-allocated variable to receive the interface pointer of the service on successful return from this function. The caller becomes responsible for calling Release through this interface pointer when the service is no longer required. Returns one of the following values. Implemented by hosts of Shell views (objects that implement IShellView). Exposes methods that provide services for the view it is hosting and other objects that run in the context of the Explorer window. Retrieves a handle to one of the windows participating in in-place activation (frame, document, parent, or in-place object window). A pointer to a variable that receives the window handle. This method returns S_OK on success. Determines whether context-sensitive help mode should be entered during an in-place activation session. TRUE if help mode should be entered; FALSE if it should be exited. This method returns S_OK if the help mode was entered or exited successfully, depending on the value passed in fEnterMode. Allows the container to insert its menu groups into the composite menu that is displayed when an extended namespace is being viewed or used. A handle to an empty menu. The address of an OLEMENUGROUPWIDTHS array of six LONG values. The container fills in elements 0, 2, and 4 to reflect the number of menu elements it provided in the File, View, and Window menu groups. Returns S_OK if successful, or a COM-defined error value otherwise. Installs the composite menu in the view window. A handle to the composite menu constructed by calls to IShellBrowser::InsertMenusSB and the InsertMenu function. The view's window handle. Returns S_OK if successful, or a COM-defined error value otherwise. Permits the container to remove any of its menu elements from the in-place composite menu and to free all associated resources. A handle to the in-place composite menu that was constructed by calls to IShellBrowser::InsertMenusSB and the InsertMenu function. Returns S_OK if successful, or a COM-defined error value otherwise. Sets and displays status text about the in-place object in the container's frame-window status bar. A pointer to a null-terminated character string that contains the message to display. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Tells Windows Explorer to enable or disable its modeless dialog boxes. Specifies whether the modeless dialog boxes are to be enabled or disabled. If this parameter is nonzero, modeless dialog boxes are enabled. If this parameter is zero, modeless dialog boxes are disabled. Returns S_OK if successful, or a COM-defined error value otherwise. Translates accelerator keystrokes intended for the browser's frame while the view is active. The address of an MSG structure containing the keystroke message. The command identifier value corresponding to the keystroke in the container-provided accelerator table. Containers should use this value instead of translating again. Returns S_OK if successful, or a COM-defined error value otherwise. Informs Windows Explorer to browse to another folder. The address of an ITEMIDLIST (item identifier list) structure that specifies an object's location. This value is dependent on the flag or flags set in the wFlags parameter. Flags specifying the folder to be browsed. It can be zero or one or more of the following values. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets an IStream interface that can be used for storage of view-specific state information. Read/write access of the IStream interface. This may be one of the following values. The address that receives the IStream interface pointer. Returns S_OK if successful, or a COM-defined error value otherwise. Gets the window handle to a browser control. The control handle that is being requested. This parameter can be one of the following values: The address of the window handle to the Windows Explorer control. Returns S_OK if successful, or a COM-defined error value otherwise. Sends control messages to either the toolbar or the status bar in a Windows Explorer window. An identifier for either a toolbar (FCW_TOOLBAR) or for a status bar window (FCW_STATUS). The message to be sent to the control. The value depends on the message specified in the uMsg parameter. The value depends on the message specified in the uMsg parameter. The address of the return value of the SendMessage function. Returns S_OK if successful, or a COM-defined error value otherwise. Retrieves the currently active (displayed) Shell view object. The address of the pointer to the currently active Shell view object. Returns S_OK if successful, or a COM-defined error value otherwise. Called by the Shell view when the view window or one of its child windows gets the focus or becomes active. Address of the view object's IShellView pointer. Returns S_OK if successful, or a COM-defined error value otherwise. Adds toolbar items to Windows Explorer's toolbar. The address of an array of TBBUTTON structures. The number of TBBUTTON structures in the lpButtons array. Flags specifying where the toolbar buttons should go. This parameter can be one or more of the following values. Returns S_OK if successful, or a COM-defined error value otherwise. Exposed by Shell folders to provide detailed information about the items in a folder. This is the same information that is displayed by the Windows Explorer when the view of the folder is set to Details. For Windows 2000 and later systems, IShellDetails is superseded by IShellFolder2. Gets detailed information on an item in a Shell folder. The PIDL of the item that you are requesting information for. If this parameter is set to NULL, the title of the information field specified by iColumn will be returned in the SHELLDETAILS structure pointed to by pDetails. The zero-based index of the desired information field. It is identical to column number of the information as it is displayed in a Windows Explorer Details view. A pointer to a SHELLDETAILS structure with the detail information. Returns S_OK if successful. Returns E_FAIL if iColumn exceeds the number of columns supported by the folder. Otherwise, returns a standard COM error code. Rearranges a column. The index of the column to be rearranged. Returns S_FALSE to tell the calling application to sort the selected column. Otherwise, returns S_OK if successful, a COM error code otherwise. Exposed by all Shell namespace folder objects, its methods are used to manage folders. Translates the display name of a file object or a folder into an item identifier list. A window handle. The client should provide a window handle if it displays a dialog or message box. Otherwise set hwnd to NULL. Optional. A pointer to a bind context used to pass parameters as inputs and outputs to the parsing function. A null-terminated Unicode string with the display name. A pointer to a ULONG value that receives the number of characters of the display name that was parsed. If your application does not need this information, set pchEaten to NULL, and no value will be returned. When this method returns, contains a pointer to the PIDL for the object. The value used to query for file attributes. If not used, it should be set to NULL. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Allows a client to determine the contents of a folder by creating an item identifier enumeration object and returning its IEnumIDList interface. Return value: error code, if any If user input is required to perform the enumeration, this window handle should be used by the enumeration object as the parent window to take user input. Flags indicating which items to include in the enumeration. For a list of possible values, see the SHCONTF enum. Address that receives a pointer to the IEnumIDList interface of the enumeration object created by this method. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves an IShellFolder object for a subfolder. Return value: error code, if any Address of an ITEMIDLIST structure (PIDL) that identifies the subfolder. Optional address of an IBindCtx interface on a bind context object to be used during this operation. Identifier of the interface to return. Address that receives the interface pointer. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Requests a pointer to an object's storage interface. Return value: error code, if any Address of an ITEMIDLIST structure that identifies the subfolder relative to its parent folder. Optional address of an IBindCtx interface on a bind context object to be used during this operation. Interface identifier (IID) of the requested storage interface. Address that receives the interface pointer specified by riid. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Determines the relative order of two file objects or folders, given their item identifier lists. Return value: If this method is successful, the CODE field of the HRESULT contains one of the following values (the code can be retrived using the helper function GetHResultCode): Negative A negative return value indicates that the first item should precede the second (pidl1 < pidl2). Positive A positive return value indicates that the first item should follow the second (pidl1 > pidl2). Zero A return value of zero indicates that the two items are the same (pidl1 = pidl2). Value that specifies how the comparison should be performed. The lower Sixteen bits of lParam define the sorting rule. The upper sixteen bits of lParam are used for flags that modify the sorting rule. values can be from the SHCIDS enum Pointer to the first item's ITEMIDLIST structure. Pointer to the second item's ITEMIDLIST structure. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Requests an object that can be used to obtain information from or interact with a folder object. Return value: error code, if any Handle to the owner window. Identifier of the requested interface. Address of a pointer to the requested interface. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves the attributes of one or more file objects or subfolders. Return value: error code, if any Number of file objects from which to retrieve attributes. Address of an array of pointers to ITEMIDLIST structures, each of which uniquely identifies a file object relative to the parent folder. Address of a single ULONG value that, on entry contains the attributes that the caller is requesting. On exit, this value contains the requested attributes that are common to all of the specified objects. this value can be from the SFGAO enum If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves an OLE interface that can be used to carry out actions on the specified file objects or folders. Return value: error code, if any Handle to the owner window that the client should specify if it displays a dialog box or message box. Number of file objects or subfolders specified in the apidl parameter. Address of an array of pointers to ITEMIDLIST structures, each of which uniquely identifies a file object or subfolder relative to the parent folder. Identifier of the COM interface object to return. Reserved. Pointer to the requested interface. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves the display name for the specified file object or subfolder. Return value: error code, if any Address of an ITEMIDLIST structure (PIDL) that uniquely identifies the file object or subfolder relative to the parent folder. Flags used to request the type of display name to return. For a list of possible values. Address of a STRRET structure in which to return the display name. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the display name of a file object or subfolder, changing the item identifier in the process. Return value: error code, if any Handle to the owner window of any dialog or message boxes that the client displays. Pointer to an ITEMIDLIST structure that uniquely identifies the file object or subfolder relative to the parent folder. Pointer to a null-terminated string that specifies the new display name. Flags indicating the type of name specified by the lpszName parameter. For a list of possible values, see the description of the SHGNO enum. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Extends the capabilities of IShellFolder. Its methods provide a variety of information about the contents of a Shell folder. Translates the display name of a file object or a folder into an item identifier list. A window handle. The client should provide a window handle if it displays a dialog or message box. Otherwise set hwnd to NULL. Optional. A pointer to a bind context used to pass parameters as inputs and outputs to the parsing function. A null-terminated Unicode string with the display name. A pointer to a ULONG value that receives the number of characters of the display name that was parsed. If your application does not need this information, set pchEaten to NULL, and no value will be returned. When this method returns, contains a pointer to the PIDL for the object. The value used to query for file attributes. If not used, it should be set to NULL. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Allows a client to determine the contents of a folder by creating an item identifier enumeration object and returning its IEnumIDList interface. Return value: error code, if any If user input is required to perform the enumeration, this window handle should be used by the enumeration object as the parent window to take user input. Flags indicating which items to include in the enumeration. For a list of possible values, see the SHCONTF enum. Address that receives a pointer to the IEnumIDList interface of the enumeration object created by this method. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves an IShellFolder object for a subfolder. Return value: error code, if any Address of an ITEMIDLIST structure (PIDL) that identifies the subfolder. Optional address of an IBindCtx interface on a bind context object to be used during this operation. Identifier of the interface to return. Address that receives the interface pointer. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Requests a pointer to an object's storage interface. Return value: error code, if any Address of an ITEMIDLIST structure that identifies the subfolder relative to its parent folder. Optional address of an IBindCtx interface on a bind context object to be used during this operation. Interface identifier (IID) of the requested storage interface. Address that receives the interface pointer specified by riid. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Determines the relative order of two file objects or folders, given their item identifier lists. Return value: If this method is successful, the CODE field of the HRESULT contains one of the following values (the code can be retrived using the helper function GetHResultCode): Negative A negative return value indicates that the first item should precede the second (pidl1 < pidl2). Positive A positive return value indicates that the first item should follow the second (pidl1 > pidl2). Zero A return value of zero indicates that the two items are the same (pidl1 = pidl2). Value that specifies how the comparison should be performed. The lower Sixteen bits of lParam define the sorting rule. The upper sixteen bits of lParam are used for flags that modify the sorting rule. values can be from the SHCIDS enum Pointer to the first item's ITEMIDLIST structure. Pointer to the second item's ITEMIDLIST structure. Requests an object that can be used to obtain information from or interact with a folder object. Return value: error code, if any Handle to the owner window. Identifier of the requested interface. Address of a pointer to the requested interface. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves the attributes of one or more file objects or subfolders. Return value: error code, if any Number of file objects from which to retrieve attributes. Address of an array of pointers to ITEMIDLIST structures, each of which uniquely identifies a file object relative to the parent folder. Address of a single ULONG value that, on entry contains the attributes that the caller is requesting. On exit, this value contains the requested attributes that are common to all of the specified objects. this value can be from the SFGAO enum If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves an OLE interface that can be used to carry out actions on the specified file objects or folders. Return value: error code, if any Handle to the owner window that the client should specify if it displays a dialog box or message box. Number of file objects or subfolders specified in the apidl parameter. Address of an array of pointers to ITEMIDLIST structures, each of which uniquely identifies a file object or subfolder relative to the parent folder. Identifier of the COM interface object to return. Reserved. Pointer to the requested interface. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves the display name for the specified file object or subfolder. Return value: error code, if any Address of an ITEMIDLIST structure (PIDL) that uniquely identifies the file object or subfolder relative to the parent folder. Flags used to request the type of display name to return. For a list of possible values. Address of a STRRET structure in which to return the display name. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the display name of a file object or subfolder, changing the item identifier in the process. Return value: error code, if any Handle to the owner window of any dialog or message boxes that the client displays. Pointer to an ITEMIDLIST structure that uniquely identifies the file object or subfolder relative to the parent folder. Pointer to a null-terminated string that specifies the new display name. Flags indicating the type of name specified by the lpszName parameter. For a list of possible values, see the description of the SHGNO enum. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Returns the globally unique identifier (GUID) of the default search object for the folder. The GUID of the default search object. Returns S_OK if successful, or a COM error value otherwise. Requests a pointer to an interface that allows a client to enumerate the available search objects. The address of a pointer to an enumerator object's IEnumExtraSearch interface. Returns S_OK if successful, or a COM error value otherwise. Gets the default sorting and display columns. Reserved. Set to zero. A pointer to a value that receives the index of the default sorted column. A pointer to a value that receives the index of the default display column. Returns S_OK if successful, or a COM error value otherwise. Gets the default state for a specified column. An integer that specifies the column number. A pointer to a value that contains flags that indicate the default column state. This parameter can include a combination of the following flags. Returns S_OK if successful, or a COM error value otherwise. Gets detailed information, identified by a property set identifier (FMTID) and a property identifier (PID), on an item in a Shell folder. A PIDL of the item, relative to the parent folder. This method accepts only single-level PIDLs. The structure must contain exactly one SHITEMID structure followed by a terminating zero. This value cannot be NULL. A pointer to an SHCOLUMNID structure that identifies the column. A pointer to a VARIANT with the requested information. The value is fully typed. The value returned for properties from the property system must conform to the type specified in that property definition's typeInfo as the legacyType attribute. Returns S_OK if successful, or a COM error value otherwise. Gets detailed information, identified by a column index, on an item in a Shell folder. PIDL of the item for which you are requesting information. This method accepts only single-level PIDLs. The structure must contain exactly one SHITEMID structure followed by a terminating zero. If this parameter is set to NULL, the title of the information field specified by iColumn is returned. The zero-based index of the desired information field. It is identical to the column number of the information as it is displayed in a Windows Explorer Details view. The zero-based index of the desired information field. It is identical to the column number of the information as it is displayed in a Windows Explorer Details view. Returns S_OK if successful, or a COM error value otherwise. Converts a column to the appropriate property set ID (FMTID) and property ID (PID). The column ID. A pointer to an SHCOLUMNID structure containing the FMTID and PID. Returns S_OK if successful, or a COM error value otherwise. Exposes a method that allows communication between Windows Explorer and a folder view implemented using the system folder view object (the IShellView object returned through SHCreateShellFolderView) so that the folder view can be notified of events and modify its view accordingly. Allows communication between the system folder view object and a system folder view callback object. One of the following notifications. Additional information. Additional information. Additional information. S_OK if the message was handled, E_NOTIMPL if the shell should perform default processing. Exposes methods that handle all communication between icon overlay handlers and the Shell. Specifies whether an icon overlay should be added to a Shell object's icon. A Unicode string that contains the fully qualified path of the Shell object. The object's attributes. For a complete list of file attributes and their associated flags, see IShellFolder::GetAttributesOf. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Provides the location of the icon overlay's bitmap. A null-terminated Unicode string that contains the fully qualified path of the file containing the icon. The .dll, .exe, and .ico file types are all acceptable. You must set the ISIOI_ICONFILE flag in pdwFlags if you return a file name. The size of the pwszIconFile buffer, in Unicode characters. Pointer to an index value used to identify the icon in a file that contains multiple icons. You must set the ISIOI_ICONINDEX flag in pdwFlags if you return an index. Pointer to a bitmap that specifies the information that is being returned by the method. This parameter can be one or both of the following values: ISIOI_ICONFILE, ISIOI_ICONINDEX. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Specifies the priority of an icon overlay. The address of a value that indicates the priority of the overlay identifier. Possible values range from zero to 100, with zero the highest priority. Returns S_OK if successful, or a COM error code otherwise. Exposes methods that present a view in the Windows Explorer or folder windows. Retrieves a handle to one of the windows participating in in-place activation (frame, document, parent, or in-place object window). A pointer to a variable that receives the window handle. This method returns S_OK on success. Determines whether context-sensitive help mode should be entered during an in-place activation session. TRUE if help mode should be entered; FALSE if it should be exited. This method returns S_OK if the help mode was entered or exited successfully, depending on the value passed in fEnterMode. Translates keyboard shortcut (accelerator) key strokes when a namespace extension's view has the focus. The address of the message to be translated. Returns S_OK if successful, or a COM-defined error value otherwise. If the view returns S_OK, it indicates that the message was translated and should not be translated or dispatched by Windows Explorer. Enables or disables modeless dialog boxes. This method is not currently implemented. Nonzero to enable modeless dialog box windows or zero to disable them. Called when the activation state of the view window is changed by an event that is not caused by the Shell view itself. For example, if the TAB key is pressed when the tree has the focus, the view should be given the focus. Flag specifying the activation state of the window. Returns S_OK if successful, or a COM-defined error value otherwise. Refreshes the view's contents in response to user input. Returns S_OK if successful, or a COM-defined error value otherwise. Creates a view window. This can be either the right pane of Windows Explorer or the client window of a folder window.. The address of the IShellView interface of the view window being exited. Views can use this parameter to communicate with a previous view of the same implementation. This interface can be used to optimize browsing between like views. This pointer may be NULL. The address of a FOLDERSETTINGS structure. The view should use this when creating its view. The address of the current instance of the IShellBrowser interface. The view should call this interface's AddRef method and keep the interface pointer to allow communication with the Windows Explorer window. The dimensions of the new view, in client coordinates. The address of the window handle being created. Returns a success code if successful, or a COM error code otherwise. Destroys the view window. Returns a success code if successful, or a COM error code otherwise. Gets the current folder settings. The address of a FOLDERSETTINGS structure to receive the settings. Returns S_OK if successful, or a COM-defined error value otherwise. Allows the view to add pages to the Options property sheet from the View menu. Reserved. The address of the callback function used to add the pages. A value that must be passed as the callback function's lparam parameter. Returns S_OK if successful, or a COM-defined error value otherwise. Saves the Shell's view settings so the current state can be restored during a subsequent browsing session. Changes the selection state of one or more items within the Shell view window. The address of the ITEMIDLIST structure. One of the _SVSIF constants that specify the type of selection to apply. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets an interface that refers to data presented in the view. The constants that refer to an aspect of the view. This parameter can be any one of the _SVGIO constants. The identifier of the COM interface being requested. The address that receives the interface pointer. If an error occurs, the pointer returned must be NULL. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Flags for IShellIconOverlayIdentifer::GetOverlayInfo. The path of the icon file is returned through pwszIconFile. There is more than one icon in pwszIconFile. The icon's index is returned through pIndex. Exposes a method for getting a thumbnail image. Gets a thumbnail image and alpha type. The maximum thumbnail size, in pixels. The Shell draws the returned bitmap at this size or smaller. The returned bitmap should fit into a square of width and height cx, though it does not need to be a square image. The Shell scales the bitmap to render at lower sizes. For example, if the image has a 6:4 aspect ratio, then the returned bitmap should also have a 6:4 aspect ratio. When this method returns, contains a pointer to the thumbnail image handle. The image must be a DIB section and 32 bits per pixel. The Shell scales down the bitmap if its width or height is larger than the size specified by cx. The Shell always respects the aspect ratio and never scales a bitmap larger than its original size. When this method returns, contains a pointer to one of the following values from the WTS_ALPHATYPE enumeration. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. KnownFolders contain the known folder ids for windows. See: http://msdn.microsoft.com/en-us/library/windows/desktop/dd378457.aspx For details on known folders. Specify special retrieval options for known folders. These values supersede CSIDL values, which have parallel meanings. No flags. Build a simple IDList (PIDL) This value can be used when you want to retrieve the file system path but do not specify this value if you are retrieving the localized display name of the folder because it might not resolve correctly. Gets the folder's default path independent of the current location of its parent. KF_FLAG_DEFAULT_PATH must also be set. Gets the default path for a known folder. If this flag is not set, the function retrieves the current—and possibly redirected—path of the folder. The execution of this flag includes a verification of the folder's existence unless KF_FLAG_DONT_VERIFY is set. Initializes the folder using its Desktop.ini settings. If the folder cannot be initialized, the function returns a failure code and no path is returned. This flag should always be combined with KF_FLAG_CREATE. If the folder is located on a network, the function might take a longer time to execute. Gets the true system path for the folder, free of any aliased placeholders such as %USERPROFILE%, returned by SHGetKnownFolderIDList and IKnownFolder::GetIDList. This flag has no effect on paths returned by SHGetKnownFolderPath and IKnownFolder::GetPath. By default, known folder retrieval functions and methods return the aliased path if an alias exists. Stores the full path in the registry without using environment strings. If this flag is not set, portions of the path may be represented by environment strings such as %USERPROFILE%. This flag can only be used with SHSetKnownFolderPath and IKnownFolder::SetPath. Do not verify the folder's existence before attempting to retrieve the path or IDList. If this flag is not set, an attempt is made to verify that the folder is truly present at the path. If that verification fails due to the folder being absent or inaccessible, the function returns a failure code and no path is returned. If the folder is located on a network, the function might take a longer time to execute. Setting this flag can reduce that lag time. Forces the creation of the specified folder if that folder does not already exist. The security provisions predefined for that folder are applied. If the folder does not exist and cannot be created, the function returns a failure code and no path is returned. This value can be used only with the following functions and methods: Introduced in Windows 7: When running inside an app container, or when providing an app container token, this flag prevents redirection to app container folders. Instead, it retrieves the path that would be returned where it not running inside an app container. Introduced in Windows 7. Return only aliased PIDLs. Do not use the file system path. The LOGFONT structure defines the attributes of a font. The height, in logical units, of the font's character cell or character. The character height value (also known as the em height) is the character cell height value minus the internal-leading value. The average width, in logical units, of characters in the font. If lfWidth is zero, the aspect ratio of the device is matched against the digitization aspect ratio of the available fonts to find the closest match, determined by the absolute value of the difference. The angle, in tenths of degrees, between the escapement vector and the x-axis of the device. The escapement vector is parallel to the base line of a row of text. The angle, in tenths of degrees, between each character's base line and the x-axis of the device. The weight of the font in the range 0 through 1000. For example, 400 is normal and 700 is bold. If this value is zero, a default weight is used. An italic font if set to TRUE. An underlined font if set to TRUE. A strikeout font if set to TRUE. The character set. The output precision. The output precision defines how closely the output must match the requested font's height, width, character orientation, escapement, pitch, and font type. The clipping precision. The clipping precision defines how to clip characters that are partially outside the clipping region. The output quality. The output quality defines how carefully the graphics device interface (GDI) must attempt to match the logical-font attributes to those of an actual physical font The pitch and family of the font. A null-terminated string that specifies the typeface name of the font. The length of this string must not exceed 32 TCHAR values, including the terminating NULL. The EnumFontFamiliesEx function can be used to enumerate the typeface names of all currently available fonts. If lfFaceName is an empty string, GDI uses the first font that matches the other specified attributes. Contains message information from a thread's message queue. A handle to the window whose window procedure receives the message. This member is NULL when the message is a thread message. The message identifier. Applications can only use the low word; the high word is reserved by the system. Additional information about the message. The exact meaning depends on the value of the message member. Additional information about the message. The exact meaning depends on the value of the message member. The time at which the message was posted. The cursor position, in screen coordinates, when the message was posted. Contains information about a notification message. A window handle to the control sending the message. An identifier of the control sending the message. A notification code. This member can be one of the common notification codes (see Notifications under General Control Reference), or it can be a control-specific notification code. The notify struct for Property Sheet notifications. The header. The lparam Indicates the number of menu items in each of the six menu groups of a menu shared between a container and an object server during an in-place editing session. This is the mechanism for building a shared menu. An array whose elements contain the number of menu items in each of the six menu groups of a shared in-place editing menu. Each menu group can have any number of menu items. The container uses elements 0, 2, and 4 to indicate the number of menu items in its File, View, and Window menu groups. The object server uses elements 1, 3, and 5 to indicate the number of menu items in its Edit, Object, and Help menu groups. Accelerator table structure. Used by IPreviewHandlerFrame::GetWindowContext. A handle to the accelerator table. The number of entries in the accelerator table. Property Sheet Notifications. Notifies a page that it is about to be activated. Notifies a page that it is about to lose activation either because another page is being activated or the user has clicked the OK button. Sent to every page in the property sheet to indicate that the user has clicked the OK, Close, or Apply button and wants all changes to take effect. This notification code is sent in the form of a WM_NOTIFY message. Notifies a page that the property sheet is about to be destroyed. Flags that indicate which options to use when creating the property sheet page. This member can be a combination of the following values. Uses the default meaning for all structure members. This flag is not supported when using the Aero-style wizard (PSH_AEROWIZARD). Creates the page from the dialog box template in memory pointed to by the pResource member. The PropertySheet function assumes that the template that is in memory is not write-protected. A read-only template will cause an exception in some versions of Windows. Uses hIcon as the small icon on the tab for the page. This flag is not supported when using the Aero-style wizard (PSH_AEROWIZARD). Uses pszIcon as the name of the icon resource to load and use as the small icon on the tab for the page. This flag is not supported when using the Aero-style wizard (PSH_AEROWIZARD). Uses the pszTitle member as the title of the property sheet dialog box instead of the title stored in the dialog box template. This flag is not supported when using the Aero-style wizard (PSH_AEROWIZARD). Reverses the direction in which pszTitle is displayed. Normal windows display all text, including pszTitle, left-to-right (LTR). For languages such as Hebrew or Arabic that read right-to-left (RTL), a window can be mirrored and all text will be displayed RTL. If PSP_RTLREADING is set, pszTitle will instead read RTL in a normal parent window, and LTR in a mirrored parent window. Enables the property sheet Help button when the page is active. This flag is not supported when using the Aero-style wizard (PSH_AEROWIZARD). Maintains the reference count specified by the pcRefParent member for the lifetime of the property sheet page created from this structure. Calls the function specified by the pfnCallback member when creating or destroying the property sheet page defined by this structure. Version 4.71 or later. Causes the page to be created when the property sheet is created. If this flag is not specified, the page will not be created until it is selected the first time. This flag is not supported when using the Aero-style wizard (PSH_AEROWIZARD). Version 5.80 and later. Causes the wizard property sheet to hide the header area when the page is selected. If a watermark has been provided, it will be painted on the left side of the page. This flag should be set for welcome and completion pages, and omitted for interior pages. This flag is not supported when using the Aero-style wizard (PSH_AEROWIZARD). Version 5.80 or later. Displays the string pointed to by the pszHeaderTitle member as the title in the header of a Wizard97 interior page. You must also set the PSH_WIZARD97 flag in the dwFlags member of the associated PROPSHEETHEADER structure. The PSP_USEHEADERTITLE flag is ignored if PSP_HIDEHEADER is set. This flag is not supported when using the Aero-style wizard (PSH_AEROWIZARD). Version 5.80 or later. Displays the string pointed to by the pszHeaderSubTitle member as the subtitle of the header area of a Wizard97 page. To use this flag, you must also set the PSH_WIZARD97 flag in the dwFlags member of the associated PROPSHEETHEADER structure. The PSP_USEHEADERSUBTITLE flag is ignored if PSP_HIDEHEADER is set. In Aero-style wizards, the title appears near the top of the client area. The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle. Initializes a new instance of the struct. The left. The top. The right. The bottom. The x-coordinate of the upper-left corner of the rectangle. The y-coordinate of the upper-left corner of the rectangle. The x-coordinate of the lower-right corner of the rectangle. The y-coordinate of the lower-right corner of the rectangle. Gets the width. The width. Gets the height. The height. Offsets the rectangle. The x offset. The y offset. Sets the rectangle coordinates. The left. The top. The right. The bottom. Determines whether this rectangle is empty. true if this rectangle is empty; otherwise, false. Flags specifying the folder to be browsed. It can be zero or one or more of the following values. These flags specify whether another window is to be created. Use default behavior, which respects the view option (the user setting to create new windows or to browse in place). In most cases, calling applications should use this flag. Browse to another folder with the same Windows Explorer window. Creates another window for the specified folder. Use the current window. Specifies no folder tree for the new browse window. If the current browser does not match the SBSP_OPENMODE of the browse object call, a new window is opened. Specifies a folder tree for the new browse window. If the current browser does not match the SBSP_EXPLOREMODE of the browse object call, a new window is opened. Not supported. Do not use. Do not transfer the browsing history to the new window. An absolute PIDL, relative to the desktop. A relative PIDL, relative to the current folder. Browse the parent folder, ignore the PIDL. Navigate back, ignore the PIDL. Navigate forward, ignore the PIDL. Enable auto-navigation. Windows Vista and later. Not supported. Do not use. Windows Vista and later. Navigate without clearing the search entry field. Windows Vista and later. Navigate without the default behavior of setting focus into the new view. Windows 7 and later. Do not add a new entry to the travel log. When the user enters a search term in the search box and subsequently refines the query, the browser navigates forward but does not add an additional travel log entry. Windows 7 and later. Do not make the navigation complete sound for each keystroke in the search box. Microsoft Internet Explorer 6 Service Pack 2 (SP2) and later. The navigation was possibly initiated by a webpage with scripting code already present on the local system. Suppress selection in the history pane. Microsoft Internet Explorer 6 Service Pack 2 (SP2) and later. The window is navigating to an untrusted, non-HTML file. If the user attempts to download the file, do not allow the download. Suppress selection in the history pane. Write no history of this navigation in the history Shell folder. Microsoft Internet Explorer 6 Service Pack 2 (SP2) and later. The navigate should allow ActiveX prompts. Windows Internet Explorer 7 and later. If allowed by current registry settings, give the browser a destination to navigate to. Enables redirection to another URL. The system currently defines these modifier flags. Version 5.0. Compare all the information contained in the ITEMIDLIST structure, not just the display names. This flag is valid only for folder objects that support the IShellFolder2 interface. For instance, if the two items are files, the folder should compare their names, sizes, file times, attributes, and any other information in the structures. If this flag is set, the lower sixteen bits of lParam must be zero. Version 5.0. Compare all the information contained in the ITEMIDLIST structure, not just the display names. This flag is valid only for folder objects that support the IShellFolder2 interface. For instance, if the two items are files, the folder should compare their names, sizes, file times, attributes, and any other information in the structures. If this flag is set, the lower sixteen bits of lParam must be zero. Bitmask for the flag field. Bitmask for the column field. Flags that indicate the content and validity of the other structure members; a combination of the following values: Use default values. Use the class name given by the lpClass member. If both SEE_MASK_CLASSKEY and SEE_MASK_CLASSNAME are set, the class key is used. Use the class key given by the hkeyClass member. If both SEE_MASK_CLASSKEY and SEE_MASK_CLASSNAME are set, the class key is used. Use the item identifier list given by the lpIDList member. The lpIDList member must point to an ITEMIDLIST structure. Use the IContextMenu interface of the selected item's shortcut menu handler. Use either lpFile to identify the item by its file system path or lpIDList to identify the item by its PIDL. This flag allows applications to use ShellExecuteEx to invoke verbs from shortcut menu extensions instead of the static verbs listed in the registry. Note SEE_MASK_INVOKEIDLIST overrides and implies SEE_MASK_IDLIST. Use the icon given by the hIcon member. This flag cannot be combined with SEE_MASK_HMONITOR. Note This flag is used only in Windows XP and earlier. It is ignored as of Windows Vista. Use the keyboard shortcut given by the dwHotKey member. Use to indicate that the hProcess member receives the process handle. This handle is typically used to allow an application to find out when a process created with ShellExecuteEx terminates. In some cases, such as when execution is satisfied through a DDE conversation, no handle will be returned. The calling application is responsible for closing the handle when it is no longer needed. Validate the share and connect to a drive letter. This enables reconnection of disconnected network drives. The lpFile member is a UNC path of a file on a network. Wait for the execute operation to complete before returning. This flag should be used by callers that are using ShellExecute forms that might result in an async activation, for example DDE, and create a process that might be run on a background thread. (Note: ShellExecuteEx runs on a background thread by default if the caller's threading model is not Apartment., Calls to ShellExecuteEx from processes already running on background threads should always pass this flag. Also, applications that exit immediately after calling ShellExecuteEx should specify this flag. If the execute operation is performed on a background thread and the caller did not specify the SEE_MASK_ASYNCOK flag, then the calling thread waits until the new process has started before returning. This typically means that either CreateProcess has been called, the DDE communication has completed, or that the custom execution delegate has notified ShellExecuteEx that it is done. If the SEE_MASK_WAITFORINPUTIDLE flag is specified, then ShellExecuteEx calls WaitForInputIdle and waits for the new process to idle before returning, with a maximum timeout of 1 minute. For further discussion on when this flag is necessary, see the Remarks section. Do not use; use SEE_MASK_NOASYNC instead. Expand any environment variables specified in the string given by the lpDirectory or lpFile member. Do not display an error message box if an error occurs. Use this flag to indicate a Unicode application. Use to inherit the parent's console for the new process instead of having it create a new console. It is the opposite of using a CREATE_NEW_CONSOLE flag with CreateProcess. The execution can be performed on a background thread and the call should return immediately without waiting for the background thread to finish. Note that in certain cases ShellExecuteEx ignores this flag and waits for the process to finish before returning. Not used. Use this flag when specifying a monitor on multi-monitor systems. The monitor is specified in the hMonitor member. This flag cannot be combined with SEE_MASK_ICON. Introduced in Windows XP. Do not perform a zone check. This flag allows ShellExecuteEx to bypass zone checking put into place by IAttachmentExecute. After the new process is created, wait for the process to become idle before returning, with a one minute timeout. See WaitForInputIdle for more details. Introduced in Windows XP. Keep track of the number of times this application has been launched. Applications with sufficiently high counts appear in the Start Menu's list of most frequently used programs. Introduced in Windows 8. The hInstApp member is used to specify the IUnknown of the object that will be used as a site pointer. The site pointer is used to provide services to the ShellExecute function, the handler binding process, and invoked verb handlers. Flags for IShellFolder::GetAttributesOf. Objects can be copied (DROPEFFECT_COPY) Objects can be moved (DROPEFFECT_MOVE) Objects can be linked (DROPEFFECT_LINK) Supports BindToObject(IID_IStorage) Objects can be renamed Objects can be deleted Objects have property sheets Objects are drop target Mask for capabilities. Object is encrypted (use alt color) 'Slow' object Ghosted icon Shortcut (link) Shared Read-only Hidden object Display attribute mask. May contain children with SFGAO_FILESYSTEM Support BindToObject(IID_IShellFolder) Is a win32 file system object (file/folder/root) May contain children with SFGAO_FOLDER Contents mask. Invalidate cached information Is this removeable media? Object is compressed (use alt color) Supports IShellFolder, but only implements CreateViewObject() (non-folder view) Is a non-enumerated object Should show bold in explorer tree Defunct Defunct Supports BindToObject(IID_IStream) May contain children with SFGAO_STORAGE or SFGAO_STREAM For determining storage capabilities, ie for open/save semantics This structure is used with the SHCreateShellFolderView function. The size of the SFV_CREATE structure, in bytes. The IShellFolder interface of the folder for which to create the view. A pointer to the parent IShellView interface. This parameter may be NULL. This parameter is used only when the view created by SHCreateShellFolderView is hosted in a common dialog box. A pointer to the IShellFolderViewCB interface that handles the view's callbacks when various events occur. This parameter may be NULL. A pointer to a value that contains flags that indicate the default column state. This parameter can include a combination of the following flags. The default state. A string. An integer. A date. Should be shown by default in the Windows Explorer Details view. Recommends that the folder view extract column information asynchronously, on a background thread, because extracting this information can be time consuming. Provided by a handler, not the folder object. Not displayed in the shortcut menu, but listed in the More dialog box. Not displayed in the user interface. Uses default sorting rather than CompareIDs to get the sort order. Specifies the FMTID/PID identifier of a column that will be displayed by the Windows Explorer Details view. A property set format identifier or FMTID (a GUID). The Shell supports the storage, Shell details, and summary information property sets. Other property sets can be supported by particular folders. The column's property identifier (PID). Determines the types of items included in an enumeration. These values are used with the IShellFolder::EnumObjects method. Windows 7 and later. The calling application is checking for the existence of child items in the folder. Include items that are folders in the enumeration. Include items that are not folders in the enumeration. Include hidden items in the enumeration. This does not include hidden system items. (To include hidden system items, use SHCONTF_INCLUDESUPERHIDDEN.) No longer used; always assumed. IShellFolder::EnumObjects can return without validating the enumeration object. Validation can be postponed until the first call to IEnumIDList::Next. Use this flag when a user interface might be displayed prior to the first IEnumIDList::Next call. For a user interface to be presented, hwnd must be set to a valid window handle. The calling application is looking for printer objects. The calling application is looking for resources that can be shared. Include items with accessible storage and their ancestors, including hidden items. Windows 7 and later. Child folders should provide a navigation enumeration. Windows Vista and later. The calling application is looking for resources that can be enumerated quickly. Windows Vista and later. Enumerate items as a simple list even if the folder itself is not structured in that way. Windows Vista and later. The calling application is monitoring for change notifications. This means that the enumerator does not have to return all results. Items can be reported through change notifications. Windows 7 and later. Include hidden system items in the enumeration. This value does not include hidden non-system items. (To include hidden non-system items, use SHCONTF_INCLUDEHIDDEN.) Reports detailed information on an item in a Shell folder. The alignment of the column heading and the subitem text in the column. The number of average-sized characters in the header. An STRRET structure that includes a string with the requested information. To convert this structure to a string, use StrRetToBuf or StrRetToStr. Contains information used by ShellExecuteEx. Required. The size of this structure, in bytes. Flags that indicate the content and validity of the other structure members. Optional. A handle to the parent window, used to display any message boxes that the system might produce while executing this function. This value can be NULL. A string, referred to as a verb, that specifies the action to be performed. The set of available verbs depends on the particular file or folder. Generally, the actions available from an object's shortcut menu are available verbs. This parameter can be NULL, in which case the default verb is used if available. If not, the "open" verb is used. If neither verb is available, the system uses the first verb listed in the registry. The address of a null-terminated string that specifies the name of the file or object on which ShellExecuteEx will perform the action specified by the lpVerb parameter. The system registry verbs that are supported by the ShellExecuteEx function include "open" for executable files and document files and "print" for document files for which a print handler has been registered. Other applications might have added Shell verbs through the system registry, such as "play" for .avi and .wav files. To specify a Shell namespace object, pass the fully qualified parse name and set the SEE_MASK_INVOKEIDLIST flag in the fMask parameter. Optional. The address of a null-terminated string that contains the application parameters. The parameters must be separated by spaces. If the lpFile member specifies a document file, lpParameters should be NULL. Optional. The address of a null-terminated string that specifies the name of the working directory. If this member is NULL, the current directory is used as the working directory. Required. Flags that specify how an application is to be shown when it is opened; one of the SW_ values listed for the ShellExecute function. If lpFile specifies a document file, the flag is simply passed to the associated application. It is up to the application to decide how to handle it. [out] If SEE_MASK_NOCLOSEPROCESS is set and the ShellExecuteEx call succeeds, it sets this member to a value greater than 32. If the function fails, it is set to an SE_ERR_XXX error value that indicates the cause of the failure. Although hInstApp is declared as an HINSTANCE for compatibility with 16-bit Windows applications, it is not a true HINSTANCE. It can be cast only to an int and compared to either 32 or the following SE_ERR_XXX error codes. The address of an absolute ITEMIDLIST structure (PCIDLIST_ABSOLUTE) to contain an item identifier list that uniquely identifies the file to execute. This member is ignored if the fMask member does not include SEE_MASK_IDLIST or SEE_MASK_INVOKEIDLIST. The address of a null-terminated string that specifies one of the following: A ProgId. For example, "Paint.Picture". A URI protocol scheme. For example, "http". A file extension. For example, ".txt". A registry path under HKEY_CLASSES_ROOT that names a subkey that contains one or more Shell verbs. This key will have a subkey that conforms to the Shell verb registry schema, such as shell\verb name A handle to the registry key for the file type. The access rights for this registry key should be set to KEY_READ. This member is ignored if fMask does not include SEE_MASK_CLASSKEY. A keyboard shortcut to associate with the application. The low-order word is the virtual key code, and the high-order word is a modifier flag (HOTKEYF_). For a list of modifier flags, see the description of the WM_SETHOTKEY message. This member is ignored if fMask does not include SEE_MASK_HOTKEY. A handle to the icon for the file type. This member is ignored if fMask does not include SEE_MASK_ICON. This value is used only in Windows XP and earlier. It is ignored as of Windows Vista. A handle to the monitor upon which the document is to be displayed. This member is ignored if fMask does not include SEE_MASK_HMONITOR. Contains information about a file object. A handle to the icon that represents the file. You are responsible for destroying this handle with DestroyIcon when you no longer need it. The index of the icon image within the system image list. An array of values that indicates the attributes of the file object. For information about these values, see the IShellFolder::GetAttributesOf method. A string that contains the name of the file as it appears in the Windows Shell, or the path and file name of the file that contains the icon representing the file. A string that describes the type of file. Defines the values used with the IShellFolder::GetDisplayNameOf and IShellFolder::SetNameOf methods to specify the type of file or folder names used by those methods. When not combined with another flag, return the parent-relative name that identifies the item, suitable for displaying to the user. This name often does not include extra information such as the file name extension and does not need to be unique. This name might include information that identifies the folder that contains the item. For instance, this flag could cause IShellFolder::GetDisplayNameOf to return the string "username (on Machine)" for a particular user's folder. The name is relative to the folder from which the request was made. This is the name display to the user when used in the context of the folder. For example, it is used in the view and in the address bar path segment for the folder. This name should not include disambiguation information—for instance "username" instead of "username (on Machine)" for a particular user's folder. Use this flag in combinations with SHGDN_FORPARSING and SHGDN_FOREDITING. The name is used for in-place editing when the user renames the item. The name is displayed in an address bar combo box. The name is used for parsing. That is, it can be passed to IShellFolder::ParseDisplayName to recover the object's PIDL. The form this name takes depends on the particular object. When SHGDN_FORPARSING is used alone, the name is relative to the desktop. When combined with SHGDN_INFOLDER, the name is relative to the folder from which the request was made. The flags that specify the file information to retrieve. Retrieve the handle to the icon that represents the file and the index of the icon within the system image list. The handle is copied to the hIcon member of the structure specified by psfi, and the index is copied to the iIcon member. Retrieve the display name for the file. The name is copied to the szDisplayName member of the structure specified in psfi. The returned display name uses the long file name, if there is one, rather than the 8.3 form of the file name. Retrieve the string that describes the file's type. The string is copied to the szTypeName member of the structure specified in psfi. Retrieve the item attributes. The attributes are copied to the dwAttributes member of the structure specified in the psfi parameter. These are the same attributes that are obtained from IShellFolder::GetAttributesOf. Retrieve the name of the file that contains the icon representing the file specified by pszPath, as returned by the IExtractIcon::GetIconLocation method of the file's icon handler. Also retrieve the icon index within that file. The name of the file containing the icon is copied to the szDisplayName member of the structure specified by psfi. The icon's index is copied to that structure's iIcon member. Retrieve the type of the executable file if pszPath identifies an executable file. The information is packed into the return value. This flag cannot be specified with any other flags. Retrieve the index of a system image list icon. If successful, the index is copied to the iIcon member of psfi. The return value is a handle to the system image list. Only those images whose indices are successfully copied to iIcon are valid. Attempting to access other images in the system image list will result in undefined behavior. Modify SHGFI_ICON, causing the function to add the link overlay to the file's icon. The SHGFI_ICON flag must also be set. Modify SHGFI_ICON, causing the function to blend the file's icon with the system highlight color. The SHGFI_ICON flag must also be set. Modify SHGFI_ATTRIBUTES to indicate that the dwAttributes member of the SHFILEINFO structure at psfi contains the specific attributes that are desired. These attributes are passed to IShellFolder::GetAttributesOf. If this flag is not specified, 0xFFFFFFFF is passed to IShellFolder::GetAttributesOf, requesting all attributes. This flag cannot be specified with the SHGFI_ICON flag. Modify SHGFI_ICON, causing the function to retrieve the file's large icon. The SHGFI_ICON flag must also be set. Modify SHGFI_ICON, causing the function to retrieve the file's small icon. Also used to modify SHGFI_SYSICONINDEX, causing the function to return the handle to the system image list that contains small icon images. The SHGFI_ICON and/or SHGFI_SYSICONINDEX flag must also be set. Modify SHGFI_ICON, causing the function to retrieve the file's open icon. Also used to modify SHGFI_SYSICONINDEX, causing the function to return the handle to the system image list that contains the file's small open icon. A container object displays an open icon to indicate that the container is open. The SHGFI_ICON and/or SHGFI_SYSICONINDEX flag must also be set. Modify SHGFI_ICON, causing the function to retrieve a Shell-sized icon. If this flag is not specified the function sizes the icon according to the system metric values. The SHGFI_ICON flag must also be set. Indicate that pszPath is the address of an ITEMIDLIST structure rather than a path name. Indicates that the function should not attempt to access the file specified by pszPath. Rather, it should act as if the file specified by pszPath exists with the file attributes passed in dwFileAttributes. This flag cannot be combined with the SHGFI_ATTRIBUTES, SHGFI_EXETYPE, or SHGFI_PIDL flags. Version 5.0. Apply the appropriate overlays to the file's icon. The SHGFI_ICON flag must also be set. Version 5.0. Return the index of the overlay icon. The value of the overlay index is returned in the upper eight bits of the iIcon member of the structure specified by psfi. This flag requires that the SHGFI_ICON be set as well. Shlwapi shlwapi.dll imports. Converts an STRRET structure returned by IShellFolder::GetDisplayNameOf to a string, and places the result in a buffer. A pointer to the STRRET structure. When the function returns, this pointer will no longer be valid. A pointer to the item's ITEMIDLIST structure. A buffer to hold the display name. It will be returned as a null-terminated string. If cchBuf is too small, the name will be truncated to fit. The size of pszBuf, in characters. If cchBuf is too small, the string will be truncated to fit. If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. The SIZE structure specifies the width and height of a rectangle. Specifies the rectangle's width. The units depend on which function uses this. Specifies the rectangle's height. The units depend on which function uses this. Initializes a new instance of the struct. The width. The height. Contains strings returned from the IShellFolder interface methods. Creates a unicode from a string. The string. A unicode allocated on the shell allocator. Gets the actual string value of a STRRET. The string represented by the STRRET. A value that specifies the desired format of the string. This can be one of the following values. The string is at the address specified by pOleStr member. The uOffset member value indicates the number of bytes from the beginning of the item identifier list where the string is located. The string is returned in the cStr member. A value that specifies the desired format of the string. The string data. Used with the IBrowserService2::_UIActivateView method to set the state of a browser view. Windows Explorer is about to destroy the Shell view window. The Shell view should remove all extended user interfaces. These are typically merged menus and merged modeless pop-up windows. The Shell view is losing the input focus, or it has just been created without the input focus. The Shell view should be able to set menu items appropriate for the nonfocused state. This means no selection-specific items should be added. Windows Explorer has just created the view window with the input focus. This means the Shell view should be able to set menu items appropriate for the focused state. The Shell view is active without focus. This flag is only used when UIActivate is exposed through the IShellView2 interface. Contains information about a button in a toolbar. TODO: This struct has different sizes on Windows x86 and x64, validate that it works in both modes. Zero-based index of the button image. Set this member to I_IMAGECALLBACK, and the toolbar will send the TBN_GETDISPINFO notification code to retrieve the image index when it is needed. Version 5.81. Set this member to I_IMAGENONE to indicate that the button does not have an image. The button layout will not include any space for a bitmap, only text. If the button is a separator, that is, if fsStyle is set to BTNS_SEP, iBitmap determines the width of the separator, in pixels. For information on selecting button images from image lists, see TB_SETIMAGELIST message. Command identifier associated with the button. This identifier is used in a WM_COMMAND message when the button is chosen. Button state flags. This member can be a combination of the values listed in Toolbar Button States. Button style. This member can be a combination of the button style values listed in Toolbar Control and Button Styles. Application-defined value. Alpha channel type information. The bitmap is an unknown format. The Shell tries nonetheless to detect whether the image has an alpha channel. The bitmap is an RGB image without alpha. The alpha channel is invalid and the Shell ignores it. The bitmap is an ARGB image with a valid alpha channel. Used with the IFolderView::Items, IFolderView::ItemCount, and IShellView::GetItemObject methods to restrict or control the items in their collections. Refers to the background of the view. It is used with IID_IContextMenu to get a shortcut menu for the view background and with IID_IDispatch to get a dispatch interface that represents the ShellFolderView object for the view. Refers to the currently selected items. Used with IID_IDataObject to retrieve a data object that represents the selected items. Used in the same way as SVGIO_SELECTION but refers to all items in the view. Used in the same way as SVGIO_SELECTION but refers to checked items in views where checked mode is supported. For more details on checked mode, see FOLDERFLAGS. Used in the same way as SVGIO_SELECTION but refers to checked items in views where checked mode is supported. For more details on checked mode, see FOLDERFLAGS. Returns the items in the order they appear in the view. If this flag is not set, the selected item will be listed first. Indicates flags used by IFolderView, IFolderView2, IShellView and IShellView2 to specify a type of selection to apply. Deselect the item. Select the item. Put the name of the item into rename mode. This value includes SVSI_SELECT. Deselect all but the selected item. If the item parameter is NULL, deselect all items. In the case of a folder that cannot display all of its contents on one screen, display the portion that contains the selected item. Give the selected item the focus when multiple items are selected, placing the item first in any list of the collection returned by a method. Convert the input point from screen coordinates to the list-view client coordinates. Mark the item so that it can be queried using IFolderView::GetSelectionMarkedItem. Allows the window's default view to position the item. In most cases, this will place the item in the first available position. However, if the call comes during the processing of a mouse-positioned context menu, the position of the context menu is used to position the item. The item should be checked. This flag is used with items in views where the checked mode is supported. The second check state when the view is in tri-check mode, in which there are three values for the checked state. You can indicate tri-check mode by specifying FWF_TRICHECKSELECT in IFolderView2::SetCurrentFolderFlags. The 3 states for FWF_TRICHECKSELECT are unchecked, SVSI_CHECK and SVSI_CHECK2. Selects the item and marks it as selected by the keyboard. This value includes SVSI_SELECT. An operation to select or focus an item should not also set focus on the view itself. Exposes a method to initialize a handler, such as a property handler, thumbnail handler, or preview handler, with a file path. Initializes a handler with a file path. A pointer to a buffer that contains the file path as a null-terminated Unicode string. One of the following STGM values that indicates the access mode for pszFilePath. STGM_READ or STGM_READWRITE. Exposes a method that initializes a handler, such as a property handler, thumbnail handler, or preview handler, with a stream. Initializes a handler with a stream. A pointer to an IStream interface that represents the stream source. One of the following STGM values that indicates the access mode for pstream. STGM_READ or STGM_READWRITE. GetInfoTip flags. No special handling. Provide the name of the item in ppwszTip rather than the info tip text. If the item is a shortcut, retrieve the info tip text of the shortcut rather than its target. If the item is a shortcut, retrieve the info tip text of the shortcut's target. Search the entire namespace for the information. This value can result in a delayed response time. Windows Vista and later. Put the info tip on a single line. Values that are used in activation calls to indicate the execution contexts in which an object is to be run. These values are also used in calls to CoRegisterClassObject to indicate the set of execution contexts in which a class object is to be made available for requests to construct instances. The code that creates and manages objects of this class is a DLL that runs in the same process as the caller of the function specifying the class context. The code that manages objects of this class is an in-process handler. This is a DLL that runs in the client process and implements client-side structures of this class when instances of the class are accessed remotely. The EXE code that creates and manages objects of this class runs on same machine but is loaded in a separate process space. Obsolete. A remote context. The LocalServer32 or LocalService code that creates and manages objects of this class is run on a different computer. Obsolete. Reserved. Reserved. Reserved. Reserved. Disaables the downloading of code from the directory service or the Internet. This flag cannot be set at the same time as CLSCTX_ENABLE_CODE_DOWNLOAD. Reserved. Specify if you want the activation to fail if it uses custom marshalling. Enables the downloading of code from the directory service or the Internet. This flag cannot be set at the same time as CLSCTX_NO_CODE_DOWNLOAD. The CLSCTX_NO_FAILURE_LOG can be used to override the logging of failures in CoCreateInstanceEx. Disables activate-as-activator (AAA) activations for this activation only. This flag overrides the setting of the EOAC_DISABLE_AAA flag from the EOLE_AUTHENTICATION_CAPABILITIES enumeration. This flag cannot be set at the same time as CLSCTX_ENABLE_AAA. Any activation where a server process would be launched under the caller's identity is known as an activate-as-activator (AAA) activation. Disabling AAA activations allows an application that runs under a privileged account (such as LocalSystem) to help prevent its identity from being used to launch untrusted components. Library applications that use activation calls should always set this flag during those calls. This helps prevent the library application from being used in an escalation-of-privilege security attack. This is the only way to disable AAA activations in a library application because the EOAC_DISABLE_AAA flag from the EOLE_AUTHENTICATION_CAPABILITIES enumeration is applied only to the server process and not to the library application. Windows 2000: This flag is not supported. Enables activate-as-activator (AAA) activations for this activation only. This flag overrides the setting of the EOAC_DISABLE_AAA flag from the EOLE_AUTHENTICATION_CAPABILITIES enumeration. This flag cannot be set at the same time as CLSCTX_DISABLE_AAA. Any activation where a server process would be launched under the caller's identity is known as an activate-as-activator (AAA) activation. Enabling this flag allows an application to transfer its identity to an activated component. Windows 2000: This flag is not supported. Begin this activation from the default context of the current apartment. Activate or connect to a 32-bit version of the server; fail if one is not registered. Activate or connect to a 64 bit version of the server; fail if one is not registered. Inproc combination. Server combination. All. Flags that specify how the shortcut menu can be changed. Indicates normal operation. A shortcut menu extension, namespace extension, or drag-and-drop handler can add all menu items. The user is activating the default action, typically by double-clicking. This flag provides a hint for the shortcut menu extension to add nothing if it does not modify the default item in the menu. A shortcut menu extension or drag-and-drop handler should not add any menu items if this value is specified. A namespace extension should at most add only the default item. The shortcut menu is that of a shortcut file (normally, a .lnk file). Shortcut menu handlers should ignore this value. The Windows Explorer tree window is present. This flag is set for items displayed in the Send To menu. Shortcut menu handlers should ignore this value. The calling application supports renaming of items. A shortcut menu or drag-and-drop handler should ignore this flag. A namespace extension should add a Rename item to the menu if applicable. No item in the menu has been set as the default. A drag-and-drop handler should ignore this flag. A namespace extension should not set any of the menu items as the default. A static menu is being constructed. Only the browser should use this flag; all other shortcut menu extensions should ignore it. The calling application is invoking a shortcut menu on an item in the view (as opposed to the background of the view). Windows Server 2003 and Windows XP: This value is not available. The calling application wants extended verbs. Normal verbs are displayed when the user right-clicks an object. To display extended verbs, the user must right-click while pressing the Shift key. The calling application intends to invoke verbs that are disabled, such as legacy menus. Windows Server 2003 and Windows XP: This value is not available. The verb state can be evaluated asynchronously. Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This value is not available. Informs context menu handlers that do not support the invocation of a verb through a canonical verb name to bypass IContextMenu::QueryContextMenu in their implementation. Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This value is not available. Populate submenus synchronously. Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This value is not available. When no verb is explicitly specified, do not use a default verb in its place. Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This value is not available. This flag is a bitmask that specifies all bits that should not be used. This is to be used only as a mask. Do not pass this as a parameter value. Context Menu Command Invoke flags. The hIcon member is valid. As of Windows Vista this flag is not used. The dwHotKey member is valid. Windows Vista and later. The implementation of IContextMenu::InvokeCommand should be synchronous, not returning before it is complete. Since this is recommended, calling applications that specify this flag cannot guarantee that this request will be honored if they are not familiar with the implementation of the verb that they are invoking. The system is prevented from displaying user interface elements (for example, error messages) while carrying out a command. The shortcut menu handler should use lpVerbW, lpParametersW, lpDirectoryW, and lpTitleW members instead of their ANSI equivalents. Because some shortcut menu handlers may not support Unicode, you should also pass valid ANSI strings in the lpVerb, lpParameters, lpDirectory, and lpTitle members. If a shortcut menu handler needs to create a new process, it will normally create a new console. Setting the CMIC_MASK_NO_CONSOLE flag suppresses the creation of a new console. Wait for the DDE conversation to terminate before returning. Do not perform a zone check. This flag allows ShellExecuteEx to bypass zone checking put into place by IAttachmentExecute. Indicates that the implementation of IContextMenu::InvokeCommand might want to keep track of the item being invoked for features like the "Recent documents" menu. The SHIFT key is pressed. Use this instead of polling the current state of the keyboard that may have changed since the verb was invoked. The ptInvoke member is valid. The CTRL key is pressed. Use this instead of polling the current state of the keyboard that may have changed since the verb was invoked. Contains information needed by IContextMenu::InvokeCommand to invoke a shortcut menu command. The size of this structure, in bytes. Zero, or one or more of the following flags. A handle to the window that is the owner of the shortcut menu. An extension can also use this handle as the owner of any message boxes or dialog boxes it displays. The address of a null-terminated string that specifies the language-independent name of the command to carry out. This member is typically a string when a command is being activated by an application. An optional string containing parameters that are passed to the command. The format of this string is determined by the command that is to be invoked. This member is always NULL for menu items inserted by a Shell extension. An optional working directory name. This member is always NULL for menu items inserted by a Shell extension. An optional keyboard shortcut to assign to any application activated by the command. If the fMask parameter does not specify CMIC_MASK_HOTKEY, this member is ignored. An icon to use for any application activated by the command. If the fMask member does not specify CMIC_MASK_ICON, this member is ignored. Flags specifying the information to return. This parameter can have one of the following values. Sets pszName to an ANSI string containing the language-independent command name for the menu item. Sets pszName to an ANSI string containing the help text for the command. Returns S_OK if the menu item exists, or S_FALSE otherwise. Sets pszName to a Unicode string containing the language-independent command name for the menu item. Sets pszName to a Unicode string containing the help text for the command. Returns S_OK if the menu item exists, or S_FALSE otherwise. Not documented. Not documented. Exposes methods that either create or merge a shortcut menu associated with a Shell object. Adds commands to a shortcut menu. A handle to the shortcut menu. The handler should specify this handle when adding menu items. The zero-based position at which to insert the first new menu item. The minimum value that the handler can specify for a menu item identifier. The maximum value that the handler can specify for a menu item identifier. Optional flags that specify how the shortcut menu can be changed. This parameter can be set to a combination of the following values. The remaining bits of the low-order word are reserved by the system. The high-order word can be used for context-specific communications. The CMF_RESERVED value can be used to mask the low-order word. If successful, returns an HRESULT value that has its severity value set to SEVERITY_SUCCESS and its code value set to the offset of the largest command identifier that was assigned, plus one. For example, if idCmdFirst is set to 5 and you add three items to the menu with command identifiers of 5, 7, and 8, the return value should be MAKE_HRESULT(SEVERITY_SUCCESS, 0, 8 - 5 + 1). Otherwise, it returns a COM error value. Carries out the command associated with a shortcut menu item. A pointer to a CMINVOKECOMMANDINFO or CMINVOKECOMMANDINFOEX structure containing information about the command. For further details, see the Remarks section. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets information about a shortcut menu command, including the help string and the language-independent, or canonical, name for the command. Menu command identifier offset. Flags specifying the information to return. This parameter can have one of the following values. Reserved. Applications must specify NULL when calling this method and handlers must ignore this parameter when called. The address of the buffer to receive the null-terminated string being retrieved. Size of the buffer, in characters, to receive the null-terminated string. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Output GIL flags. The physical image bits for this icon are not cached by the calling application. The location is not a file name/index pair. The values in pszIconFile and piIndex cannot be passed to ExtractIcon or ExtractIconEx. All objects of this class have the same icon. This flag is used internally by the Shell. Typical implementations of IExtractIcon do not require this flag because the flag implies that an icon handler is not required to resolve the icon on a per-object basis. The recommended method for implementing per-class icons is to register a DefaultIcon for the class. Each object of this class has its own icon. This flag is used internally by the Shell to handle cases like Setup.exe, where objects with identical names can have different icons. Typical implementations of IExtractIcon do not require this flag. The calling application should create a document icon using the specified icon. Windows Vista only. The calling application must stamp the icon with the UAC shield. Windows Vista only. The calling application must not stamp the icon with the UAC shield. Exposes methods that the Shell uses to retrieve flags and info tip information for an item that resides in an IShellFolder implementation. Info tips are usually displayed inside a tooltip control. Gets the info tip text for an item. Flags that direct the handling of the item from which you're retrieving the info tip text. This value is commonly zero. he address of a Unicode string pointer that, when this method returns successfully, receives the tip string pointer. Applications that implement this method must allocate memory for ppwszTip by calling CoTaskMemAlloc. Calling applications must call CoTaskMemFree to free the memory when it is no longer needed. Returns S_OK if the function succeeds. If no info tip text is available, ppwszTip is set to NULL. Otherwise, returns a COM-defined error value. Gets the information flags for an item. This method is not currently used. A pointer to a value that receives the flags for the item. If no flags are to be returned, this value should be set to zero. Returns S_OK if pdwFlags returns any flag values, or a COM-defined error value otherwise. Exposes a method that initializes Shell extensions for property sheets, shortcut menus, and drag-and-drop handlers (extensions that add items to shortcut menus during nondefault drag-and-drop operations). Initializes a property sheet extension, shortcut menu extension, or drag-and-drop handler. A pointer to an ITEMIDLIST structure that uniquely identifies a folder. For property sheet extensions, this parameter is NULL. For shortcut menu extensions, it is the item identifier list for the folder that contains the item whose shortcut menu is being displayed. For nondefault drag-and-drop menu extensions, this parameter specifies the target folder. A pointer to an IDataObject interface object that can be used to retrieve the objects being acted upon. The registry key for the file object or folder type. Exposes methods that allow a property sheet handler to add or replace pages in the property sheet displayed for a file object. Adds one or more pages to a property sheet that the Shell displays for a file object. The Shell calls this method for each property sheet handler registered to the file type. A pointer to a function that the property sheet handler calls to add a page to the property sheet. The function takes a property sheet handle returned by the CreatePropertySheetPage function and the lParam parameter passed to this method. Handler-specific data to pass to the function pointed to by pfnAddPage. If successful, returns a one-based index to specify the page that should be initially displayed. See Remarks for more information. Replaces a page in a property sheet for a Control Panel object. Not used. Microsoft Windows XP and earlier: A type EXPPS identifier of the page to replace. The values for this parameter for Control Panels can be found in the Cplext.h header file. A pointer to a function that the property sheet handler calls to replace a page to the property sheet. The function takes a property sheet handle returned by the CreatePropertySheetPage function and the lParam parameter passed to the ReplacePage method. The parameter to pass to the function specified by the pfnReplacePage parameter. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Property sheet callback proc. The window handle. The message. The property sheet page. The return code. Dialog proc. The window handle. The message. The w param. The l param. True if the message was handled. Imports from the win32 kernel32.dll library. Enumerates resource types within a binary module. Starting with Windows Vista, this is typically a language-neutral Portable Executable (LN file), and the enumeration also includes resources from one of the corresponding language-specific resource files (.mui files)—if one exists—that contain localizable language resources. It is also possible to use hModule to specify a .mui file, in which case only that file is searched for resource types. A handle to a module to be searched. This handle must be obtained through LoadLibrary or LoadLibraryEx. A pointer to the callback function to be called for each enumerated resource type. For more information, see the EnumResTypeProc function. An application-defined value passed to the callback function. Returns TRUE if successful; otherwise, FALSE. To get extended error information, call GetLastError. An application-defined callback function used with the EnumResourceTypes and EnumResourceTypesEx functions. It receives resource types. The ENUMRESTYPEPROC type defines a pointer to this callback function. EnumResTypeProc is a placeholder for the application-defined function name. A handle to the module whose executable file contains the resources for which the types are to be enumerated. If this parameter is NULL, the function enumerates the resource types in the module used to create the current process. The type of resource for which the type is being enumerated. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the integer identifier of the given resource type. For standard resource types, see Resource Types. For more information, see the Remarks section below. An application-defined parameter passed to the EnumResourceTypes or EnumResourceTypesEx function. This parameter can be used in error checking. Returns TRUE to continue enumeration or FALSE to stop enumeration. An application-defined callback function used with the EnumResourceNames and EnumResourceNamesEx functions. It receives the type and name of a resource. The ENUMRESNAMEPROC type defines a pointer to this callback function. EnumResNameProc is a placeholder for the application-defined function name. A handle to the module whose executable file contains the resources that are being enumerated. If this parameter is NULL, the function enumerates the resource names in the module used to create the current process. The type of resource for which the name is being enumerated. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type. For standard resource types, see Resource Types. For more information, see the Remarks section below. The name of a resource of the type being enumerated. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the integer identifier of the resource. For more information, see the Remarks section below. An application-defined parameter passed to the EnumResourceNames or EnumResourceNamesEx function. This parameter can be used in error checking. Returns TRUE to continue enumeration or FALSE to stop enumeration. Enumerates resources of a specified type within a binary module. For Windows Vista and later, this is typically a language-neutral Portable Executable (LN file), and the enumeration will also include resources from the corresponding language-specific resource files (.mui files) that contain localizable language resources. It is also possible for hModule to specify an .mui file, in which case only that file is searched for resources. A handle to a module to be searched. Starting with Windows Vista, if this is an LN file, then appropriate .mui files (if any exist) are included in the search. If this parameter is NULL, that is equivalent to passing in a handle to the module used to create the current process. The type of the resource for which the name is being enumerated. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type. For a list of predefined resource types, see Resource Types. For more information, see A pointer to the callback function to be called for each enumerated resource name or ID. For more information, see EnumResNameProc. An application-defined value passed to the callback function. This parameter can be used in error checking. Loads the specified module into the address space of the calling process. The specified module may cause other modules to be loaded. For additional load options, use the LoadLibraryEx function. The name of the module. This can be either a library module (a .dll file) or an executable module (an .exe file). The name specified is the file name of the module and is not related to the name stored in the library module itself, as specified by the LIBRARY keyword in the module-definition (.def) file. If the string specifies a full path, the function searches only that path for the module. If the string specifies a relative path or a module name without a path, the function uses a standard search strategy to find the module; for more information, see the Remarks. If the function cannot find the module, the function fails.When specifying a path, be sure to use backslashes (), not forward slashes (/). For more information about paths, see Naming a File or Directory. If the string specifies a module name without a path and the file name extension is omitted, the function appends the default library extension .dll to the module name.To prevent the function from appending .dll to the module name, include a trailing point character (.) in the module name string. If the function succeeds, the return value is a handle to the module. If the function fails, the return value is NULL.To get extended error information, call GetLastError. Loads the specified module into the address space of the calling process. The specified module may cause other modules to be loaded. Loads the specified module into the address space of the calling process. The specified module may cause other modules to be loaded. This parameter is reserved for future use. It must be NULL. The action to be taken when loading the module. If no flags are specified, the behavior of this function is identical to that of the LoadLibrary function. Loads the specified module into the address space of the calling process. The specified module may cause other modules to be loaded. A handle to the DLL module that contains the function or variable. The LoadLibrary, LoadLibraryEx, LoadPackagedLibrary, or GetModuleHandle function returns this handle. The GetProcAddress function does not retrieve addresses from modules that were loaded using the LOAD_LIBRARY_AS_DATAFILE flag.For more information, see LoadLibraryEx. The function or variable name, or the function's ordinal value. If this parameter is an ordinal value, it must be in the low-order word; the high-order word must be zero. If the function succeeds, the return value is the address of the exported function or variable If the function fails, the return value is NULL.To get extended error information, call GetLastError. Copies a block of memory from one location to another A pointer to the starting address of the copied block's destination. A pointer to the starting address of the block of memory to copy. The size of the block of memory to copy, in bytes. Frees the loaded dynamic-link library (DLL) module and, if necessary, decrements its reference count. When the reference count reaches zero, the module is unloaded from the address space of the calling process and the handle is no longer valid. A handle to the loaded library module. The LoadLibrary, LoadLibraryEx, GetModuleHandle, or GetModuleHandleEx function returns this handle. If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.To get extended error information, call the GetLastError function. Determines the location of a resource with the specified type and name in the specified module. To specify a language, use the FindResourceEx function. A handle to the module whose portable executable file or an accompanying MUI file contains the resource. If this parameter is NULL, the function searches the module used to create the current process. The name of the resource. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the integer identifier of the resource. For more information, see the Remarks section below. The resource type. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the integer identifier of the given resource type. For standard resource types, see Resource Types.For more information, see the Remarks section below. If the function succeeds, the return value is a handle to the specified resource's information block. To obtain a handle to the resource, pass this handle to the LoadResource function. If the function fails, the return value is NULL.To get extended error information, call GetLastError. Retrieves a handle that can be used to obtain a pointer to the first byte of the specified resource in memory. A handle to the module whose executable file contains the resource.If hModule is NULL, the system loads the resource from the module that was used to create the current process. A handle to the resource to be loaded. This handle is returned by the FindResource or FindResourceEx function. If the function succeeds, the return value is a handle to the data associated with the resource. If the function fails, the return value is NULL.To get extended error information, call GetLastError. Retrieves a pointer to the specified resource in memory. A handle to the resource to be accessed. The LoadResource function returns this handle. Note that this parameter is listed as an HGLOBAL variable only for backward compatibility. Do not pass any value as a parameter other than a successful return value from the LoadResource function. If the loaded resource is available, the return value is a pointer to the first byte of the resource; otherwise, it is NULL. Retrieves a handle to the default heap of the calling process. This handle can then be used in subsequent calls to the heap functions. If the function succeeds, the return value is a handle to the calling process's heap. If the function fails, the return value is NULL.To get extended error information, call GetLastError. Allocates a block of memory from a heap. The allocated memory is not movable. A handle to the heap from which the memory will be allocated. This handle is returned by the HeapCreate or GetProcessHeap function. The heap allocation options. Specifying any of these values will override the corresponding value specified when the heap was created with HeapCreate. The number of bytes to be allocated. If the heap specified by the hHeap parameter is a "non-growable" heap, dwBytes must be less than 0x7FFF8. You create a non-growable heap by calling the HeapCreate function with a nonzero value. If the function succeeds, the return value is a pointer to the allocated memory block. If the function fails and you have not specified HEAP_GENERATE_EXCEPTIONS, the return value is NULL. Frees a memory block allocated from a heap by the HeapAlloc or HeapReAlloc function. A handle to the heap whose memory block is to be freed. This handle is returned by either the HeapCreate or GetProcessHeap function. The heap free options. Specifying the following value overrides the corresponding value specified in the flOptions parameter when the heap was created by using the HeapCreate function. A pointer to the memory block to be freed. This pointer is returned by the HeapAlloc or HeapReAlloc function. If this pointer is NULL, the behavior is undefined. If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.An application can call GetLastError for extended error information. Retrieves the size, in bytes, of the specified resource A handle to the module whose executable file contains the resource. A handle to the resource. This handle must be created by using the FindResource or FindResourceEx function. If the function succeeds, the return value is the number of bytes in the resource. If the function fails, the return value is zero.To get extended error information, call GetLastError. This parameter can be one of the following values. No values. If this value is used, and the executable module is a DLL, the system does not call DllMain for process and thread initialization and termination. Also, the system does not load additional executable modules that are referenced by the specified module. Note Do not use this value; it is provided only for backward compatibility. If you are planning to access only data or resources in the DLL, use LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE or LOAD_LIBRARY_AS_IMAGE_RESOURCE or both. Otherwise, load the library as a DLL or executable module using the LoadLibrary function. If this value is used, the system does not check AppLocker rules or apply Software Restriction Policies for the DLL. This action applies only to the DLL being loaded and not to its dependencies. This value is recommended for use in setup programs that must run extracted DLLs during installation. Windows Server 2008 R2 and Windows 7: On systems with KB2532445 installed, the caller must be running as "LocalSystem" or "TrustedInstaller"; otherwise the system ignores this flag. For more information, see "You can circumvent AppLocker rules by using an Office macro on a computer that is running Windows 7 or Windows Server 2008 R2" in the Help and Support Knowledge Base at http://support.microsoft.com/kb/2532445. Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: AppLocker was introduced in Windows 7 and Windows Server 2008 R2. If this value is used, the system maps the file into the calling process's virtual address space as if it were a data file. Nothing is done to execute or prepare to execute the mapped file. Therefore, you cannot call functions like GetModuleFileName, GetModuleHandle or GetProcAddress with this DLL. Using this value causes writes to read-only memory to raise an access violation. Use this flag when you want to load a DLL only to extract messages or resources from it. This value can be used with LOAD_LIBRARY_AS_IMAGE_RESOURCE. For more information, see Remarks. Similar to LOAD_LIBRARY_AS_DATAFILE, except that the DLL file is opened with exclusive write access for the calling process. Other processes cannot open the DLL file for write access while it is in use. However, the DLL can still be opened by other processes. This value can be used with LOAD_LIBRARY_AS_IMAGE_RESOURCE. For more information, see Remarks. Windows Server 2003 and Windows XP: This value is not supported until Windows Vista. If this value is used, the system maps the file into the process's virtual address space as an image file. However, the loader does not load the static imports or perform the other usual initialization steps. Use this flag when you want to load a DLL only to extract messages or resources from it. Unless the application depends on the file having the in-memory layout of an image, this value should be used with either LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE or LOAD_LIBRARY_AS_DATAFILE. For more information, see the Remarks section. Windows Server 2003 and Windows XP: This value is not supported until Windows Vista. If this value is used, the application's installation directory is searched for the DLL and its dependencies. Directories in the standard search path are not searched. This value cannot be combined with LOAD_WITH_ALTERED_SEARCH_PATH. Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server 2008: This value requires KB2533623 to be installed. Windows Server 2003 and Windows XP: This value is not supported. This value is a combination of LOAD_LIBRARY_SEARCH_APPLICATION_DIR, LOAD_LIBRARY_SEARCH_SYSTEM32, and LOAD_LIBRARY_SEARCH_USER_DIRS. Directories in the standard search path are not searched. This value cannot be combined with LOAD_WITH_ALTERED_SEARCH_PATH. This value represents the recommended maximum number of directories an application should include in its DLL search path. Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server 2008: This value requires KB2533623 to be installed. Windows Server 2003 and Windows XP: This value is not supported. If this value is used, the directory that contains the DLL is temporarily added to the beginning of the list of directories that are searched for the DLL's dependencies. Directories in the standard search path are not searched. The lpFileName parameter must specify a fully qualified path. This value cannot be combined with LOAD_WITH_ALTERED_SEARCH_PATH. For example, if Lib2.dll is a dependency of C:\Dir1\Lib1.dll, loading Lib1.dll with this value causes the system to search for Lib2.dll only in C:\Dir1. To search for Lib2.dll in C:\Dir1 and all of the directories in the DLL search path, combine this value with LOAD_LIBRARY_DEFAULT_DIRS Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server 2008: This value requires KB2533623 to be installed. Windows Server 2003 and Windows XP: This value is not supported. If this value is used, %windows%\system32 is searched for the DLL and its dependencies. Directories in the standard search path are not searched. This value cannot be combined with LOAD_WITH_ALTERED_SEARCH_PATH. Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server 2008: This value requires KB2533623 to be installed. Windows Server 2003 and Windows XP: This value is not supported. If this value is used, directories added using the AddDllDirectory or the SetDllDirectory function are searched for the DLL and its dependencies. If more than one directory has been added, the order in which the directories are searched is unspecified. Directories in the standard search path are not searched. This value cannot be combined with LOAD_WITH_ALTERED_SEARCH_PATH. Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server 2008: This value requires KB2533623 to be installed. Windows Server 2003 and Windows XP: This value is not supported. If this value is used and lpFileName specifies an absolute path, the system uses the alternate file search strategy discussed in the Remarks section to find associated executable modules that the specified module causes to be loaded. If this value is used and lpFileName specifies a relative path, the behavior is undefined. If this value is not used, or if lpFileName does not specify a path, the system uses the standard search strategy discussed in the Remarks section to find associated executable modules that the specified module causes to be loaded. This value cannot be combined with any LOAD_LIBRARY_SEARCH flag. Contains information about a menu item. The size of the structure, in bytes. The caller must set this member to sizeof(MENUITEMINFO). Indicates the members to be retrieved or set. The menu item type. The menu item state. An application-defined value that identifies the menu item. Set fMask to MIIM_ID to use wID. A handle to the drop-down menu or submenu associated with the menu item. If the menu item is not an item that opens a drop-down menu or submenu, this member is NULL. Set fMask to MIIM_SUBMENU to use hSubMenu. A handle to the bitmap to display next to the item if it is selected. If this member is NULL, a default bitmap is used. If the MFT_RADIOCHECK type value is specified, the default bitmap is a bullet. Otherwise, it is a check mark. Set fMask to MIIM_CHECKMARKS to use hbmpChecked. A handle to the bitmap to display next to the item if it is not selected. If this member is NULL, no bitmap is used. Set fMask to MIIM_CHECKMARKS to use hbmpUnchecked. An application-defined value associated with the menu item. Set fMask to MIIM_DATA to use dwItemData. The contents of the menu item. The meaning of this member depends on the value of fType and is used only if the MIIM_TYPE flag is set in the fMask member. The length of the menu item text, in characters, when information is received about a menu item of the MFT_STRING type. However, cch is used only if the MIIM_TYPE flag is set in the fMask member and is zero otherwise. Also, cch is ignored when the content of a menu item is set by calling SetMenuItemInfo. A handle to the bitmap to be displayed, or it can be one of the values in the following table. It is used when the MIIM_BITMAP flag is set in the fMask member. Indicates that the menu item is enabled and restored from a grayed state so that it can be selected. Indicates that the menu item is disabled and grayed so that it cannot be selected. Indicates that the menu item is disabled, but not grayed, so it cannot be selected. Ole32 imports. Releases the STG medium. The pmedium. Coes the create instance. The rclsid. The p unk outer. The dw CLS context. The riid. The r returned COM object. The POINT structure defines the x- and y- coordinates of a point. The x-coordinate of the point. The y-coordinate of the point. Defines a page in a property sheet. Size, in bytes, of this structure. Flags that indicate which options to use when creating the property sheet page. This member can be a combination of the following values. Handle to the instance from which to load an icon or string resource. If the pszIcon, pszTitle, pszHeaderTitle, or pszHeaderSubTitle member identifies a resource to load, hInstance must be specified. Dialog box template to use to create the page. This member can specify either the resource identifier of the template or the address of a string that specifies the name of the template. If the PSP_DLGINDIRECT flag in the dwFlags member is set, pszTemplate is ignored. This member is declared as a union with pResource. Handle to the icon to use as the icon in the tab of the page. If the dwFlags member does not include PSP_USEHICON, this member is ignored. This member is declared as a union with pszIcon. Title of the property sheet dialog box. This title overrides the title specified in the dialog box template. This member can specify either the identifier of a string resource or the address of a string that specifies the title. To use this member, you must set the PSP_USETITLE flag in the dwFlags member. Pointer to the dialog box procedure for the page. Because the pages are created as modeless dialog boxes, the dialog box procedure must not call the EndDialog function. When the page is created, a copy of the page's PROPSHEETPAGE structure is passed to the dialog box procedure with a WM_INITDIALOG message. The lParam member is provided to allow you to pass application-specific information to the dialog box procedure. It has no effect on the page itself. For more information, see Property Sheet Creation. Pointer to an application-defined callback function that is called when the page is created and when it is about to be destroyed. For more information about the callback function, see PropSheetPageProc. To use this member, you must set the PSP_USECALLBACK flag in the dwFlags member. Pointer to the reference count value. To use this member, you must set the PSP_USEREFPARENT flag in the dwFlags member. Version 5.80 or later. Title of the header area. To use this member under the Wizard97-style wizard, you must also do the following: Set the PSP_USEHEADERTITLE flag in the dwFlags member. Set the PSH_WIZARD97 flag in the dwFlags member of the page's PROPSHEETHEADER structure. Make sure that the PSP_HIDEHEADER flag in the dwFlags member is not set. Version 5.80. Subtitle of the header area. To use this member, you must do the following: Set the PSP_USEHEADERSUBTITLE flag in the dwFlags member. Set the PSH_WIZARD97 flag in the dwFlags member of the page's PROPSHEETHEADER structure. Make sure that the PSP_HIDEHEADER flag in the dwFlags member is not set. Note This member is ignored when using the Aero-style wizard (PSH_AEROWIZARD). Action flag. Version 5.80 or later. A page is being created. The return value is not used. A page is being destroyed. The return value is ignored. A dialog box for a page is being created. Return nonzero to allow it to be created, or zero to prevent it. Methods imported from Shell32.dll. Retrieves the names of dropped files that result from a successful drag-and-drop operation. Identifier of the structure that contains the file names of the dropped files. Index of the file to query. If the value of this parameter is 0xFFFFFFFF, DragQueryFile returns a count of the files dropped. If the value of this parameter is between zero and the total number of files dropped, DragQueryFile copies the file name with the corresponding value to the buffer pointed to by the lpszFile parameter. The address of a buffer that receives the file name of a dropped file when the function returns. This file name is a null-terminated string. If this parameter is NULL, DragQueryFile returns the required size, in characters, of this buffer. The size, in characters, of the lpszFile buffer. A nonzero value indicates a successful call. Performs an operation on a specified file. A pointer to a SHELLEXECUTEINFO structure that contains and receives information about the application being executed. Returns TRUE if successful; otherwise, FALSE. Call GetLastError for extended error information. Retrieves the path of a known folder as an ITEMIDLIST structure. A reference to the KNOWNFOLDERID that identifies the folder. The folders associated with the known folder IDs might not exist on a particular system. Flags that specify special retrieval options. This value can be 0; otherwise, it is one or more of the KNOWN_FOLDER_FLAG values. An access token used to represent a particular user. This parameter is usually set to NULL, in which case the function tries to access the current user's instance of the folder. When this method returns, contains a pointer to the PIDL of the folder. This parameter is passed uninitialized. The caller is responsible for freeing the returned PIDL when it is no longer needed by calling ILFree. Returns S_OK if successful, or an error value otherwise, including the following: Retrieves the full path of a known folder identified by the folder's KNOWNFOLDERID. A reference to the KNOWNFOLDERID that identifies the folder. The folders associated with the known folder IDs might not exist on a particular system. Flags that specify special retrieval options. This value can be 0; otherwise, it is one or more of the KNOWN_FOLDER_FLAG values. An access token used to represent a particular user. This parameter is usually set to NULL, in which case the function tries to access the current user's instance of the folder. When this method returns, contains the address of a pointer to a null-terminated Unicode string that specifies the path of the known folder. The calling process is responsible for freeing this resource once it is no longer needed by calling CoTaskMemFree. The returned path does not include a trailing backslash. For example, "C:\Users" is returned rather than "C:\Users\". Returns S_OK if successful, or an error value otherwise, including the following: Frees an ITEMIDLIST structure allocated by the Shell. A pointer to the ITEMIDLIST structure to be freed. This parameter can be NULL. Creates a new instance of the default Shell folder view object (DefView). Pointer to a SFV_CREATE structure that describes the particulars used in creating this instance of the Shell folder view object. When this function returns successfully, contains an interface pointer to the new IShellView object. On failure, this value is NULL. If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Creates a new instance of the default Shell folder view object. It is recommended that you use SHCreateShellFolderView rather than this function. Pointer to a structure that describes the details used in creating this instance of the Shell folder view object. The address of an IShellView interface pointer that, when this function returns successfully, points to the new view object. On failure, this value is NULL. If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves the IShellFolder interface for the desktop folder, which is the root of the Shell's namespace. When this method returns, receives an IShellFolder interface pointer for the desktop folder. The calling application is responsible for eventually freeing the interface by calling its IUnknown::Release method. If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Deprecated. Retrieves the path of a folder as an ITEMIDLIST structure Reserved. A CSIDL value that identifies the folder to be located. The folders associated with the CSIDLs might not exist on a particular system. An access token that can be used to represent a particular user. Reserved. The address of a pointer to an item identifier list structure that specifies the folder's location relative to the root of the namespace (the desktop). The ppidl parameter is set to NULL on failure. The calling application is responsible for freeing this resource by calling ILFree. Returns S_OK if successful, or an error value otherwise. Converts an item identifier list to a file system path. The address of an item identifier list that specifies a file or directory location relative to the root of the namespace (the desktop). The address of a buffer to receive the file system path. This buffer must be at least MAX_PATH characters in size. Returns TRUE if successful; otherwise, FALSE. Makes a copy of a string in newly allocated memory. A pointer to the null-terminated string to be copied. A pointer to an allocated Unicode string that contains the result. SHStrDup allocates memory for this string with CoTaskMemAlloc. You should free the string with CoTaskMemFree when it is no longer needed. In the case of failure, this value is NULL. Returns S_OK if successful, or a COM error value otherwise. Creates an object that represents the Shell's default context menu implementation. A pointer to a constant DEFCONTEXTMENU structure. Reference to the interface ID of the interface on which to base the object. This is typically the IID of IContextMenu, IContextMenu2, or IContextMenu3. When this method returns, contains the interface pointer requested in riid. If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves an object that implements an IQueryAssociations interface. A pointer to an array of ASSOCIATIONELEMENT structures. The number of elements in the array pointed to by rgClasses. Reference to the desired IID, normally IID_IQueryAssociations. When this method returns, contains the interface pointer requested in riid. This is normally IQueryAssociations. If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Tests whether two ITEMIDLIST structures are equal in a binary comparison. The first ITEMIDLIST structure. The second ITEMIDLIST structure. Returns TRUE if the two structures are equal, FALSE otherwise. Combines two ITEMIDLIST structures. A pointer to the first ITEMIDLIST structure. A pointer to the second ITEMIDLIST structure. This structure is appended to the structure pointed to by pidl1. Returns an ITEMIDLIST containing the combined structures. If you set either pidl1 or pidl2 to NULL, the returned ITEMIDLIST structure is a clone of the non-NULL parameter. Returns NULL if pidl1 and pidl2 are both set to NULL. Clones an ITEMIDLIST structure. A pointer to the ITEMIDLIST structure to be cloned. Returns a pointer to a copy of the ITEMIDLIST structure pointed to by pidl. Retrieves information about an object in the file system, such as a file, folder, directory, or drive root. A pointer to a null-terminated string of maximum length MAX_PATH that contains the path and file name. Both absolute and relative paths are valid. If the uFlags parameter includes the SHGFI_PIDL flag, this parameter must be the address of an ITEMIDLIST (PIDL) structure that contains the list of item identifiers that uniquely identifies the file within the Shell's namespace. The PIDL must be a fully qualified PIDL. Relative PIDLs are not allowed. If the uFlags parameter includes the SHGFI_USEFILEATTRIBUTES flag, this parameter does not have to be a valid file name. The function will proceed as if the file exists with the specified name and with the file attributes passed in the dwFileAttributes parameter. This allows you to obtain information about a file type by passing just the extension for pszPath and passing FILE_ATTRIBUTE_NORMAL in dwFileAttributes. This string can use either short (the 8.3 form) or long file names. A combination of one or more file attribute flags (FILE_ATTRIBUTE_ values as defined in Winnt.h). If uFlags does not include the SHGFI_USEFILEATTRIBUTES flag, this parameter is ignored. A combination of one or more file attribute flags (FILE_ATTRIBUTE_ values as defined in Winnt.h). If uFlags does not include the SHGFI_USEFILEATTRIBUTES flag, this parameter is ignored. A combination of one or more file attribute flags (FILE_ATTRIBUTE_ values as defined in Winnt.h). If uFlags does not include the SHGFI_USEFILEATTRIBUTES flag, this parameter is ignored. A combination of one or more file attribute flags (FILE_ATTRIBUTE_ values as defined in Winnt.h). If uFlags does not include the SHGFI_USEFILEATTRIBUTES flag, this parameter is ignored. A combination of one or more file attribute flags (FILE_ATTRIBUTE_ values as defined in Winnt.h). If uFlags does not include the SHGFI_USEFILEATTRIBUTES flag, this parameter is ignored. Retrieves information about an object in the file system, such as a file, folder, directory, or drive root. A pointer to a null-terminated string of maximum length MAX_PATH that contains the path and file name. Both absolute and relative paths are valid. If the uFlags parameter includes the SHGFI_PIDL flag, this parameter must be the address of an ITEMIDLIST (PIDL) structure that contains the list of item identifiers that uniquely identifies the file within the Shell's namespace. The PIDL must be a fully qualified PIDL. Relative PIDLs are not allowed. If the uFlags parameter includes the SHGFI_USEFILEATTRIBUTES flag, this parameter does not have to be a valid file name. The function will proceed as if the file exists with the specified name and with the file attributes passed in the dwFileAttributes parameter. This allows you to obtain information about a file type by passing just the extension for pszPath and passing FILE_ATTRIBUTE_NORMAL in dwFileAttributes. This string can use either short (the 8.3 form) or long file names. A combination of one or more file attribute flags (FILE_ATTRIBUTE_ values as defined in Winnt.h). If uFlags does not include the SHGFI_USEFILEATTRIBUTES flag, this parameter is ignored. A combination of one or more file attribute flags (FILE_ATTRIBUTE_ values as defined in Winnt.h). If uFlags does not include the SHGFI_USEFILEATTRIBUTES flag, this parameter is ignored. A combination of one or more file attribute flags (FILE_ATTRIBUTE_ values as defined in Winnt.h). If uFlags does not include the SHGFI_USEFILEATTRIBUTES flag, this parameter is ignored. A combination of one or more file attribute flags (FILE_ATTRIBUTE_ values as defined in Winnt.h). If uFlags does not include the SHGFI_USEFILEATTRIBUTES flag, this parameter is ignored. A combination of one or more file attribute flags (FILE_ATTRIBUTE_ values as defined in Winnt.h). If uFlags does not include the SHGFI_USEFILEATTRIBUTES flag, this parameter is ignored. Retrieves an image list. The image type contained in the list. One of the following values: Reference to the image list interface identifier, normally IID_IImageList. When this method returns, contains the interface pointer requested in riid. This is typically IImageList. If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves a pointer to the ITEMIDLIST structure of a special folder. Reserved. A CSIDL value that identifies the folder of interest. A PIDL specifying the folder's location relative to the root of the namespace (the desktop). It is the responsibility of the calling application to free the returned IDList by using CoTaskMemFree. If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Creates a standard icon extractor, whose defaults can be further configured via the IDefaultExtractIconInit interface. A reference to interface ID. The address of IDefaultExtractIconInit interface pointer. If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Creates a data object in a parent folder. A pointer to an ITEMIDLIST (PIDL) of the parent folder that contains the data object. The number of file objects or subfolders specified in the apidl parameter. An array of pointers to constant ITEMIDLIST structures, each of which uniquely identifies a file object or subfolder relative to the parent folder. Each item identifier list must contain exactly one SHITEMID structure followed by a terminating zero. A pointer to interface IDataObject. This parameter can be NULL. Specify pdtInner only if the data object created needs to support additional FORMATETC clipboard formats beyond the default formats it is assigned at creation. Alternatively, provide support for populating the created data object using non-default clipboard formats by calling method IDataObject::SetData and specifying the format in the FORMATETC structure passed in parameter pFormatetc. A reference to the IID of the interface to retrieve through ppv. This must be IID_IDataObject. When this method returns successfully, contains the IDataObject interface pointer requested in riid. If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Notifies the system of an event that an application has performed. An application should use this function if it performs an action that may affect the Shell. Describes the event that has occurred. Typically, only one event is specified at a time. If more than one event is specified, the values contained in the dwItem1 and dwItem2 parameters must be the same, respectively, for all specified events. This parameter can be one or more of the following values: Flags that, when combined bitwise with SHCNF_TYPE, indicate the meaning of the dwItem1 and dwItem2 parameters. The uFlags parameter must be one of the following values. Optional. First event-dependent value. Optional. Second event-dependent value. A file type association has changed. SHCNF_IDLIST must be specified in the uFlags parameter. dwItem1 and dwItem2 are not used and must be NULL. This event should also be sent for registered protocols. Guid for IID_IQueryAssociations. Guid for IID_IShellFolder. Guid for IID_IImageList. Guid for IID_ExtractIconW. Guid for IID_IDataObject. Guid for IID_IContextMenu. Guid for IID_IShellBrowser. Guid for IID_IFolderView. Storage medium for a file. Indicates that, in direct mode, each change to a storage or stream element is written as it occurs. This is the default if neither STGM_DIRECT nor STGM_TRANSACTED is specified. Indicates that, in transacted mode, changes are buffered and written only if an explicit commit operation is called. To ignore the changes, call the Revert method in the IStream, IStorage, or IPropertyStorage interface. The COM compound file implementation of IStorage does not support transacted streams, which means that streams can be opened only in direct mode, and you cannot revert changes to them, however transacted storages are supported. The compound file, stand-alone, and NTFS file system implementations of IPropertySetStorage similarly do not support transacted, simple property sets because these property sets are stored in streams. However, transactioning of nonsimple property sets, which can be created by specifying the PROPSETFLAG_NONSIMPLE flag in the grfFlags parameter of IPropertySetStorage::Create, are supported. Provides a faster implementation of a compound file in a limited, but frequently used, case. For more information, see the Remarks section. Indicates that the object is read-only, meaning that modifications cannot be made. Enables you to save changes to the object, but does not permit access to its data. Enables access and modification of object data. For example, if a stream object is created or opened in this mode, it is possible to call both IStream::Read and IStream::Write. Be aware that this constant is not a simple binary OR operation of the STGM_WRITE and STGM_READ elements. Specifies that subsequent openings of the object are not denied read or write access. If no flag from the sharing group is specified, this flag is assumed. Prevents others from subsequently opening the object in STGM_READ mode. It is typically used on a root storage object. Prevents others from subsequently opening the object for STGM_WRITE or STGM_READWRITE access. In transacted mode, sharing of STGM_SHARE_DENY_WRITE or STGM_SHARE_EXCLUSIVE can significantly improve performance because they do not require snapshots. For more information about transactioning, see the Remarks section. Prevents others from subsequently opening the object in any mode. Be aware that this value is not a simple bitwise OR operation of the STGM_SHARE_DENY_READ and STGM_SHARE_DENY_WRITE values. In transacted mode, sharing of STGM_SHARE_DENY_WRITE or STGM_SHARE_EXCLUSIVE can significantly improve performance because they do not require snapshots. For more information about transactioning, see the Remarks section. Opens the storage object with exclusive access to the most recently committed version. Thus, other users cannot commit changes to the object while you have it open in priority mode. You gain performance benefits for copy operations, but you prevent others from committing changes. Limit the time that objects are open in priority mode. You must specify STGM_DIRECT and STGM_READ with priority mode, and you cannot specify STGM_DELETEONRELEASE. STGM_DELETEONRELEASE is only valid when creating a root object, such as with StgCreateStorageEx. It is not valid when opening an existing root object, such as with StgOpenStorageEx. It is also not valid when creating or opening a subelement, such as with IStorage::OpenStorage. Indicates that the underlying file is to be automatically destroyed when the root storage object is released. This feature is most useful for creating temporary files. This flag can only be used when creating a root object, such as with StgCreateStorageEx. It is not valid when opening a root object, such as with StgOpenStorageEx, or when creating or opening a subelement, such as with IStorage::CreateStream. It is also not valid to use this flag and the STGM_CONVERT flag simultaneously. Indicates that, in transacted mode, a temporary scratch file is usually used to save modifications until the Commit method is called. Specifying STGM_NOSCRATCH permits the unused portion of the original file to be used as work space instead of creating a new file for that purpose. This does not affect the data in the original file, and in certain cases can result in improved performance. It is not valid to specify this flag without also specifying STGM_TRANSACTED, and this flag may only be used in a root open. For more information about NoScratch mode, see the Remarks section. Indicates that an existing storage object or stream should be removed before the new object replaces it. A new object is created when this flag is specified only if the existing object has been successfully removed. Creates the new object while preserving existing data in a stream named "Contents". In the case of a storage object or a byte array, the old data is formatted into a stream regardless of whether the existing file or byte array currently contains a layered storage object. This flag can only be used when creating a root storage object. It cannot be used within a storage object; for example, in IStorage::CreateStream. It is also not valid to use this flag and the STGM_DELETEONRELEASE flag simultaneously. Causes the create operation to fail if an existing object with the specified name exists. In this case, STG_E_FILEALREADYEXISTS is returned. This is the default creation mode; that is, if no other create flag is specified, STGM_FAILIFTHERE is implied. This flag is used when opening a storage object with STGM_TRANSACTED and without STGM_SHARE_EXCLUSIVE or STGM_SHARE_DENY_WRITE. In this case, specifying STGM_NOSNAPSHOT prevents the system-provided implementation from creating a snapshot copy of the file. Instead, changes to the file are written to the end of the file. Unused space is not reclaimed unless consolidation is performed during the commit, and there is only one current writer on the file. When the file is opened in no snapshot mode, another open operation cannot be performed without specifying STGM_NOSNAPSHOT. This flag may only be used in a root open operation. For more information about NoSnapshot mode, see the Remarks section. Supports direct mode for single-writer, multireader file operations. For more information, see the Remarks section. The LoadBitmap function loads the specified bitmap resource from a module's executable file. A handle to the instance of the module whose executable file contains the bitmap to be loaded. A pointer to a null-terminated string that contains the name of the bitmap resource to be loaded. Alternatively, this parameter can consist of the resource identifier in the low-order word and zero in the high-order word. The MAKEINTRESOURCE macro can be used to create this value. If the function succeeds, the return value is the handle to the specified bitmap If the function fails, the return value is NULL. Loads the bitmap. The h instance. Name of the lp bitmap. If the function succeeds, the return value is a handle to the newly loaded icon. If the function fails, the return value is NULL.To get extended error information, call GetLastError. Converts an item identifier list to a file system path. (Note: SHGetPathFromIDList calls the ANSI version, must call SHGetPathFromIDListW for .NET) Address of an item identifier list that specifies a file or directory location relative to the root of the namespace (the desktop). Address of a buffer to receive the file system path. This buffer must be at least MAX_PATH characters in size. Returns TRUE if successful, or FALSE otherwise. Retrieves a handle to the specified window's parent or owner. A handle to the window whose parent window handle is to be retrieved. If the window is a child window, the return value is a handle to the parent window. If the window is a top-level window with the WS_POPUP style, the return value is a handle to the owner window. If the function fails, the return value is NULL. To get extended error information, call GetLastError. Windows Messages Defined in winuser.h from Windows SDK v6.1 Documentation pulled from MSDN. The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore. The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible. The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen. This message is sent first to the window being destroyed and then to the child windows (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist. /// The WM_MOVE message is sent after a window has been moved. The WM_SIZE message is sent to a window after its size has changed. The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately. The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus. The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus. The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed. An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn. An application sends a WM_SETTEXT message to set the text of a window. An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller. An application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with a window. The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function. The WM_CLOSE message is sent as a signal that a window or an application should terminate. The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero. After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message. The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size and position. The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending. The WM_QUIT message indicates a request to terminate an application and is generated when the application calls the PostQuitMessage function. It causes the GetMessage function to return zero. The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting. This message is sent to all top-level windows when a change is made to a system color setting. The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown. An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI. Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message. An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI. Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message. The WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings. The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated. An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources. A message that is sent whenever there is a change in the system time. The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window. The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured. The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function. The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the window is activated, moved, or sized. The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages from other messages sent through the WH_JOURNALPLAYBACK Hook procedure. The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size. Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the Remarks. Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows. The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box. The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue. The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed. The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created. Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data. Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message. Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message. An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text. An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text. An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window. An application sends a WM_GETHOTKEY message to determine the hot key associated with a window. The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The system displays this cursor or icon while the user drags the icon. The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style. Active Accessibility sends the WM_GETOBJECT message to obtain information about an accessible object contained in a server application. Applications never send this message directly. It is sent only by Active Accessibility in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message. The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low. WM_COMMNOTIFY is Obsolete for Win32-Based Applications The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function. The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function. Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended mode. Use: POWERBROADCAST An application sends the WM_COPYDATA message to pass data to another application. The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle. Sent by a common control to its parent window when an event has occurred or the control requires some information. The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately. The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on. Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the application when the user clicks an authorable button. An application initiates a training card by specifying the HELP_TCARD command in a call to the WinHelp function. Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has the keyboard focus, WM_HELP is sent to the currently active window. The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings. Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT messages are sent from a common control to its parent window and from the parent window to the common control. The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the window. The WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of the window's styles. The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed. The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption. An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption. The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created. The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the allocated memory object associated with the window. The WM_NCDESTROY message is sent after the child windows have been destroyed. In contrast, WM_DESTROY is sent before the child windows are destroyed. The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes. The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse. The WM_NCPAINT message is sent to a window when its frame must be painted. The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state. The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types of input it wants to process itself. The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads. The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. The WM_NCXBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. The WM_INPUT_DEVICE_CHANGE message is sent to the window that registered to receive raw input. A window receives this message through its WindowProc function. The WM_INPUT message is sent to the window that is getting raw input. This message filters for keyboard messages. The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed. The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus. The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed. The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut character, and then typing the O key. The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key — that is, a character key that is pressed while the ALT key is down. The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key — that is, a dead key that is pressed while holding down the ALT key. The WM_UNICHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_UNICHAR message contains the character code of the key that was pressed. The WM_UNICHAR message is equivalent to WM_CHAR, but it uses Unicode Transformation Format (UTF)-32, whereas WM_CHAR uses UTF-16. It is designed to send or post Unicode characters to ANSI windows and it can can handle Unicode Supplementary Plane characters. This message filters for keyboard messages. Sent immediately before the IME generates the composition string as a result of a keystroke. A window receives this message through its WindowProc function. Sent to an application when the IME ends composition. A window receives this message through its WindowProc function. Sent to an application when the IME changes composition status as a result of a keystroke. A window receives this message through its WindowProc function. Not documented. The WM_INITDIALOG message is sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures typically use this message to initialize controls and carry out any other initialization tasks that affect the appearance of the dialog box. The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated. A window receives this message when the user chooses a command from the Window menu, clicks the maximize button, minimize button, restore button, close button, or moves the form. You can stop the form from moving by filtering this out. The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function. The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control. The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control. The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed. The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu. The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item. The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu. The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages. The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu item. The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item. The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item. The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed. The WM_MENUCOMMAND message is sent when the user makes a selection from a menu. An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed. An application sends the WM_UPDATEUISTATE message to change the user interface (UI) state for the specified window and all its child windows. An application sends the WM_QUERYUISTATE message to retrieve the user interface (UI) state for a window. The WM_CTLCOLORMSGBOX message is sent to the owner window of a message box before Windows draws the message box. By responding to this message, the owner window can set the text and background colors of the message box by using the given display device context handle. An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control. Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle. The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message. The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the dialog box. By responding to this message, the dialog box can set its text and background colors using the specified display device context handle. The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control. A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control. Use WM_MOUSEFIRST to specify the first mouse message. Use the PeekMessage() Function. The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse. The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it. The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. The WM_MOUSEHWHEEL message is sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it. Use WM_MOUSELAST to specify the last mouse message. Used with PeekMessage() Function. The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place. The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been entered. The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited. The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the menu bar and the system menu. The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position. The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture. The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position. Notifies applications that a power-management event has occurred. Notifies an application of a change to the hardware configuration of a device or the computer. An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window. An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI child window. An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct the client window to activate a different MDI child window. An application sends the WM_MDIRESTORE message to a multiple-document interface (MDI) client window to restore an MDI child window from maximized or minimized size. An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the next or previous child window. An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window. An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of its MDI child windows in a tile format. An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all its child windows in a cascade format. An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized. An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve the handle to the active MDI child window. An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both. The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. The system sends the WM_ENTERSIZEMOVE message regardless of whether the dragging of full windows is enabled. The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns. Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files. An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh the window menu of the MDI frame window. Sent to an application when a window is activated. A window receives this message through its WindowProc function. Sent to an application to notify it of changes to the IME window. A window receives this message through its WindowProc function. Sent by an application to direct the IME window to carry out the requested command. The application uses this message to control the IME window that it has created. To send this message, the application calls the SendMessage function with the following parameters. Sent to an application when the IME window finds no space to extend the area for the composition window. A window receives this message through its WindowProc function. Sent to an application when the operating system is about to change the current IME. A window receives this message through its WindowProc function. Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function. Sent to an application to provide commands and request information. A window receives this message through its WindowProc function. Sent to an application by the IME to notify the application of a key press and to keep message order. A window receives this message through its WindowProc function. Sent to an application by the IME to notify the application of a key release and to keep message order. A window receives this message through its WindowProc function. The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent. The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent. The WM_NCMOUSEHOVER message is posted to a window when the cursor hovers over the nonclient area of the window for the period of time specified in a prior call to TrackMouseEvent. The WM_NCMOUSELEAVE message is posted to a window when the cursor leaves the nonclient area of the window specified in a prior call to TrackMouseEvent. The WM_WTSSESSION_CHANGE message notifies applications of changes in session state. Tablet first. Tablet last. An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format. An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format. An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data in CF_TEXT format. An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if any, from the edit control. An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to an edit control, the previously deleted text is restored or the previously added text is deleted. The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function. The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other applications, the clipboard owner must render data in all the formats it is capable of generating, and place the data on the clipboard by calling the SetClipboardData function. The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard. The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard. The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting. The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The owner should scroll the clipboard image and update the scroll bar values. The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size. The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format. The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain. The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner should scroll the clipboard image and update the scroll bar values. This message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to realize its logical palette when it receives the focus. The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette. This message is sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes its logical palette. This message enables windows that do not have the keyboard focus to realize their logical palettes and update their client areas. The WM_HOTKEY message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key. The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context. The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context. The WM_APPCOMMAND message notifies a window that the user generated an application command event, for example, by clicking an application command button using the mouse or typing an application command key on the keyboard. The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another. Sent when the contents of the clipboard have changed. The system will send a window the WM_DWMCOMPOSITIONCHANGED message to indicate that the availability of desktop composition has changed. WM_DWMNCRENDERINGCHANGED is called when the non-client area rendering status of a window has changed. Only windows that have set the flag DWM_BLURBEHIND.fTransitionOnMaximized to true will get this message. Sent to all top-level windows when the colorization color has changed. WM_DWMWINDOWMAXIMIZEDCHANGE will let you know when a DWM composed window is maximized. You also have to register for this message as well. You'd have other windowd go opaque when this message is sent. Sent to request extended title bar information. A window receives this message through its WindowProc function. The HANDHELDFIRST The HANDHELDLAST The AFXFIRST The AFXLAST The PENWINFIRST The PENWINLAST The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value. The WM_USER constant is used by applications to help define private messages for use by private window classes, usually of the form WM_USER+X, where X is an integer value. An application sends the WM_CPL_LAUNCH message to Windows Control Panel to request that a Control Panel application be started. The WM_CPL_LAUNCHED message is sent when a Control Panel application, started by the WM_CPL_LAUNCH message, has closed. The WM_CPL_LAUNCHED message is sent to the window identified by the wParam parameter of the WM_CPL_LAUNCH message that started the application. WM_SYSTIMER is a well-known yet still undocumented message. Windows uses WM_SYSTIMER for internal actions like scrolling. Create an HRESULT value from component pieces. The severity to be used The facility to be used The error number A HRESULT constructed from the above 3 values Reprents a Shell ID list. Used with the . Prevents a default instance of the class from being created. The ids. Creates an IdList. The ids. Converts an idlist to a parsing string. The id list in parsing string format. Creates an idlist from parsing string format. The string. The idlist represented by the string. Determines whether two idlists are equal. The ID list to compare against. True if the id lists are equal, false otherwise. The ids. Gets the ids. The PidlManager is a class that offers a set of functions for working with PIDLs. For more information on PIDLs, please see: http://msdn.microsoft.com/en-us/library/windows/desktop/cc144090.aspx Decodes the specified pidl. The pidl. A set of Shell IDs. Gets the desktop idlist. The desktop idlist. Converts a Win32 PIDL to a . The PIDL is not freed by the PIDL manager, if it has been allocated by the shell it is the caller's responsibility to manage it. The pidl. An that corresponds to the PIDL. Converts an array of PIDLs to an IdList array. The PIDL array. The count. An IdList array. Converts an IdList to a PIDL. The identifier list. A PIDL Combines two IdLists. The folder identifier list. The folder item identifier list. A new, combined IdList. Deletes the underlying PIDL. The PIDL. Takes a set of PIDLs and creates a PIDL array. The PIDLs. A PIDL array. Gets the display name of the PIDL. The PIDL. The display name of the PIDL. Defines the type of an IdList, which can be relative or absolute. The IdList is absolute. The IdList is relative. A ShellId is a representation of a shell item that makes up an id list. Simply put, a ShellId names a Shell Item uniquely in the context of it's parent Shell Folder. Initializes a new instance of the class. The identifier. Creates a new Shell ID from a string. The string. A new Shell ID from the given string. Creates a Shell ID frm raw data. The data. A new Shell ID from the given data. 'data' cannot be null. 'data' must contain data. Returns a that represents this instance. A that represents this instance. Determines whether the specified , is equal to this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Gets the raw identifier. Gets the length of the identifier. The identifier. Gets the ShellId as a UFT8 string. The ShellId as a UFT8 string. Gets the IdList as an ASCII string. The IdList as an ASCII string. The In-Memory registry implements with a simple in-memory structure. It is designed to support testing scenarios, for example, asserting the ServerRegistrationManager can correctly register differnt types of servers. Initializes a new instance of the class. Adds the given structure to the registry view. Generally used for testing only. The registry view. The structure, which matches the MSDN documentation for shell extensions. Thrown if the structure is malformed. Prints a registry key with the given depth. The key. The depth. The key, printed at the given depth. Prints the specified registry view. Used for functional testing. The registry view. The registry view as a string. An In-Memory registry key. Primarily used for testing scenarios. Initializes a new instance of the class. The registry view. The name. Gets the view for the key. An interface for any type which can provide access to the registry. In most circumstances, the implementation will be . This service exists to support effective testing of registry access. Opens a new that represents the requested key on the local machine with the specified view. The requested registry key. The HKEY to open. The registry view to use. or is invalid. The user does not have the necessary registry rights. The user does not have the permissions required to perform this action. Interface which represents a key-level node in the Windows registry. This class is a registry encapsulation. Retrieves an array of strings that contains all the subkey names. An array of strings that contains the names of the subkeys for the current key. The user does not have the permissions required to read from the key. The being manipulated is closed (closed keys cannot be accessed). The user does not have the necessary registry rights. A system error occurred, for example the current key has been deleted. Retrieves a subkey as read-only. The subkey requested, or null if the operation failed. The name or path of the subkey to open as read-only. is null The is closed (closed keys cannot be accessed). The user does not have the permissions required to read the registry key. Retrieves a specified subkey, and specifies whether write access is to be applied to the key. The subkey requested, or null if the operation failed. Name or path of the subkey to open. Set to true if you need write access to the key. is null. The is closed (closed keys cannot be accessed). The user does not have the permissions required to access the registry key in the specified mode. Retrieves the specified subkey for read or read/write access. The subkey requested, or null if the operation failed. The name or path of the subkey to create or open. One of the enumeration values that specifies whether the key is opened for read or read/write access. is null contains an invalid value. The is closed (closed keys cannot be accessed). The user does not have the permissions required to read the registry key. Retrieves the specified subkey for read or read/write access, requesting the specified access rights. The subkey requested, or null if the operation failed. The name or path of the subkey to create or open. One of the enumeration values that specifies whether the key is opened for read or read/write access. A bitwise combination of enumeration values that specifies the desired security access. is null contains an invalid value. The is closed (closed keys cannot be accessed). includes invalid registry rights values.-or-The user does not have the requested permissions. Retrieves the value associated with the specified name. Returns null if the name/value pair does not exist in the registry. The value associated with , or null if is not found. The name of the value to retrieve. This string is not case-sensitive. The user does not have the permissions required to read from the registry key. The that contains the specified value is closed (closed keys cannot be accessed). The that contains the specified value has been marked for deletion. The user does not have the necessary registry rights. Retrieves the value associated with the specified name. If the name is not found, returns the default value that you provide. The value associated with , with any embedded environment variables left unexpanded, or if is not found. The name of the value to retrieve. This string is not case-sensitive. The value to return if does not exist. The user does not have the permissions required to read from the registry key. The that contains the specified value is closed (closed keys cannot be accessed). The that contains the specified value has been marked for deletion. The user does not have the necessary registry rights. Retrieves the value associated with the specified name and retrieval options. If the name is not found, returns the default value that you provide. The value associated with , processed according to the specified , or if is not found. The name of the value to retrieve. This string is not case-sensitive. The value to return if does not exist. One of the enumeration values that specifies optional processing of the retrieved value. The user does not have the permissions required to read from the registry key. The that contains the specified value is closed (closed keys cannot be accessed). The that contains the specified value has been marked for deletion. is not a valid value; for example, an invalid value is cast to . The user does not have the necessary registry rights. Creates a new subkey or opens an existing subkey for write access. The newly created subkey, or null if the operation failed. If a zero-length string is specified for , the current object is returned. The name or path of the subkey to create or open. This string is not case-sensitive. is null. The user does not have the permissions required to create or open the registry key. The on which this method is being invoked is closed (closed keys cannot be accessed). The cannot be written to; for example, it was not opened as a writable key , or the user does not have the necessary access rights. The nesting level exceeds 510.-or-A system error occurred, such as deletion of the key, or an attempt to create a key in the root. Creates a new subkey or opens an existing subkey for write access, using the specified permission check option. The newly created subkey, or null if the operation failed. If a zero-length string is specified for , the current object is returned. The name or path of the subkey to create or open. This string is not case-sensitive. One of the enumeration values that specifies whether the key is opened for read or read/write access. is null. The user does not have the permissions required to create or open the registry key. contains an invalid value. The on which this method is being invoked is closed (closed keys cannot be accessed). The cannot be written to; for example, it was not opened as a writable key, or the user does not have the necessary access rights. The nesting level exceeds 510.-or-A system error occurred, such as deletion of the key, or an attempt to create a key in the root. Creates a new subkey or opens an existing subkey for write access, using the specified permission check option and registry security. The newly created subkey, or null if the operation failed. If a zero-length string is specified for , the current object is returned. The name or path of the subkey to create or open. This string is not case-sensitive. One of the enumeration values that specifies whether the key is opened for read or read/write access. The access control security for the new key. is null. The user does not have the permissions required to create or open the registry key. contains an invalid value. The on which this method is being invoked is closed (closed keys cannot be accessed). The current cannot be written to; for example, it was not opened as a writable key, or the user does not have the necessary access rights. The nesting level exceeds 510.-or-A system error occurred, such as deletion of the key, or an attempt to create a key in the root. Sets the specified name/value pair. The name of the value to store. The data to be stored. is null. is an unsupported data type. The that contains the specified value is closed (closed keys cannot be accessed). The is read-only, and cannot be written to; for example, the key has not been opened with write access. -or-The object represents a root-level node, and the operating system is Windows Millennium Edition or Windows 98. The user does not have the permissions required to create or modify registry keys. The object represents a root-level node, and the operating system is Windows 2000, Windows XP, or Windows Server 2003. Sets the value of a name/value pair in the registry key, using the specified registry data type. The name of the value to be stored. The data to be stored. The registry data type to use when storing the data. is null. The type of did not match the registry data type specified by , therefore the data could not be converted properly. The that contains the specified value is closed (closed keys cannot be accessed). The is read-only, and cannot be written to; for example, the key has not been opened with write access.-or-The object represents a root-level node, and the operating system is Windows Millennium Edition or Windows 98. The user does not have the permissions required to create or modify registry keys. The object represents a root-level node, and the operating system is Windows 2000, Windows XP, or Windows Server 2003. Deletes a subkey and any child subkeys recursively. The subkey to delete. This string is not case-sensitive. is null. Deletion of a root hive is attempted.-or- does not specify a valid registry subkey. An I/O error has occurred. The user does not have the permissions required to delete the key. The being manipulated is closed (closed keys cannot be accessed). The user does not have the necessary registry rights. Deletes the specified subkey and any child subkeys recursively, and specifies whether an exception is raised if the subkey is not found. The name of the subkey to delete. This string is not case-sensitive. Indicates whether an exception should be raised if the specified subkey cannot be found. If this argument is true and the specified subkey does not exist, an exception is raised. If this argument is false and the specified subkey does not exist, no action is taken. An attempt was made to delete the root hive of the tree.-or- does not specify a valid registry subkey, and is true. is null. The is closed (closed keys cannot be accessed). The user does not have the necessary registry rights. The user does not have the permissions required to delete the key. Retrieves an array of strings that contains all the value names associated with this key. An array of strings that contains the value names for the current key. The user does not have the permissions required to read from the registry key. The being manipulated is closed (closed keys cannot be accessed). The user does not have the necessary registry rights. A system error occurred; for example, the current key has been deleted. Deletes the specified value from this key. The name of the value to delete. is not a valid reference to a value. The user does not have the permissions required to delete the value. The being manipulated is closed (closed keys cannot be accessed). The being manipulated is read-only. Deletes the specified value from this key, and specifies whether an exception is raised if the value is not found. The name of the value to delete. Indicates whether an exception should be raised if the specified value cannot be found. If this argument is true and the specified value does not exist, an exception is raised. If this argument is false and the specified value does not exist, no action is taken. is not a valid reference to a value and is true. -or- is null. The user does not have the permissions required to delete the value. The being manipulated is closed (closed keys cannot be accessed). The being manipulated is read-only. Deletes the specified subkey. The name of the subkey to delete. This string is not case-sensitive. The has child subkeys The parameter does not specify a valid registry key is null The user does not have the permissions required to delete the key. The being manipulated is closed (closed keys cannot be accessed). The user does not have the necessary registry rights. Deletes the specified subkey, and specifies whether an exception is raised if the subkey is not found. The name of the subkey to delete. This string is not case-sensitive. Indicates whether an exception should be raised if the specified subkey cannot be found. If this argument is true and the specified subkey does not exist, an exception is raised. If this argument is false and the specified subkey does not exist, no action is taken. has child subkeys. does not specify a valid registry key, and is true. is null. The user does not have the permissions required to delete the key. The being manipulated is closed (closed keys cannot be accessed). The user does not have the necessary registry rights. Retrieves the name of the key. The absolute (qualified) name of the key. The is closed (closed keys cannot be accessed). This class implements , providing test-able access to the registry. SharpShell should never use the registry directly, it should use IRegistry so that we can test these interactions. A Windows Registry Key. Essentially a wrapper around . Initializes a new instance of the class. The registry key. registryKey Helper class to determine the registration info of specific class. Initializes a new instance of the class. Name of the class. Determines the special registry class. The special registry class, if any. Gets or sets the name of the class. The name of the class. Provides methods for manipulating the file extension classes which may be present in the registry. Gets the class of the given file extension, optionally creating it if it does not exist. The classes key (HKEY_CLASSES_ROOT). The file extension, with a leading dot. if set to true then if no class exists, one will be created. Thrown if the extension is invalid. The Shell Extension Type. None. The shortcut menu handler type. The copyhook handler type. The drag and drop handler type. The property sheet handler type. The column provider handler type. The data handler type. The drop handler type. The icon handler type. The image handler type. The thumbnail image handler type. The infotip handler type. The shell link ANSI type. The shell link unicode type. The structured storage type. The metadata property store type. The metadata property set storage type. The pin to start menu type. The pin to taskbar type. Defines and represents the special registry classes. Not a special class. All files class. All file system objects class. The folder class. The directory class. The directory background class. The drive class. The network class. The network shares class. The network servers class. The printers class. The audio cd class. The DVD class. The registation type. 32 Bit operating system registration. 64 Bit operating system registration. Represents the type of server registration. The Server is partially registered only - there's no process models. It's a native InProc32 server. It's a managed InProc32 server. Represents registration info for a server. Initializes a new instance of the class. Type of the server registation. The server CLSID. The class registrations. Gets the server CLSID. Gets the type of the shell extension. The type of the shell extension. Gets the display name. The display name. Gets the server path. Gets the threading model. Gets the assembly version. Gets the assembly. Gets the class. Gets the runtime version. Gets the codebase path. Gets a value indicating whether this extension is on the approved list. true if this instance is approved; otherwise, false. Gets the type of the server registation. The type of the server registation. Gets the class registrations. The class registrations. THe Server Registration Manager is an object that can be used to help with Server Registration tasks, such as registering, unregistering and checking servers. It will work with SharpShell Server objects or other servers. Installs a SharpShell COM server. The server. Type of the registration. if set to true use code base registration (i.e full assembly path, not the GAC). Uninstalls the server. The server. Type of the registration. True if the server WAS installed and has been uninstalled, false if the server was not found. Registers a SharpShell server. This will create the associations defined by the server's COMServerAssociation attribute. The server. Type of the registration. Unregisters a SharpShell server. This will remove the associations defined by the server's COMServerAssociation attribute. The server. Type of the registration to undo. Enumerates Shell extensions. Type of the registration. The shell extension types. Gets the server registration info. The server. Type of the registration. The ServerRegistrationInfo if the server is registered, otherwise false. Gets the server registration info. The server CLSID. Type of the registration. The ServerRegistrationInfo if the server is registered, otherwise false. Sets the display name of the a COM server. The class identifier. The display name. Type of the registration. Registers the server associations. The server CLSID. Type of the server. Name of the server. The association attributes. Type of the registration. Sets the icon handler default icon, enabling an icon handler extension. The classes key. Name of the class. Unsets the icon handler default icon sharp shell value, restoring the backed up value. The classes key. Name of the class. Unregisters the server associations. The server CLSID. Type of the server. Name of the server. The association attributes. Type of the registration. Creates the class names for associations. Type of the association. The associations. Type of the registration. The class names for the associations. Gets the type of the key for server. Name of the class. Type of the server. Name of the server. Opens the classes key. Type of the registration. The permissions. Opens the classes root. Type of the registration. The classes root key. Gets the value or empty. The key. Name of the value. Approves an extension. The server. Type of the registration. Failed to open the Approved Extensions key. Determines whether an extension is approved. The server CLSID. Type of the registration. true if the extension is approved; otherwise, false. Failed to open the Approved Extensions key. Unapproves an extension. The server. Type of the registration. Failed to open the Approved Extensions key. The classes key name. The InProc32 key name. The value for the net framework servers. The threading model key name. THe assembly key name. The class key name. The runtime version key name. The codebase keyname. The default icon keyname. The default icon backup value name. Simple dependency injection container. Resets all providers. Typically used only for testing. Gets a service of type T. The type of service to get. An instance of the service of type T. Thrown if T is not registered. Registers a service. The service type. Generally this must be the interface type, not the concrete type. The service provider. The InvokeCommandInfo class stores data about an invoked command. It is typically retrieved in a derived class for advanced menu# functionality. Gets the window handle. The window handle. Gets the show command. The show command. The PARGB32 Helper class is used to create Windows Vista PARGB32 bitmaps. Creates a handle to a PARGB32 bitmap from an Icon. The handle to the icon. The iconSize of the icon. A PARGB32 bitmap with the contents of the icon, including transparency. Creates a 32 bit HBITMAP of the specified size. The HDC. The size. The bits. The bitmap handle. True if the bitmap was created successfully. Converts a buffer to PARGB32. The paint buffer handle. The device context handle. The icon handle. The icon size. Determines whether any pixel in an image has an alpha component. Pixel data. The image size. The row length. true if the specified pargb has alpha; otherwise, false. Converts raw image data into PARGB32. The handle to the device context.. The pixel data. The bitmap handle. The image size. The row length. SharpContextMenu is the base class for Shell Context Menu Extensions supported by SharpShell. By providing the implementation of 'CanShowMenu' and 'CreateMenu', derived classes can provide all of the functionality required to create a fully functional shell context menu. Initializes a new instance of the class. Called to query the context menu. The handle to the parent menu. The index of the menu. The first command ID. The last command ID. The flags. An HRESULT indicating success. Called to invoke the comamand. The command info pointer. Saves the invoke command information. if set to true the unicode structure is used. The ici. The iciex. Gets the command string. The idcmd. The uflags. The reserved. The commandstring. The CCH. Enables client objects of the IContextMenu interface to handle messages associated with owner-drawn menu items. The message to be processed. In the case of some messages, such as WM_INITMENUPOPUP, WM_DRAWITEM, WM_MENUCHAR, or WM_MEASUREITEM, the client object being called may provide owner-drawn menu items. Additional message information. The value of this parameter depends on the value of the uMsg parameter. Additional message information. The value of this parameter depends on the value of the uMsg parameter. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Allows client objects of the IContextMenu3 interface to handle messages associated with owner-drawn menu items. The message to be processed. In the case of some messages, such as WM_INITMENUPOPUP, WM_DRAWITEM, WM_MENUCHAR, or WM_MEASUREITEM, the client object being called may provide owner-drawn menu items. Additional message information. The value of this parameter depends on the value of the uMsg parameter. Additional message information. The value of this parameter depends on the value of the uMsg parameter. The address of an LRESULT value that the owner of the menu will return from the message. This parameter can be NULL. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets the current invoke command information. This will only be set when a command is invoked, and will be replaced when the next command is invoked. Determines whether this instance can a shell context show menu, given the specified selected file list. true if this instance should show a shell context menu for the specified file list; otherwise, false. Creates the context menu. This can be a single menu item or a tree of them. The context menu for the shell context menu. Called when the context menu is about to be displayed. This function can be used to customise the context menu based on the items selected. The index of the parent menu item. The lazy context menu strip, only created when we actually need it. The native context menu wrapper. The current invoke command information. The Native Context Menu Wrapper builds a native context menu from a WinForms context menu. It also allows command indexes and verbs back to the original menu items. Resets the native context menu. Builds a native context menu, on to the provided HMENU. The handle to the menu. The first item id. The tool strip menu items. The index of the last item created. Creates the native menu item. The tool strip item. The id. The native menu ite,. Builds the menu item info. The menu item info. The menu item. Builds the menu item info. The menu item info. Tries to invoke the command. The index. True if the command is invoked. Tries to invoke the command. The verb. True if the command is invoked. Map of indexes to commands. Map of verbs to commands. The SharpDataHandler is the base class for SharpShell servers that provide custom Icon Handlers. Gets the data for the selected item. The selected item's path is stored in the SelectedItemPath property. The data for the selected item, or null if there is none. Represents the band options. Gets or sets a value indicating whether to show a band title. true if a title should be shown; otherwise, false. Gets or sets the title. Only shown if is true Gets or sets a value indicating whether the band has variable height. true if the band has variable height; otherwise, false. Gets or sets the vertical sizing increment in pixels. Only used if is true. Gets or sets a value indicating whether to use the background colour of the Band UI. If true, is used as the background colour. Gets or sets a value indicating whether the band has a sunken border. true if the band has a sunken border; otherwise, false. The band is of a fixed size - no grip is shown. Gets or sets a flag indicating whether the band cannot be removed from the container. Gets or sets a flag indicating whether to show a chevron if the band doesn't fit in the given space. Gets or sets a flag indicating whether to always show a gripper. Gets or sets a flag indicating whether the band has no margins. The SharpDeskBand class is the base class for any DeskBand shell extension. Initializes a new instance of the class. The COM site (see IObjectWithSite implementation). The handle to the parent window site. UI-activates or deactivates the object. Indicates if the object is being activated or deactivated. If this value is nonzero, the object is being activated. If this value is zero, the object is being deactivated. A pointer to an MSG structure that contains the message that caused the activation change. This value may be NULL. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Determines if one of the object's windows has the keyboard focus. Returns S_OK if one of the object's windows has the keyboard focus, or S_FALSE otherwise. Enables the object to process keyboard accelerators. The address of an MSG structure that contains the keyboard message that is being translated. Returns S_OK if the accelerator was translated, or S_FALSE otherwise. The custom registration function. Type of the server. Type of the registration. Unable to register a SharpNamespaceExtension as it is missing it's junction point definition. or Cannot open the Virtual Folder NameSpace key. or Failed to create the Virtual Folder NameSpace extension. or Cannot open the class key. or An exception occured creating the ShellFolder key. Customs the unregister function. Type of the server. Type of the registration. Gets the minimum size of the Band UI. This uses the value or if no minimum size is defined. This can be overriden to customise this behaviour. The minimum size of the Band UI. Gets the maximum size of the Band UI. This uses the value or if no maximum size is defined. This can be overriden to customise this behaviour. The minimum size of the Band UI. Called when the band is being removed from explorer. This function should return a new instance of the desk band's user interface, which will simply be a usercontrol. Gets the band options. The band options. See for more details. The lazy desk band provider. The SharpIconHandler is the base class for SharpShell servers that provide custom Icon Handlers. Initializes a new instance of the class. Gets the location and index of an icon. One or more of the following values. This parameter can also be NULL. A pointer to a buffer that receives the icon location. The icon location is a null-terminated string that identifies the file that contains the icon. The size of the buffer, in characters, pointed to by pszIconFile. A pointer to an int that receives the index of the icon in the file pointed to by pszIconFile. A pointer to a UINT value that receives zero or a combination of the following value Extracts an icon image from the specified location. A pointer to a null-terminated string that specifies the icon location. The index of the icon in the file pointed to by pszFile. A pointer to an HICON value that receives the handle to the large icon. This parameter may be NULL. A pointer to an HICON value that receives the handle to the small icon. This parameter may be NULL. The desired size of the icon, in pixels. The low word contains the size of the large icon, and the high word contains the size of the small icon. The size specified can be the width or height. The width of an icon always equals its height. Returns S_OK if the function extracted the icon, or S_FALSE if the calling application should extract the icon. Gets an icon of a specific size from a set of icons. The icon. The size required. The icon that is cloest to the size provided. Gets the icon. if set to true provide a small icon. Size of the icon. The icon for the file. Gets or sets a value indicating whether to force icons from this handler to not be cached by the shell. true if icons mustn't be cached; otherwise, false. The SharpIconHandler is the base class for SharpShell servers that provide custom Icon Handlers. Specifies whether an icon overlay should be added to a Shell object's icon. A Unicode string that contains the fully qualified path of the Shell object. The object's attributes. For a complete list of file attributes and their associated flags, see IShellFolder::GetAttributesOf. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Provides the location of the icon overlay's bitmap. A null-terminated Unicode string that contains the fully qualified path of the file containing the icon. The .dll, .exe, and .ico file types are all acceptable. You must set the ISIOI_ICONFILE flag in pdwFlags if you return a file name. The size of the pwszIconFile buffer, in Unicode characters. Pointer to an index value used to identify the icon in a file that contains multiple icons. You must set the ISIOI_ICONINDEX flag in pdwFlags if you return an index. Pointer to a bitmap that specifies the information that is being returned by the method. This parameter can be one or both of the following values: ISIOI_ICONFILE, ISIOI_ICONINDEX. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Specifies the priority of an icon overlay. The address of a value that indicates the priority of the overlay identifier. Possible values range from zero to 100, with zero the highest priority. Returns S_OK if successful, or a COM error code otherwise. Gets the icon file path, creating the icon file if needed. The icon file path. The custom registration function. Type of the server. Type of the registration. Customs the unregister function. Type of the server. Type of the registration. Creates the temporary icon file path. Called by the system to get the priority, which is used to determine which icon overlay to use if there are multiple handlers. The priority must be between 0 and 100, where 0 is the highest priority. A value between 0 and 100, where 0 is the highest priority. Determines whether an overlay should be shown for the shell item with the path 'path' and the shell attributes 'attributes'. The path for the shell item. This is not necessarily the path to a physical file or folder. The attributes of the shell item. true if this an overlay should be shown for the specified item; otherwise, false. Called to get the icon to show as the overlay icon. The overlay icon. The temporary icon overlay file path. The maximum number of overlay identifiers in Windows. Flags that can be specified for items. Indicates that the item can be copied. Indicates that the item can be moved. Indicates that the item can be linked to. Indicates that the item is storable and can be bound to the storage system. Indicates that the object can be renamed. Indicates that the object can be deleted. Indicates that the object has property sheets. Indicates that the object is a drop target. Indicates that the object is encrypted and is shown in an alternate colour. Indicates the object is 'slow' and should be treated by the shell as such. Indicates that the icon should be shown with a 'ghosted' icon. Indicates that the item is a link or shortcut. Indicates that the item is shared. Indicates that the item is read only. Indicates that the item is hidden. Indicates that item may contain children that are part of the filesystem. Indicates that this item is a shell folder, i.e. it can contain other shell items. Indicates that the object is part of the Windows file system. Indicates that the item may contain sub folders. Indicates that the object is volatile, and the shell shouldn't cache data relating to it. Indicates that the object is removable media. Indicates that the object is compressed and should be shown in an alternative colour. The item has children and is browsed with the default explorer UI. A hint to explorer to show the item bold as it has or is new content. Indicates that the item is a stream and supports binding to a stream. Indicates that the item can contain storage items, either streams or files. Specifies column alignment. Left aligned. Centre aligned. Right aligned. A NamespaceFolderView which uses a custom control. Initializes a new instance of the class. The custom view. The custom view. Creates the shell view. The folder. A shell view. The default shell namespace folder view. Initializes a new instance of the class. The detail columns. The item detail provider. Creates a Shell View from a Shell Folder. The folder. The Shell View for the folder. An error occured creating the default folder view. Gets the columns. The internal list of columns. A provider to get the details of an item. Allows communication between the system folder view object and a system folder view callback object. One of the following notifications. Additional information. Additional information. Additional information. S_OK if the message was handled, E_NOTIMPL if the shell should perform default processing. The context that a Display Name will be used in, see for details. The normal display name. Shown in the context of a parent folder and in the address bar. The out of folder context, meaning that extra information can be shown if needed. For example, a printer might not just show the printer name, but something like "Printer1 on Computer3". The display name as it will be edited by the user. Typically the display name, but this can be different if this makes sense. A ShellNamespaceFolder is a Shell Namespace Item which contains other items. Gets the children. The enumeration flags. The folder children. Gets a view for the folder. A view for the folder. Defines the contract of an object that can provide a context menu for a Shell Namespace Folder. Typically this interface is implemented on classes that also implement and is used in conjunction with . Creates a context menu for a set of folder items. The folder identifier list. The folder item identifier lists. The user may select more than one item before right clicking. A context menu for the item(s). This can be a custom type or more typically a . The interface must be implemented on all types that are shell namespace types, i.e. entities that are folders in explorer or items within them. Gets the shell identifier for this item. The only constraint for this shell identifier is that it must be unique within the parent folder, i.e. there cannot be a sibling with the same identifier. A shell identifier for the item. A shell identifier can be created from raw data with or from a string with . Gets the display name of the item, which may be different for different contexts. The namespace item's display name. Gets the attributes for the shell item. The attributes for the shell item. Gets the icon for a shell item. If none is provided, the system default is used. The icon to use for a shell item. Defines the availability for a namespace extension, either everyone or the current user only. All users can use the namespace extension. Only the current user can use the namespace extension. The is an attribute that must be applied to Sharp Namespace Extensions to specify the location of the extension. Initializes a new instance of the class. The availability. The location. The name. Gets the junction point for a type, if defined. The type. The junction point for a type, or null if one is not defined. Gets the availablity of a junction point. The availablity. Gets or sets the location of a junction point. The location of a junction point. Gets the name of a junction point. The name of a junction point. The Namespace Extension Registration settings are requested by SharpShell to when registering a . All configuration is used only during registration time. Initializes a new instance of the class. If set to true, indicates that verbs associated with folders in the system should not appear in the shortcut menu for this extension. The default value is false. Flags that indicate how an extension behaves with the system. By default, none are set. Gets or sets the tooltip. Gets or sets a value indicating whether to use the assembly icon for the namespace icon. Gets the format identifier. The format identifier. Gets the property identifier. The property identifier. A ShellDetailColumn is used to define a column in a . This class specifies how the column is shown, but also how the property of the shell item that is represented by the detail column is referenced, via it's . Use standard property keys with the constructor that takes a or create custom property keys by manually specifiying the guid for the . Initializes a new instance of the class. The name of the column. The property key. Gets the name of the column. Gets the property key for the column and detail. Gets or sets the column alignment. The default column alignment is left. The column alignment. Gets or sets the average length of the text for items in the column, used to provide an initial size. The default value is 50 characters. The average length of the item. Gets or sets a value indicating whether this column has an image. true if this column has an image; otherwise, false. TODO: replace this with an icon member and set it automatically if the icon is not null. The ShellFolderImpl is used to provide a single location of functionality for the Shell Folder parts of a namespace extension, as well as a namespace extension's child folder (if any). Initializes a new instance of the class. This class must be initialised with a reference to the Shell Namespace Extension that is being used and the target object (which will be an . The namespace extension. The folder that we are acting as an implementation for. Translates the display name of a file object or a folder into an item identifier list. A window handle. The client should provide a window handle if it displays a dialog or message box. Otherwise set hwnd to NULL. Optional. A pointer to a bind context used to pass parameters as inputs and outputs to the parsing function. A null-terminated Unicode string with the display name. A pointer to a ULONG value that receives the number of characters of the display name that was parsed. If your application does not need this information, set pchEaten to NULL, and no value will be returned. When this method returns, contains a pointer to the PIDL for the object. The value used to query for file attributes. If not used, it should be set to NULL. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Allows a client to determine the contents of a folder by creating an item identifier enumeration object and returning its IEnumIDList interface. Return value: error code, if any If user input is required to perform the enumeration, this window handle should be used by the enumeration object as the parent window to take user input. Flags indicating which items to include in the enumeration. For a list of possible values, see the SHCONTF enum. Address that receives a pointer to the IEnumIDList interface of the enumeration object created by this method. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves an IShellFolder object for a subfolder. Return value: error code, if any Address of an ITEMIDLIST structure (PIDL) that identifies the subfolder. Optional address of an IBindCtx interface on a bind context object to be used during this operation. Identifier of the interface to return. Address that receives the interface pointer. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Requests a pointer to an object's storage interface. Return value: error code, if any Address of an ITEMIDLIST structure that identifies the subfolder relative to its parent folder. Optional address of an IBindCtx interface on a bind context object to be used during this operation. Interface identifier (IID) of the requested storage interface. Address that receives the interface pointer specified by riid. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Determines the relative order of two file objects or folders, given their item identifier lists. Return value: If this method is successful, the CODE field of the HRESULT contains one of the following values (the code can be retrived using the helper function GetHResultCode): Negative A negative return value indicates that the first item should precede the second (pidl1 < pidl2). Positive A positive return value indicates that the first item should follow the second (pidl1 > pidl2). Zero A return value of zero indicates that the two items are the same (pidl1 = pidl2). Value that specifies how the comparison should be performed. The lower Sixteen bits of lParam define the sorting rule. The upper sixteen bits of lParam are used for flags that modify the sorting rule. values can be from the SHCIDS enum Pointer to the first item's ITEMIDLIST structure. Pointer to the second item's ITEMIDLIST structure. Requests an object that can be used to obtain information from or interact with a folder object. Return value: error code, if any Handle to the owner window. Identifier of the requested interface. Address of a pointer to the requested interface. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves the attributes of one or more file objects or subfolders. Return value: error code, if any Number of file objects from which to retrieve attributes. Address of an array of pointers to ITEMIDLIST structures, each of which uniquely identifies a file object relative to the parent folder. Address of a single ULONG value that, on entry contains the attributes that the caller is requesting. On exit, this value contains the requested attributes that are common to all of the specified objects. this value can be from the SFGAO enum If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves an OLE interface that can be used to carry out actions on the specified file objects or folders. Return value: error code, if any Handle to the owner window that the client should specify if it displays a dialog box or message box. Number of file objects or subfolders specified in the apidl parameter. Address of an array of pointers to ITEMIDLIST structures, each of which uniquely identifies a file object or subfolder relative to the parent folder. Identifier of the COM interface object to return. Reserved. Pointer to the requested interface. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Provides a default IExtractIcon implementation. if set to true use a folder icon, otherwise use an item icon. The interface pointer. Retrieves the display name for the specified file object or subfolder. Return value: error code, if any Address of an ITEMIDLIST structure (PIDL) that uniquely identifies the file object or subfolder relative to the parent folder. Flags used to request the type of display name to return. For a list of possible values. Address of a STRRET structure in which to return the display name. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the display name of a file object or subchanging the item identifier in the process. Return value: error code, if any Handle to the owner window of any dialog or message boxes that the client displays. Pointer to an ITEMIDLIST structure that uniquely identifies the file object or subfolder relative to the parent folder. Pointer to a null-terminated string that specifies the new display name. Flags indicating the type of name specified by the lpszName parameter. For a list of possible values, see the description of the SHGNO enum. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets the class identifier. The p class identifier. Gets the ITEMIDLIST for the folder object. The address of an ITEMIDLIST pointer. This PIDL represents the absolute location of the folder and must be relative to the desktop. This is typically a copy of the PIDL passed to Initialize. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. If the folder object has not been initialized, this method returns S_FALSE and ppidl is set to NULL. The namespace extension that we are either a proxy for or that is that parent of a folder we are a proxy for. The shell folder that we are providing an implementation for. The lazy folder view. Initialised when required from the IShellNamespaceFolder object. The absolute ID list of the folder. This is provided by IPersistFolder. ShellNamespaceEnumerationFlags for an enumeration of shell items. The enumeration must include folders. The enumeration must include items. A base class for a Shell Namespace Folder View. Creates a Shell View from a Shell Folder. The folder. The Shell View for the folder. The ShellViewHost is the window created in the to host custom shell views. Destroys the view window. Returns a success code if successful, or a COM error code otherwise. Specifies the registry key for an enumeration member. Initializes a new instance of the class. The registry key. Gets the registry key for an enumeration member, or null if it is not set. The enumeration member. The registry key attribute for the member, or null if it is not set. Gets the registry key. The registry key. A is a SharpShell implemented Shell Namespace Extension. This is the base class for all Shell Namespace Extensions. Initializes a new instance of the class. Translates the display name of a file object or a folder into an item identifier list. A window handle. The client should provide a window handle if it displays a dialog or message box. Otherwise set hwnd to NULL. Optional. A pointer to a bind context used to pass parameters as inputs and outputs to the parsing function. A null-terminated Unicode string with the display name. A pointer to a ULONG value that receives the number of characters of the display name that was parsed. If your application does not need this information, set pchEaten to NULL, and no value will be returned. When this method returns, contains a pointer to the PIDL for the object. The value used to query for file attributes. If not used, it should be set to NULL. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Allows a client to determine the contents of a folder by creating an item identifier enumeration object and returning its IEnumIDList interface. Return value: error code, if any If user input is required to perform the enumeration, this window handle should be used by the enumeration object as the parent window to take user input. Flags indicating which items to include in the enumeration. For a list of possible values, see the SHCONTF enum. Address that receives a pointer to the IEnumIDList interface of the enumeration object created by this method. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves an IShellFolder object for a subfolder. Return value: error code, if any Address of an ITEMIDLIST structure (PIDL) that identifies the subfolder. Optional address of an IBindCtx interface on a bind context object to be used during this operation. Identifier of the interface to return. Address that receives the interface pointer. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Requests a pointer to an object's storage interface. Return value: error code, if any Address of an ITEMIDLIST structure that identifies the subfolder relative to its parent folder. Optional address of an IBindCtx interface on a bind context object to be used during this operation. Interface identifier (IID) of the requested storage interface. Address that receives the interface pointer specified by riid. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Determines the relative order of two file objects or folders, given their item identifier lists. Return value: If this method is successful, the CODE field of the HRESULT contains one of the following values (the code can be retrived using the helper function GetHResultCode): Negative A negative return value indicates that the first item should precede the second (pidl1 < pidl2). Positive A positive return value indicates that the first item should follow the second (pidl1 > pidl2). Zero A return value of zero indicates that the two items are the same (pidl1 = pidl2). Value that specifies how the comparison should be performed. The lower Sixteen bits of lParam define the sorting rule. The upper sixteen bits of lParam are used for flags that modify the sorting rule. values can be from the SHCIDS enum Pointer to the first item's ITEMIDLIST structure. Pointer to the second item's ITEMIDLIST structure. Requests an object that can be used to obtain information from or interact with a folder object. Return value: error code, if any Handle to the owner window. Identifier of the requested interface. Address of a pointer to the requested interface. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves the attributes of one or more file objects or subfolders. Return value: error code, if any Number of file objects from which to retrieve attributes. Address of an array of pointers to ITEMIDLIST structures, each of which uniquely identifies a file object relative to the parent folder. Address of a single ULONG value that, on entry contains the attributes that the caller is requesting. On exit, this value contains the requested attributes that are common to all of the specified objects. this value can be from the SFGAO enum If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves an OLE interface that can be used to carry out actions on the specified file objects or folders. Return value: error code, if any Handle to the owner window that the client should specify if it displays a dialog box or message box. Number of file objects or subfolders specified in the apidl parameter. Address of an array of pointers to ITEMIDLIST structures, each of which uniquely identifies a file object or subfolder relative to the parent folder. Identifier of the COM interface object to return. Reserved. Pointer to the requested interface. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves the display name for the specified file object or subfolder. Return value: error code, if any Address of an ITEMIDLIST structure (PIDL) that uniquely identifies the file object or subfolder relative to the parent folder. Flags used to request the type of display name to return. For a list of possible values. Address of a STRRET structure in which to return the display name. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the display name of a file object or subfolder, changing the item identifier in the process. Return value: error code, if any Handle to the owner window of any dialog or message boxes that the client displays. Pointer to an ITEMIDLIST structure that uniquely identifies the file object or subfolder relative to the parent folder. Pointer to a null-terminated string that specifies the new display name. Flags indicating the type of name specified by the lpszName parameter. For a list of possible values, see the description of the SHGNO enum. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Retrieves the class identifier (CLSID) of the object. A pointer to the location that receives the CLSID on return. The CLSID is a globally unique identifier (GUID) that uniquely represents an object class that defines the code that can manipulate the object's data. If the method succeeds, the return value is S_OK. Otherwise, it is E_FAIL. Instructs a Shell folder object to initialize itself based on the information passed. The address of the ITEMIDLIST (item identifier list) structure that specifies the absolute location of the folder. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets the ITEMIDLIST for the folder object. The address of an ITEMIDLIST pointer. This PIDL represents the absolute location of the folder and must be relative to the desktop. This is typically a copy of the PIDL passed to Initialize. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. If the folder object has not been initialized, this method returns S_FALSE and ppidl is set to NULL. The custom registration function. Type of the server. Type of the registration. Unable to register a SharpNamespaceExtension as it is missing it's junction point definition. or Cannot open the Virtual Folder NameSpace key. or Failed to create the Virtual Folder NameSpace extension. or Cannot open the class key. or An exception occured creating the ShellFolder key. Customs the unregister function. Type of the server. Type of the registration. Gets the registration settings. This function is called only during the initial registration of a shell namespace extension to provide core configuration. Registration settings for the server. Gets the children of the extension. The flags. Only return children that match the flags. The children of the extension. Gets the folder view for the extension. This can be a which uses the standard user interface with customised columns, or a which presents a fully customised user inteface. The folder view for the extension. The shell folder implementation internally used to handle the implementation of the functionality. Internally used class to enumerate the contents of a Sharp Namespace Extension folder. Retrieves the specified number of item identifiers in the enumeration sequence and advances the current position by the number of items retrieved. Number of elements in the array pointed to by the rgelt parameter. Address of an array of ITEMIDLIST pointers that receives the item identifiers. The implementation must allocate these item identifiers using the Shell's allocator (retrieved by the SHGetMalloc function). The calling application is responsible for freeing the item identifiers using the Shell's allocator. Address of a value that receives a count of the item identifiers actually returned in rgelt. The count can be smaller than the value specified in the celt parameter. This parameter can be NULL only if celt is one. Skips over the specified number of elements in the enumeration sequence. Number of item identifiers to skip. Returns to the beginning of the enumeration sequence. Creates a new item enumeration object with the same contents and state as the current one. Address of a pointer to the new enumeration object. The calling application must eventually free the new object by calling its Release member function. The namespace extension that we're enumerating. The enumeration flags. The current index of the enumerator. A VirtualFolder is a location that a Shell Namespace Extension can be hosted. The control panel The desktop The entire network My computer My network places The remote computer The users files Defines metadata for Sharp Preview Handlers. Initializes a new instance of the class. Gets the preview handler attribute for a type, if one is set. If no preview handler is set, null is returned. The type. The preview handler attribute, or null. Disables low IL process isolation. Default is false. By default, preview handlers run in a low integrity level (IL) process for security reasons. You can optionally disable running as a low IL process by setting the following value in the registry. However, it is not recommended to do so. Systems could eventually be configured to reject any process that is not low IL. true if low IL process isolation should be disabled; otherwise, false. Gets or sets the surrogate host type. Changing this from the default of SurrogateHostType.DedicatedPrevhost is not recommended. The surrogate host type. Defines what sort of Surrogate Host will be used to host a preview handler. A dedicated Prevhost.exe process will be used for all instances of this preview handler. This is the safest option as conflicts with .NET Framework versions cannot happen. The standard Prevhost.exe surrogate will be used. Not recommended. A dedicated Prevhost.exe surrogate suitable for hosting 32 bit preview handlers on 64 systems will be used. Not recommended. Base class for preview handler controls. Sets the color of the background, if possible, to coordinate with the windows color scheme. The color. Sets the color of the text, if possible, to coordinate with the windows color scheme. The color. Sets the font, if possible, to coordinate with the windows color scheme. The font. The PreviewHandlerHost is the window created in the preview pane which will hold the derived preview handlers UI. Initializes a new instance of the class. A logic only class which can register a Preview Handler. Unregisters the SharpShell Preview Handler with the given type. Type of the server. Type of the registration. Registers a new AppID pointing to prevhost.exe. The application identifier. Deletes a prevhost application registered for , if it exixsts. The application identifier. Gets the application identifier for server CLSID. This is used when creating a new AppID registration for a dedicate preview handler host. The server CLSID. An AppID for the CLSID. The SharpPreviewHandler is the base class for Shell Preview Handlers implemented with SharpShell. Initializes a new instance of the class. Calls a function on the preview host thread. The action to invoke on the preview host thread. Updates the host, setting the size, parent window and visibility if needed. Updates the size of the controls Initializes a handler with a file path. A pointer to a buffer that contains the file path as a null-terminated Unicode string. One of the following STGM values that indicates the access mode for pszFilePath. STGM_READ or STGM_READWRITE. Retrieves the latest site passed using SetSite. The IID of the interface pointer that should be returned in ppvSite. Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppvSite contains the requested interface pointer to the site last seen in SetSite. The specific interface returned depends on the riid argument—in essence, the two arguments act identically to those in QueryInterface. If the appropriate interface pointer is available, the object must call AddRef on that pointer before returning successfully. If no site is available, or the requested interface is not supported, this method must *ppvSite to NULL and return a failure code. This method returns S_OK on success. Enables a container to pass an object a pointer to the interface for its site. A pointer to the IUnknown interface pointer of the site managing this object. If NULL, the object should call Release on any existing site at which point the object no longer knows its site. This method returns S_OK on success. Retrieves a handle to one of the windows participating in in-place activation (frame, document, parent, or in-place object window). A pointer to a variable that receives the window handle. This method returns S_OK on success. Determines whether context-sensitive help mode should be entered during an in-place activation session. TRUE if help mode should be entered; FALSE if it should be exited. This method returns S_OK if the help mode was entered or exited successfully, depending on the value passed in fEnterMode. Sets the parent window of the previewer window, as well as the area within the parent to be used for the previewer window. A handle to the parent window. A pointer to a RECT defining the area for the previewer. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Directs the preview handler to change the area within the parent hwnd that it draws into. A pointer to a RECT to be used for the preview. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Directs the preview handler to load data from the source specified in an earlier Initialize method call, and to begin rendering to the previewer window. This method can return one of these values. Directs the preview handler to cease rendering a preview and to release all resources that have been allocated based on the item passed in during the initialization. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Directs the preview handler to set focus to itself. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Directs the preview handler to return the HWND from calling the GetFocus Function. When this method returns, contains a pointer to the HWND returned from calling the GetFocus Function from the preview handler's foreground thread. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Directs the preview handler to handle a keystroke passed up from the message pump of the process in which the preview handler is running. A pointer to a window message. If the keystroke message can be processed by the preview handler, the handler will process it and return S_OK. If the preview handler cannot process the keystroke message, it will offer it to the host using TranslateAccelerator. If the host processes the message, this method will return S_OK. If the host does not process the message, this method will return S_FALSE. Sets the background color of the preview handler. A value of type COLORREF to use for the preview handler background. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the font attributes to be used for text within the preview handler. A pointer to a LOGFONTW Structure containing the necessary attributes for the font to use. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Sets the color of the text within the preview handler. A value of type COLORREF to use for the preview handler text color. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error cod The custom registration function. Type of the server. Type of the registration. Customs the unregister function. Type of the server. Type of the registration. DoPreview must create the preview handler user interface and initialize it with data provided by the shell. The preview handler user interface. The preview area. The preview host handle. The preview handler host control. The site provided by the system. The preview handler frame. Gets the selected file path. The preview handler control. Gets or sets a value indicating whether to automatically apply visuals. true if apply visuals automatically; otherwise, false. An exception that can be thrown during server registration. Typically thrown if servers are misconfigured. Initializes a new instance of the class. The message that describes the error. Initializes a new instance of the class. The message. The inner. Initializes a new instance of the class. The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination. The SharpPropertyPage class is the base class for Property Pages used in Shell Property Sheet Extension servers. Logs the specified message. Will include the Shell Extension name and page name if available. The message. Logs the specified message as an error. Will include the Shell Extension name and page name if available. The message. Optional exception details. Gets or sets the page title. The page title. Gets the page icon. Called when the page is initialised. The parent property sheet. Called when the property page is activated. Called when the property page is de-activated or about to be closed. Called when apply is pressed on the property sheet, or the property sheet is dismissed with the OK button. Called when OK is pressed on the property sheet. Called when Cancel is pressed on the property sheet. Called when the cross button on the property sheet is pressed. Called when the property page is being released. Use this to clean up managed and unmanaged resources. Do *not* use it to close window handles - the window will be closed automatically as the sheet closes. Sets the page data changed. if set to true the data has changed and the property sheet should enable the 'Apply' button. Gets or sets the proxy. The proxy. The PropertyPageProxy is the object used to pass data between the shell and the SharpPropertyPage. Prevents a default instance of the class from being created. Logs the specified message. Will include the Shell Extension name and page name if available. The message. Logs the specified message as an error. Will include the Shell Extension name and page name if available. The message. Optional exception details. Initializes a new instance of the class. The parent. The target property page. The WindowProc. Called by the shell and must delegate messages via the proxy to the user control. The h WND. The u message. The w param. The l param. The CallbackProc. Called by the shell to inform of key property page events. The h WND. The u MSG. The PPSP. Creates the property page handle. Sets the data changed state of the parent property sheet, enabling (or disabling) the apply button. if set to true data has changed. The dialog proc. The callback proc. The property sheet handle. The reference count. The property sheet page handle. Gets or sets the parent. The parent. Gets the property page. The property page. Gets the host window handle. The host window handle. SharpPropertySheet is the base class for Shell Property Sheet Extensions supported by SharpShell. Initializes a new instance of the class. Adds the pages. The PFN add page. The l param. If successful, returns a one-based index to specify the page that should be initially displayed. See Remarks for more information. Replaces the page. The u page ID. The LPFN replace page. The l param. Determines whether this instance can show a shell property sheet, given the specified selected file list. true if this instance should show a shell property sheet for the specified file list; otherwise, false. Creates the pages. The property sheet pages. The lazy property sheet pages, only created when we actually need them. Gets the pages. The SharpIconHandler is the base class for SharpShell servers that provide custom Thumbnail Image Handlers. Gets a thumbnail image and alpha type. The maximum thumbnail size, in pixels. The Shell draws the returned bitmap at this size or smaller. The returned bitmap should fit into a square of width and height cx, though it does not need to be a square image. The Shell scales the bitmap to render at lower sizes. For example, if the image has a 6:4 aspect ratio, then the returned bitmap should also have a 6:4 aspect ratio. When this method returns, contains a pointer to the thumbnail image handle. The image must be a DIB section and 32 bits per pixel. The Shell scales down the bitmap if its width or height is larger than the size specified by cx. The Shell always respects the aspect ratio and never scales a bitmap larger than its original size. When this method returns, contains a pointer to one of the following values from the WTS_ALPHATYPE enumeration. If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Gets the thumbnail image for the currently selected item (SelectedItemStream). The width of the image that should be returned. The image for the thumbnail. The ShellExtInitServer is the base class for Shell Extension Servers that implement IShellExtInit. Initializes the shell extension with the parent folder and data object. The pidl of the parent folder. The data object pointer. The handle to the key prog id. The selected item paths. Gets the selected item paths. Gets the folder path. The folder path. The SharpDropHandler is the base class for SharpShell servers that provide custom Drop Handlers. Indicates whether a drop can be accepted, and, if so, the effect of the drop. A pointer to the IDataObject interface on the data object. This data object contains the data being transferred in the drag-and-drop operation. If the drop occurs, this data object will be incorporated into the target. The current state of the keyboard modifier keys on the keyboard. Possible values can be a combination of any of the flags MK_CONTROL, MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON, MK_MBUTTON, and MK_RBUTTON. A POINTL structure containing the current cursor coordinates in screen coordinates. On input, pointer to the value of the pdwEffect parameter of the DoDragDrop function. On return, must contain one of the DROPEFFECT flags, which indicates what the result of the drop operation would be. This method returns S_OK on success. Provides target feedback to the user and communicates the drop's effect to the DoDragDrop function so it can communicate the effect of the drop back to the source. The current state of the keyboard modifier keys on the keyboard. Valid values can be a combination of any of the flags MK_CONTROL, MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON, MK_MBUTTON, and MK_RBUTTON. A POINTL structure containing the current cursor coordinates in screen coordinates. On input, pointer to the value of the pdwEffect parameter of the DoDragDrop function. On return, must contain one of the DROPEFFECT flags, which indicates what the result of the drop operation would be. This method returns S_OK on success. Removes target feedback and releases the data object. This method returns S_OK on success. Incorporates the source data into the target window, removes target feedback, and releases the data object. A pointer to the IDataObject interface on the data object being transferred in the drag-and-drop operation. The current state of the keyboard modifier keys on the keyboard. Possible values can be a combination of any of the flags MK_CONTROL, MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON, MK_MBUTTON, and MK_RBUTTON. A POINTL structure containing the current cursor coordinates in screen coordinates. On input, pointer to the value of the pdwEffect parameter of the DoDragDrop function. On return, must contain one of the DROPEFFECT flags, which indicates what the result of the drop operation would be. This method returns S_OK on success. Checks what operations are available for dragging onto the target with the drag files. The instance containing the event data. Performs the drop. The instance containing the event data. The set of items being dragged. Gets the drag items. PersistFileServer provides a base for SharpShell Servers that must implement IPersistFile (icon handlers, info tip handlers, etc). Retrieves the class identifier (CLSID) of an object. When this method returns, contains a reference to the CLSID. This parameter is passed uninitialized. Checks an object for changes since it was last saved to its current file. S_OK if the file has changed since it was last saved; S_FALSE if the file has not changed since it was last saved. Opens the specified file and initializes an object from the file contents. A zero-terminated string containing the absolute path of the file to open. A combination of values from the STGM enumeration to indicate the access mode in which to open . Saves a copy of the object into the specified file. A zero-terminated string containing the absolute path of the file to which the object is saved. true to used the parameter as the current working file; otherwise false. Notifies the object that it can write to its file. The absolute path of the file where the object was previously saved. Retrieves either the absolute path to the current working file of the object or, if there is no current working file, the default file name prompt of the object. When this method returns, contains the address of a pointer to a zero-terminated string containing the path for the current file, or the default file name prompt (such as *.txt). This parameter is passed uninitialized. Gets the selected item path. The SharpIconHandler is the base class for SharpShell servers that provide custom Icon Handlers. Gets the info tip text for an item. Flags that direct the handling of the item from which you're retrieving the info tip text. This value is commonly zero. The address of a Unicode string pointer that, when this method returns successfully, receives the tip string pointer. Applications that implement this method must allocate memory for ppwszTip by calling CoTaskMemAlloc. Calling applications must call CoTaskMemFree to free the memory when it is no longer needed. Returns S_OK if the function succeeds. If no info tip text is available, ppwszTip is set to NULL. Otherwise, returns a COM-defined error value. Gets the information flags for an item. This method is not currently used. A pointer to a value that receives the flags for the item. If no flags are to be returned, this value should be set to zero. Returns S_OK if pdwFlags returns any flag values, or a COM-defined error value otherwise. Gets info for the selected item (SelectedItemPath). Type of info to return. if set to true, put the info in a single line. Specified info for the selected file. Specifies the type of information requested. The InfoTip - the text that will be shown in the tooltip for the item. Return the name of the item. If the item is a shortcut file, get the info of the shortcut itself. If the item is a shortcut file, get the info of the target of the shortcut. Core interface for SharpShell COM servers. Gets the type of the server. The type of the server. Gets the server CLSID. Gets the display name. The display name. The NativeBridge is an object that wraps the functionality of the SharpShellNativeBridge library. It also automatically extracts the DLL from the manifest resources. Logs the specified message. Will include the Shell Extension name and page name if available. The message. Logs the specified message as an error. Will include the Shell Extension name and page name if available. The message. Optional exception details. Initialises the Native Bridge. True if the initialisation succeeded, otherwise false. Calls the add prop sheet page. The p add prop sheet. The h prop. The l param. Gets the proxy host template. The pointer to the proxy host template. Deinitialises this instance. Gets the name of the bridge manifest resource. The name of the bridge manifest resource. Gets the instance handle. The Instance Handle. The Server Type. No Server Type. A Shell Context Menu. A Shell Property Sheet. A Shell Icon Handler. A Shell Info Tip Handler. A Shell Drop Handler A Shell Icon Overlay Handler. A Shell Preview Handler A Shell Data Handler A Shell Thumbnail Handler A Shell Namespace Extension A Shell Desk Band Extension The SharpShellServer class is the base class for all SharpShellServers. It provides the core standard functionality - registration, unregistration, identity information (as required by ISharpShellServer), MEF contract inheritance and definitions of virtual functions that can be overriden by advanced users to hook into key points in Server Lifecycle. Note that ALL derived classes will Export ISharpShellServer - this is a useful feature as it means that the ServerManager tool (and other tools) can interrogate assemblies via MEF to get information on servers they contain. The COM Register function. Called by regasm to register a COM server in the system. This function will register the server associations defined by the type's COMServerAssociation attributes. The type. The COM Unregister function. Called by regasm to unregister a COM server in the system. This function will unregister the server associations defined by the type's COMServerAssociation attributes. The type. Actually performs registration. The ComRegisterFunction decorated method will call this function internally with the flag appropriate for the operating system processor architecture. However, this function can also be called manually if needed. The type of object to register, this must be a SharpShellServer derived class. Type of the registration. Actually performs unregistration. The ComUnregisterFunction decorated method will call this function internally with the flag appropriate for the operating system processor architecture. However, this function can also be called manually if needed. The type of object to unregister, this must be a SharpShellServer derived class. Type of the registration to unregister. Logs the specified message to the SharpShell log, with the name of the type. The message. Logs the specified message to the SharpShell log as an error, with the name of the type. The message. The exception. Gets a display name for the server. If the [DisplayName] attribute is defined on the type, then the value of this attribute will be used. If not, then the type name will be used. The name of the server. Gets the type of the server. The type of the server. Gets the server CLSID. ================================================ FILE: shell-x.sln ================================================  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.28307.168 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "shell-x", "shell-x\shell-x.csproj", "{B80A4FAA-4C08-4057-B9F0-57FD692BE278}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {B80A4FAA-4C08-4057-B9F0-57FD692BE278}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B80A4FAA-4C08-4057-B9F0-57FD692BE278}.Debug|Any CPU.Build.0 = Debug|Any CPU {B80A4FAA-4C08-4057-B9F0-57FD692BE278}.Release|Any CPU.ActiveCfg = Release|Any CPU {B80A4FAA-4C08-4057-B9F0-57FD692BE278}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {6DE5BDDD-A8EB-47A0-9CED-5F73DD38251E} EndGlobalSection EndGlobal