├── .gitattributes ├── .gitignore ├── DllIconHandler.sln ├── DllIconHandler ├── DllIconHandler.cpp ├── DllIconHandler.def ├── DllIconHandler.idl ├── DllIconHandler.rc ├── DllIconHandler.rgs ├── DllIconHandler.vcxproj ├── DllIconHandler.vcxproj.filters ├── DllIconHandler_i.h ├── DllIconHandlerps.def ├── IconHandler.cpp ├── IconHandler.h ├── IconHandler.rgs ├── Icons │ ├── Dll32.ico │ └── Dll64.ico ├── dllmain.cpp ├── dllmain.h ├── pch.cpp ├── pch.h ├── resource.h └── targetver.h ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd -------------------------------------------------------------------------------- /DllIconHandler.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31825.309 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DllIconHandler", "DllIconHandler\DllIconHandler.vcxproj", "{75D4607B-58F7-479A-AFEE-19D89C933E2D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {75D4607B-58F7-479A-AFEE-19D89C933E2D}.Debug|x64.ActiveCfg = Debug|x64 17 | {75D4607B-58F7-479A-AFEE-19D89C933E2D}.Debug|x64.Build.0 = Debug|x64 18 | {75D4607B-58F7-479A-AFEE-19D89C933E2D}.Debug|x86.ActiveCfg = Debug|Win32 19 | {75D4607B-58F7-479A-AFEE-19D89C933E2D}.Debug|x86.Build.0 = Debug|Win32 20 | {75D4607B-58F7-479A-AFEE-19D89C933E2D}.Release|x64.ActiveCfg = Release|x64 21 | {75D4607B-58F7-479A-AFEE-19D89C933E2D}.Release|x64.Build.0 = Release|x64 22 | {75D4607B-58F7-479A-AFEE-19D89C933E2D}.Release|x86.ActiveCfg = Release|Win32 23 | {75D4607B-58F7-479A-AFEE-19D89C933E2D}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {CF44FC9B-A79A-4B18-869A-9FE32758DD07} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /DllIconHandler/DllIconHandler.cpp: -------------------------------------------------------------------------------- 1 | // DllIconHandler.cpp : Implementation of DLL Exports. 2 | 3 | 4 | #include "pch.h" 5 | #include "resource.h" 6 | #include "DllIconHandler_i.h" 7 | #include "dllmain.h" 8 | 9 | 10 | using namespace ATL; 11 | 12 | // Used to determine whether the DLL can be unloaded by OLE. 13 | _Use_decl_annotations_ 14 | STDAPI DllCanUnloadNow(void) { 15 | return _AtlModule.DllCanUnloadNow(); 16 | } 17 | 18 | // Returns a class factory to create an object of the requested type. 19 | _Use_decl_annotations_ 20 | STDAPI DllGetClassObject(_In_ REFCLSID rclsid, _In_ REFIID riid, _Outptr_ LPVOID* ppv) { 21 | return _AtlModule.DllGetClassObject(rclsid, riid, ppv); 22 | } 23 | 24 | // DllRegisterServer - Adds entries to the system registry. 25 | _Use_decl_annotations_ 26 | STDAPI DllRegisterServer(void) { 27 | // registers object, typelib and all interfaces in typelib 28 | HRESULT hr = _AtlModule.DllRegisterServer(); 29 | return hr; 30 | } 31 | 32 | // DllUnregisterServer - Removes entries from the system registry. 33 | _Use_decl_annotations_ 34 | STDAPI DllUnregisterServer(void) { 35 | HRESULT hr = _AtlModule.DllUnregisterServer(); 36 | return hr; 37 | } 38 | 39 | // DllInstall - Adds/Removes entries to the system registry per user per machine. 40 | STDAPI DllInstall(BOOL bInstall, _In_opt_ LPCWSTR pszCmdLine) { 41 | HRESULT hr = E_FAIL; 42 | static const wchar_t szUserSwitch[] = L"user"; 43 | 44 | if (pszCmdLine != nullptr) { 45 | if (_wcsnicmp(pszCmdLine, szUserSwitch, _countof(szUserSwitch)) == 0) { 46 | ATL::AtlSetPerUserRegistration(true); 47 | } 48 | } 49 | 50 | if (bInstall) { 51 | hr = DllRegisterServer(); 52 | if (FAILED(hr)) { 53 | DllUnregisterServer(); 54 | } 55 | } 56 | else { 57 | hr = DllUnregisterServer(); 58 | } 59 | 60 | return hr; 61 | } 62 | 63 | 64 | -------------------------------------------------------------------------------- /DllIconHandler/DllIconHandler.def: -------------------------------------------------------------------------------- 1 | ; DllIconHandler.def : Declares the module parameters. 2 | 3 | LIBRARY 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllInstall PRIVATE 11 | -------------------------------------------------------------------------------- /DllIconHandler/DllIconHandler.idl: -------------------------------------------------------------------------------- 1 | // DllIconHandler.idl : IDL source for DllIconHandler 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (DllIconHandler.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | 10 | [ 11 | object, 12 | uuid(2d6a2331-a2a2-4e6f-acb6-01143af75404), 13 | pointer_default(unique) 14 | ] 15 | interface IIconHandler : IUnknown { 16 | }; 17 | [ 18 | uuid(a1b4516d-9340-444b-87e2-13317a44eeb1), 19 | version(1.0), 20 | ] 21 | library DllIconHandlerLib 22 | { 23 | importlib("stdole2.tlb"); 24 | [ 25 | uuid(d913f592-08f1-418a-9428-cc33db97ed60) 26 | ] 27 | coclass IconHandler { 28 | [default] interface IIconHandler; 29 | }; 30 | }; 31 | 32 | -------------------------------------------------------------------------------- /DllIconHandler/DllIconHandler.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodiacon/DllIconHandler/cdd02f7e8e8ed2390e5576205200e0f96c4b8172/DllIconHandler/DllIconHandler.rc -------------------------------------------------------------------------------- /DllIconHandler/DllIconHandler.rgs: -------------------------------------------------------------------------------- 1 | HKCR { 2 | NoRemove DllFile { 3 | NoRemove ShellEx { 4 | IconHandler = s '{d913f592-08f1-418a-9428-cc33db97ed60}' 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /DllIconHandler/DllIconHandler.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 17.0 23 | {75D4607B-58F7-479A-AFEE-19D89C933E2D} 24 | AtlProj 25 | 10.0 26 | 27 | 28 | 29 | DynamicLibrary 30 | true 31 | v143 32 | Unicode 33 | 34 | 35 | DynamicLibrary 36 | false 37 | v143 38 | Unicode 39 | 40 | 41 | DynamicLibrary 42 | true 43 | v143 44 | Unicode 45 | 46 | 47 | DynamicLibrary 48 | false 49 | v143 50 | Unicode 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | true 72 | true 73 | 74 | 75 | true 76 | true 77 | 78 | 79 | true 80 | false 81 | 82 | 83 | true 84 | false 85 | 86 | 87 | 88 | Use 89 | Level3 90 | Disabled 91 | _WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions) 92 | pch.h 93 | true 94 | stdcpp17 95 | 96 | 97 | false 98 | _DEBUG;%(PreprocessorDefinitions) 99 | DllIconHandler_i.h 100 | DllIconHandler_i.c 101 | DllIconHandler_p.c 102 | true 103 | $(IntDir)DllIconHandler.tlb 104 | 105 | true 106 | 107 | 108 | 0x0409 109 | $(IntDir);%(AdditionalIncludeDirectories) 110 | _DEBUG;%(PreprocessorDefinitions) 111 | 112 | 113 | Windows 114 | .\DllIconHandler.def 115 | true 116 | true 117 | 118 | 119 | 120 | 121 | Use 122 | Level3 123 | Disabled 124 | WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions) 125 | pch.h 126 | true 127 | stdcpp17 128 | 129 | 130 | false 131 | Win32 132 | _DEBUG;%(PreprocessorDefinitions) 133 | DllIconHandler_i.h 134 | DllIconHandler_i.c 135 | DllIconHandler_p.c 136 | true 137 | $(IntDir)DllIconHandler.tlb 138 | 139 | true 140 | 141 | 142 | 0x0409 143 | $(IntDir);%(AdditionalIncludeDirectories) 144 | _DEBUG;%(PreprocessorDefinitions) 145 | 146 | 147 | Windows 148 | .\DllIconHandler.def 149 | true 150 | true 151 | 152 | 153 | 154 | 155 | Use 156 | Level3 157 | MaxSpeed 158 | WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) 159 | pch.h 160 | true 161 | stdcpp17 162 | 163 | 164 | false 165 | Win32 166 | NDEBUG;%(PreprocessorDefinitions) 167 | DllIconHandler_i.h 168 | DllIconHandler_i.c 169 | DllIconHandler_p.c 170 | true 171 | $(IntDir)DllIconHandler.tlb 172 | 173 | true 174 | 175 | 176 | 0x0409 177 | $(IntDir);%(AdditionalIncludeDirectories) 178 | NDEBUG;%(PreprocessorDefinitions) 179 | 180 | 181 | Windows 182 | .\DllIconHandler.def 183 | true 184 | true 185 | true 186 | true 187 | 188 | 189 | 190 | 191 | Use 192 | Level3 193 | MaxSpeed 194 | _WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) 195 | pch.h 196 | true 197 | stdcpp17 198 | MultiThreaded 199 | 200 | 201 | false 202 | NDEBUG;%(PreprocessorDefinitions) 203 | DllIconHandler_i.h 204 | DllIconHandler_i.c 205 | DllIconHandler_p.c 206 | true 207 | $(IntDir)DllIconHandler.tlb 208 | 209 | true 210 | 211 | 212 | 0x0409 213 | $(IntDir);%(AdditionalIncludeDirectories) 214 | NDEBUG;%(PreprocessorDefinitions) 215 | 216 | 217 | Windows 218 | .\DllIconHandler.def 219 | true 220 | true 221 | true 222 | true 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | false 237 | false 238 | false 239 | false 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | false 251 | false 252 | false 253 | false 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | Create 266 | Create 267 | Create 268 | Create 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | -------------------------------------------------------------------------------- /DllIconHandler/DllIconHandler.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {58633ba1-333c-4a92-9081-ef6f908334ab} 18 | False 19 | 20 | 21 | 22 | 23 | Header Files 24 | 25 | 26 | Header Files 27 | 28 | 29 | Header Files 30 | 31 | 32 | Generated Files 33 | 34 | 35 | Header Files 36 | 37 | 38 | Header Files 39 | 40 | 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Generated Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | 59 | 60 | Resource Files 61 | 62 | 63 | 64 | 65 | Resource Files 66 | 67 | 68 | Source Files 69 | 70 | 71 | Resource Files 72 | 73 | 74 | 75 | 76 | Resource Files 77 | 78 | 79 | Resource Files 80 | 81 | 82 | 83 | 84 | Source Files 85 | 86 | 87 | -------------------------------------------------------------------------------- /DllIconHandler/DllIconHandler_i.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* this ALWAYS GENERATED file contains the definitions for the interfaces */ 4 | 5 | 6 | /* File created by MIDL compiler version 8.01.0628 */ 7 | /* at Mon Jan 18 22:14:07 2038 8 | */ 9 | /* Compiler settings for DllIconHandler.idl: 10 | Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0628 11 | protocol : all , ms_ext, c_ext, robust 12 | error checks: allocation ref bounds_check enum stub_data 13 | VC __declspec() decoration level: 14 | __declspec(uuid()), __declspec(selectany), __declspec(novtable) 15 | DECLSPEC_UUID(), MIDL_INTERFACE() 16 | */ 17 | /* @@MIDL_FILE_HEADING( ) */ 18 | 19 | 20 | 21 | /* verify that the version is high enough to compile this file*/ 22 | #ifndef __REQUIRED_RPCNDR_H_VERSION__ 23 | #define __REQUIRED_RPCNDR_H_VERSION__ 500 24 | #endif 25 | 26 | #include "rpc.h" 27 | #include "rpcndr.h" 28 | 29 | #ifndef __RPCNDR_H_VERSION__ 30 | #error this stub requires an updated version of 31 | #endif /* __RPCNDR_H_VERSION__ */ 32 | 33 | #ifndef COM_NO_WINDOWS_H 34 | #include "windows.h" 35 | #include "ole2.h" 36 | #endif /*COM_NO_WINDOWS_H*/ 37 | 38 | #ifndef __DllIconHandler_i_h__ 39 | #define __DllIconHandler_i_h__ 40 | 41 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 42 | #pragma once 43 | #endif 44 | 45 | #ifndef DECLSPEC_XFGVIRT 46 | #if defined(_CONTROL_FLOW_GUARD_XFG) 47 | #define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) 48 | #else 49 | #define DECLSPEC_XFGVIRT(base, func) 50 | #endif 51 | #endif 52 | 53 | /* Forward Declarations */ 54 | 55 | #ifndef __IIconHandler_FWD_DEFINED__ 56 | #define __IIconHandler_FWD_DEFINED__ 57 | typedef interface IIconHandler IIconHandler; 58 | 59 | #endif /* __IIconHandler_FWD_DEFINED__ */ 60 | 61 | 62 | #ifndef __IconHandler_FWD_DEFINED__ 63 | #define __IconHandler_FWD_DEFINED__ 64 | 65 | #ifdef __cplusplus 66 | typedef class IconHandler IconHandler; 67 | #else 68 | typedef struct IconHandler IconHandler; 69 | #endif /* __cplusplus */ 70 | 71 | #endif /* __IconHandler_FWD_DEFINED__ */ 72 | 73 | 74 | /* header files for imported files */ 75 | #include "oaidl.h" 76 | #include "ocidl.h" 77 | 78 | #ifdef __cplusplus 79 | extern "C"{ 80 | #endif 81 | 82 | 83 | #ifndef __IIconHandler_INTERFACE_DEFINED__ 84 | #define __IIconHandler_INTERFACE_DEFINED__ 85 | 86 | /* interface IIconHandler */ 87 | /* [unique][uuid][object] */ 88 | 89 | 90 | EXTERN_C const IID IID_IIconHandler; 91 | 92 | #if defined(__cplusplus) && !defined(CINTERFACE) 93 | 94 | MIDL_INTERFACE("2d6a2331-a2a2-4e6f-acb6-01143af75404") 95 | IIconHandler : public IUnknown 96 | { 97 | public: 98 | }; 99 | 100 | 101 | #else /* C style interface */ 102 | 103 | typedef struct IIconHandlerVtbl 104 | { 105 | BEGIN_INTERFACE 106 | 107 | DECLSPEC_XFGVIRT(IUnknown, QueryInterface) 108 | HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 109 | IIconHandler * This, 110 | /* [in] */ REFIID riid, 111 | /* [annotation][iid_is][out] */ 112 | _COM_Outptr_ void **ppvObject); 113 | 114 | DECLSPEC_XFGVIRT(IUnknown, AddRef) 115 | ULONG ( STDMETHODCALLTYPE *AddRef )( 116 | IIconHandler * This); 117 | 118 | DECLSPEC_XFGVIRT(IUnknown, Release) 119 | ULONG ( STDMETHODCALLTYPE *Release )( 120 | IIconHandler * This); 121 | 122 | END_INTERFACE 123 | } IIconHandlerVtbl; 124 | 125 | interface IIconHandler 126 | { 127 | CONST_VTBL struct IIconHandlerVtbl *lpVtbl; 128 | }; 129 | 130 | 131 | 132 | #ifdef COBJMACROS 133 | 134 | 135 | #define IIconHandler_QueryInterface(This,riid,ppvObject) \ 136 | ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 137 | 138 | #define IIconHandler_AddRef(This) \ 139 | ( (This)->lpVtbl -> AddRef(This) ) 140 | 141 | #define IIconHandler_Release(This) \ 142 | ( (This)->lpVtbl -> Release(This) ) 143 | 144 | 145 | #endif /* COBJMACROS */ 146 | 147 | 148 | #endif /* C style interface */ 149 | 150 | 151 | 152 | 153 | #endif /* __IIconHandler_INTERFACE_DEFINED__ */ 154 | 155 | 156 | 157 | #ifndef __DllIconHandlerLib_LIBRARY_DEFINED__ 158 | #define __DllIconHandlerLib_LIBRARY_DEFINED__ 159 | 160 | /* library DllIconHandlerLib */ 161 | /* [version][uuid] */ 162 | 163 | 164 | EXTERN_C const IID LIBID_DllIconHandlerLib; 165 | 166 | EXTERN_C const CLSID CLSID_IconHandler; 167 | 168 | #ifdef __cplusplus 169 | 170 | class DECLSPEC_UUID("d913f592-08f1-418a-9428-cc33db97ed60") 171 | IconHandler; 172 | #endif 173 | #endif /* __DllIconHandlerLib_LIBRARY_DEFINED__ */ 174 | 175 | /* Additional Prototypes for ALL interfaces */ 176 | 177 | /* end of Additional Prototypes */ 178 | 179 | #ifdef __cplusplus 180 | } 181 | #endif 182 | 183 | #endif 184 | 185 | 186 | -------------------------------------------------------------------------------- /DllIconHandler/DllIconHandlerps.def: -------------------------------------------------------------------------------- 1 | 2 | LIBRARY 3 | 4 | EXPORTS 5 | DllGetClassObject PRIVATE 6 | DllCanUnloadNow PRIVATE 7 | DllRegisterServer PRIVATE 8 | DllUnregisterServer PRIVATE 9 | -------------------------------------------------------------------------------- /DllIconHandler/IconHandler.cpp: -------------------------------------------------------------------------------- 1 | // IconHandler.cpp : Implementation of CIconHandler 2 | 3 | #include "pch.h" 4 | #include "IconHandler.h" 5 | #include 6 | 7 | #pragma comment(lib, "dbghelp") 8 | 9 | // CIconHandler 10 | 11 | CIconHandler::ModuleBitness CIconHandler::GetModuleBitness(PCWSTR path) { 12 | auto bitness = ModuleBitness::Unknown; 13 | // 14 | // open the DLL as a data file 15 | // 16 | auto hFile = ::CreateFile(path, GENERIC_READ, FILE_SHARE_READ, 17 | nullptr, OPEN_EXISTING, 0, nullptr); 18 | if (hFile == INVALID_HANDLE_VALUE) 19 | return bitness; 20 | 21 | // 22 | // create a memory mapped file to read the PE header 23 | // 24 | auto hMemMap = ::CreateFileMapping(hFile, nullptr, PAGE_READONLY, 0, 0, nullptr); 25 | ::CloseHandle(hFile); 26 | if (!hMemMap) 27 | return bitness; 28 | 29 | // 30 | // map the first page (where the header is located) 31 | // 32 | auto p = ::MapViewOfFile(hMemMap, FILE_MAP_READ, 0, 0, 1 << 12); 33 | if (p) { 34 | auto header = ::ImageNtHeader(p); 35 | if (header) { 36 | bitness = header->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC ? ModuleBitness::Bit64 : ModuleBitness::Bit32; 37 | } 38 | ::UnmapViewOfFile(p); 39 | } 40 | ::CloseHandle(hMemMap); 41 | 42 | return bitness; 43 | } 44 | 45 | HRESULT __stdcall CIconHandler::GetIconLocation(UINT uFlags, PWSTR pszIconFile, UINT cchMax, int* piIndex, UINT* pwFlags) { 46 | if (s_ModulePath[0] == 0) { 47 | ::GetModuleFileName(_pModule->GetModuleInstance(), 48 | s_ModulePath, _countof(s_ModulePath)); 49 | ATLTRACE(L"Module path: %s\n", s_ModulePath); 50 | } 51 | if (s_ModulePath[0] == 0) 52 | return S_FALSE; 53 | 54 | if (m_Bitness == ModuleBitness::Unknown) 55 | return S_FALSE; 56 | 57 | wcscpy_s(pszIconFile, std::min((UINT)wcslen(s_ModulePath) + 1, cchMax), s_ModulePath); 58 | ATLTRACE(L"CIconHandler::GetIconLocation: %s bitness: %d\n", 59 | pszIconFile, m_Bitness); 60 | *piIndex = m_Bitness == ModuleBitness::Bit32 ? 0 : 1; 61 | *pwFlags = GIL_PERINSTANCE; 62 | 63 | return S_OK; 64 | } 65 | 66 | HRESULT __stdcall CIconHandler::Extract(PCWSTR pszFile, UINT nIconIndex, HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize) { 67 | return S_FALSE; 68 | } 69 | 70 | HRESULT __stdcall CIconHandler::GetClassID(CLSID* pClassID) { 71 | return E_NOTIMPL; 72 | } 73 | 74 | HRESULT __stdcall CIconHandler::IsDirty(void) { 75 | return E_NOTIMPL; 76 | } 77 | 78 | HRESULT __stdcall CIconHandler::Load(LPCOLESTR pszFileName, DWORD dwMode) { 79 | ATLTRACE(L"CIconHandler::Load %s\n", pszFileName); 80 | 81 | m_Bitness = GetModuleBitness(pszFileName); 82 | 83 | return S_OK; 84 | } 85 | 86 | HRESULT __stdcall CIconHandler::Save(LPCOLESTR pszFileName, BOOL fRemember) { 87 | return E_NOTIMPL; 88 | } 89 | 90 | HRESULT __stdcall CIconHandler::SaveCompleted(LPCOLESTR pszFileName) { 91 | return E_NOTIMPL; 92 | } 93 | 94 | HRESULT __stdcall CIconHandler::GetCurFile(LPOLESTR* ppszFileName) { 95 | return E_NOTIMPL; 96 | } 97 | -------------------------------------------------------------------------------- /DllIconHandler/IconHandler.h: -------------------------------------------------------------------------------- 1 | // IconHandler.h : Declaration of the CIconHandler 2 | 3 | #pragma once 4 | 5 | #include "resource.h" // main symbols 6 | #include "DllIconHandler_i.h" 7 | #include 8 | 9 | using namespace ATL; 10 | 11 | // CIconHandler 12 | 13 | class ATL_NO_VTABLE CIconHandler abstract : 14 | public CComObjectRootEx, 15 | public CComCoClass, 16 | public IExtractIcon, 17 | public IPersistFile { 18 | public: 19 | 20 | DECLARE_REGISTRY_RESOURCEID(IDR_ICONHANDLER) 21 | 22 | BEGIN_COM_MAP(CIconHandler) 23 | COM_INTERFACE_ENTRY(IPersistFile) 24 | COM_INTERFACE_ENTRY(IExtractIcon) 25 | END_COM_MAP() 26 | 27 | DECLARE_PROTECT_FINAL_CONSTRUCT() 28 | 29 | HRESULT FinalConstruct() { 30 | return S_OK; 31 | } 32 | 33 | void FinalRelease() { 34 | } 35 | 36 | private: 37 | enum class ModuleBitness { 38 | Unknown, 39 | Bit32, 40 | Bit64 41 | }; 42 | static ModuleBitness GetModuleBitness(PCWSTR path); 43 | 44 | // Inherited via IExtractIcon 45 | HRESULT __stdcall GetIconLocation(UINT uFlags, PWSTR pszIconFile, UINT cchMax, int* piIndex, UINT* pwFlags) override; 46 | HRESULT __stdcall Extract(PCWSTR pszFile, UINT nIconIndex, HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize) override; 47 | 48 | // Inherited via IPersistFile 49 | HRESULT __stdcall GetClassID(CLSID* pClassID) override; 50 | HRESULT __stdcall IsDirty(void) override; 51 | HRESULT __stdcall Load(LPCOLESTR pszFileName, DWORD dwMode) override; 52 | HRESULT __stdcall Save(LPCOLESTR pszFileName, BOOL fRemember) override; 53 | HRESULT __stdcall SaveCompleted(LPCOLESTR pszFileName) override; 54 | HRESULT __stdcall GetCurFile(LPOLESTR* ppszFileName) override; 55 | 56 | ModuleBitness m_Bitness{ ModuleBitness::Unknown }; 57 | inline static WCHAR s_ModulePath[MAX_PATH]{}; 58 | }; 59 | 60 | OBJECT_ENTRY_AUTO(__uuidof(IconHandler), CIconHandler) 61 | -------------------------------------------------------------------------------- /DllIconHandler/IconHandler.rgs: -------------------------------------------------------------------------------- 1 | HKCR 2 | { 3 | NoRemove CLSID 4 | { 5 | ForceRemove {d913f592-08f1-418a-9428-cc33db97ed60} = s 'DLL IconHandler' 6 | { 7 | InprocServer32 = s '%MODULE%' 8 | { 9 | val ThreadingModel = s 'Apartment' 10 | } 11 | TypeLib = s '{a1b4516d-9340-444b-87e2-13317a44eeb1}' 12 | Version = s '1.0' 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DllIconHandler/Icons/Dll32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodiacon/DllIconHandler/cdd02f7e8e8ed2390e5576205200e0f96c4b8172/DllIconHandler/Icons/Dll32.ico -------------------------------------------------------------------------------- /DllIconHandler/Icons/Dll64.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zodiacon/DllIconHandler/cdd02f7e8e8ed2390e5576205200e0f96c4b8172/DllIconHandler/Icons/Dll64.ico -------------------------------------------------------------------------------- /DllIconHandler/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Implementation of DllMain. 2 | 3 | #include "pch.h" 4 | #include "resource.h" 5 | #include "DllIconHandler_i.h" 6 | #include "dllmain.h" 7 | 8 | CDllIconHandlerModule _AtlModule; 9 | 10 | // DLL Entry Point 11 | extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { 12 | hInstance; 13 | return _AtlModule.DllMain(dwReason, lpReserved); 14 | } 15 | -------------------------------------------------------------------------------- /DllIconHandler/dllmain.h: -------------------------------------------------------------------------------- 1 | // dllmain.h : Declaration of module class. 2 | 3 | class CDllIconHandlerModule : public ATL::CAtlDllModuleT< CDllIconHandlerModule > { 4 | public: 5 | DECLARE_LIBID(LIBID_DllIconHandlerLib) 6 | DECLARE_REGISTRY_APPID_RESOURCEID(IDR_DLLICONHANDLER, "{a1b4516d-9340-444b-87e2-13317a44eeb1}") 7 | }; 8 | 9 | extern class CDllIconHandlerModule _AtlModule; 10 | -------------------------------------------------------------------------------- /DllIconHandler/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: source file corresponding to the pre-compiled header 2 | 3 | #include "pch.h" 4 | 5 | // When you are using pre-compiled headers, this source file is necessary for compilation to succeed. 6 | -------------------------------------------------------------------------------- /DllIconHandler/pch.h: -------------------------------------------------------------------------------- 1 | // pch.h: This is a precompiled header file. 2 | // Files listed below are compiled only once, improving build performance for future builds. 3 | // This also affects IntelliSense performance, including code completion and many code browsing features. 4 | // However, files listed here are ALL re-compiled if any one of them is updated between builds. 5 | // Do not add files here that you will be updating frequently as this negates the performance advantage. 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | #ifndef STRICT 11 | #define STRICT 12 | #endif 13 | 14 | #define NOMINMAX 15 | 16 | #include "targetver.h" 17 | 18 | #define _ATL_APARTMENT_THREADED 19 | 20 | #define _ATL_NO_AUTOMATIC_NAMESPACE 21 | 22 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit 23 | 24 | 25 | #define ATL_NO_ASSERT_ON_DESTROY_NONEXISTENT_WINDOW 26 | 27 | #include "resource.h" 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | #endif //PCH_H 35 | -------------------------------------------------------------------------------- /DllIconHandler/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by DllIconHandler.rc 4 | // 5 | #define IDS_PROJNAME 100 6 | #define IDR_DLLICONHANDLER 101 7 | #define IDR_ICONHANDLER 106 8 | #define IDB_ATLCONTROL 107 9 | #define IDI_DLL32 201 10 | #define IDI_DLL64 202 11 | 12 | // Next default values for new objects 13 | // 14 | #ifdef APSTUDIO_INVOKED 15 | #ifndef APSTUDIO_READONLY_SYMBOLS 16 | #define _APS_NEXT_RESOURCE_VALUE 203 17 | #define _APS_NEXT_COMMAND_VALUE 32768 18 | #define _APS_NEXT_CONTROL_VALUE 201 19 | #define _APS_NEXT_SYMED_VALUE 108 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /DllIconHandler/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Pavel Yosifovich 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DllIconHandler 2 | 3 | This project demonstrates how to create a Shell Icon Handler, that is loaded by *Explorer.exe*. An icon handler can show different icons for the same file type based on some logic. 4 | This implementation shows different icons for 64-bit and 32-bit DLLs. 5 | 6 | (This project is used as one of the exercises in my ![COM Programming class](https://github.com/zodiacon/syllabi/blob/main/COMProgramming-3days.pdf). 7 | 8 | ## Registration 9 | 10 | The DLL is loaded and used by Explorer.exe. It must be properly registered, as it's as COM DLL and as a shell icon handler. To register it for all users, open an elevated command window, navigate to the directory where `DllIconHandler.dll` is located and enter the following: 11 | 12 | ```cmd 13 | regsvr32 DlliconHandler.dll 14 | ``` 15 | 16 | You should be greeted with a successful registration message box. 17 | 18 | To register for the current user only, open a normal command window, navigate to the file's location and enter: 19 | 20 | ```cmd 21 | regsvr32 /n /i:user DllIconhandler.dll 22 | ``` 23 | 24 | You may need to restart explorer for the DLL to take effect. If you open a new explorer window that might work as well. 25 | 26 | You can test it by opening an explorer window and navigating to `c:\Windows\System32` and then contrast that with `c:\windows\SysWow64`. 27 | 28 | ## Building from source 29 | 30 | Open the solution file in Visual Studio 2022 and just build. You can also use an older Visual Studio version - just change the project's properties to use the toolset that you have installed. 31 | --------------------------------------------------------------------------------