├── .github └── workflows │ └── build.yml ├── .gitignore ├── .gitmodules ├── CHANGELOG.md ├── ExplorerPatcher.sln ├── ExplorerPatcher ├── ArchiveMenu.c ├── ArchiveMenu.h ├── ExplorerPatcher.rc ├── ExplorerPatcher.vcxproj ├── ExplorerPatcher.vcxproj.filters ├── GUI.c ├── GUI.h ├── HideExplorerSearchBar.c ├── HideExplorerSearchBar.h ├── ImmersiveFlyouts.c ├── ImmersiveFlyouts.h ├── RefreshedStyles.xbf ├── SettingsMonitor.c ├── SettingsMonitor.h ├── StartMenu.c ├── StartMenu.h ├── StartMenuSettings.cpp ├── StartupSound.c ├── StartupSound.h ├── TaskbarCenter.c ├── TaskbarCenter.h ├── def.h ├── dllmain.c ├── dxgi_imp.h ├── fmemopen.c ├── fmemopen.h ├── getline.c ├── getline.h ├── helper.c ├── helper.h ├── hooking.h ├── lvt.c ├── lvt.h ├── osutility.h ├── packages.config ├── queryversion.h ├── resource.h ├── settings.reg ├── settings10.reg ├── symbols.c ├── symbols.h ├── updates.c ├── updates.h ├── utility.c └── utility.h ├── FUNDING.yml ├── LICENSE ├── README.md ├── debug.h ├── ep_extra ├── README.md ├── ep_extra.rc ├── ep_extra.vcxproj ├── ep_extra.vcxproj.filters ├── main.asm ├── resource.h └── worker.c ├── ep_extra_valinet.win7alttab ├── README.md ├── Resource.rc ├── ep_extra_valinet.win7alttab.vcxproj ├── ep_extra_valinet.win7alttab.vcxproj.filters ├── main.c └── resource.h ├── ep_generate_release_description ├── ep_generate_release_description.c ├── ep_generate_release_description.vcxproj └── ep_generate_release_description.vcxproj.filters ├── ep_generate_release_name ├── ep_generate_release_name.c ├── ep_generate_release_name.vcxproj ├── ep_generate_release_name.vcxproj.filters └── resource.h ├── ep_setup ├── ep_setup.c ├── ep_setup.rc ├── ep_setup.vcxproj ├── ep_setup.vcxproj.filters ├── ep_setup_debug.rc └── resource.h ├── ep_setup_patch ├── ep_setup_patch.c ├── ep_setup_patch.vcxproj └── ep_setup_patch.vcxproj.filters ├── ep_startmenu ├── ep_sm_forwards.h ├── ep_sm_main.c ├── ep_startmenu.vcxproj └── ep_startmenu.vcxproj.filters ├── ep_weather_host ├── ep_weather.c ├── ep_weather.h ├── ep_weather_error_html.h ├── ep_weather_factory.c ├── ep_weather_factory.h ├── ep_weather_host.c ├── ep_weather_host.h ├── ep_weather_host.rc ├── ep_weather_host.vcxproj ├── ep_weather_host.vcxproj.filters ├── ep_weather_provider_google_html.h ├── ep_weather_provider_google_script.h ├── ep_weather_utility.h ├── packages.config └── resource.h ├── ep_weather_host_stub ├── ep_weather_host.idl ├── ep_weather_host_stub.def ├── ep_weather_host_stub.vcxproj └── ep_weather_host_stub.vcxproj.filters └── version.h /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # https://trstringer.com/github-actions-multiline-strings/ 3 | # https://trstringer.com/github-actions-create-release-upload-artifacts/ 4 | # https://github.com/Speedy37/sws/blob/444c67157a98652c4e7ffd3b6d6bbfb664071926/.github/workflows/msbuild.yml 5 | # https://stackoverflow.com/questions/58886293/getting-current-branch-and-commit-hash-in-github-action 6 | 7 | name: Build 8 | 9 | on: 10 | push: 11 | branches: 12 | - '**' 13 | tags-ignore: 14 | - '**' 15 | pull_request: 16 | branches: 17 | - '**' 18 | tags-ignore: 19 | - '**' 20 | workflow_dispatch: 21 | inputs: 22 | ref: 23 | description: 'Commit' 24 | required: true 25 | config: 26 | description: 'Configuration' 27 | required: false 28 | build_dir: 29 | description: 'Build dir' 30 | required: false 31 | 32 | env: 33 | SOLUTION_FILE_PATH: . 34 | BUILD_CONFIGURATION: Release 35 | 36 | jobs: 37 | build: 38 | runs-on: windows-latest 39 | 40 | steps: 41 | - name: Print inputs 42 | shell: bash 43 | run: | 44 | echo "ref: ${{ github.event.inputs.ref }}" 45 | echo "config: ${{ github.event.inputs.config }}" 46 | echo "build_dir: ${{ github.event.inputs.build_dir }}" 47 | 48 | - name: Checkout latest build and submodules 49 | uses: actions/checkout@v2 50 | if: github.event.inputs.ref == '' 51 | with: 52 | submodules: recursive 53 | 54 | - name: Checkout specific build and submodules 55 | uses: actions/checkout@v2 56 | if: github.event.inputs.ref != '' 57 | with: 58 | ref: ${{ github.event.inputs.ref }} 59 | submodules: recursive 60 | 61 | - name: Add MSBuild to PATH 62 | uses: microsoft/setup-msbuild@v1.0.2 63 | 64 | - name: Declare some variables 65 | id: vars 66 | shell: bash 67 | run: | 68 | echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" 69 | echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" 70 | 71 | - name: Enable SimpleWindowSwitcher support for newer Windows SDKs 72 | shell: cmd 73 | run: | 74 | cd libs/sws 75 | C:\msys64\usr\bin\wget.exe https://github.com/valinet/sws/commit/972acb76d1e6429133c92ed7cdefd29b9a2c6179.patch 76 | C:\msys64\usr\bin\dos2unix.exe 972acb76d1e6429133c92ed7cdefd29b9a2c6179.patch 77 | C:\msys64\usr\bin\dos2unix.exe SimpleWindowSwitcher/sws_def.h 78 | C:\msys64\usr\bin\patch.exe -N SimpleWindowSwitcher/sws_def.h 972acb76d1e6429133c92ed7cdefd29b9a2c6179.patch 79 | C:\msys64\usr\bin\unix2dos.exe SimpleWindowSwitcher/sws_def.h 80 | exit /b 0 81 | 82 | - name: Setup NuGet 83 | uses: nuget/setup-nuget@v1 84 | 85 | - name: Restore NuGet packages 86 | run: | 87 | nuget restore ExplorerPatcher.sln 88 | 89 | - name: Build funchook 90 | shell: powershell 91 | run: | 92 | cd libs/funchook 93 | md build 94 | cd build 95 | cmake -G "Visual Studio 17 2022" -A x64 .. 96 | (gc .\funchook-static.vcxproj) -replace 'MultiThreadedDLL', 'MultiThreaded' | Out-File .\funchook-static.vcxproj 97 | cmake --build . --config Release 98 | 99 | - name: Build EP IA-32 100 | if: github.event.inputs.config == '' 101 | working-directory: ${{env.GITHUB_WORKSPACE}} 102 | run: | 103 | msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=IA-32 ${{env.SOLUTION_FILE_PATH}} 104 | 105 | - name: Build EP amd64 106 | if: github.event.inputs.config == '' 107 | working-directory: ${{env.GITHUB_WORKSPACE}} 108 | run: | 109 | msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=amd64 ${{env.SOLUTION_FILE_PATH}} 110 | 111 | - name: Build EP custom 112 | if: github.event.inputs.config != '' 113 | working-directory: ${{env.GITHUB_WORKSPACE}} 114 | run: | 115 | msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{ github.event.inputs.config }} ${{env.SOLUTION_FILE_PATH}} 116 | 117 | - name: Create expected build directory 118 | if: github.event.inputs.build_dir != '' 119 | shell: bash 120 | run: | 121 | mkdir build 122 | cp -r ${{ github.event.inputs.build_dir }}/Release build/Release 123 | 124 | - name: Generate dxgi.dll 125 | shell: bash 126 | working-directory: build/Release 127 | run: | 128 | if [[ -f "ExplorerPatcher.amd64.dll" ]]; then cp ExplorerPatcher.amd64.dll dxgi.dll; fi 129 | 130 | - name: Patch setup 131 | shell: cmd 132 | working-directory: build/Release 133 | run: | 134 | ep_setup_patch.exe 135 | exit /b 0 136 | 137 | - name: Upload artifacts 138 | uses: actions/upload-artifact@v2 139 | with: 140 | name: ep_bin_multi_${{ steps.vars.outputs.sha_short }}_${{ steps.vars.outputs.branch }} 141 | path: | 142 | build/Release/ 143 | 144 | - name: Generate release name 145 | shell: bash 146 | working-directory: build/Release 147 | if: github.ref == 'refs/heads/master' && github.event.inputs.ref == '' 148 | run: | 149 | echo "::set-output name=data::$(./ep_generate_release_name.exe)" 150 | id: release_name 151 | 152 | - name: Generate release notes 153 | shell: bash 154 | working-directory: build/Release 155 | if: github.ref == 'refs/heads/master' && github.event.inputs.ref == '' 156 | run: | 157 | MY_STRING=$(./ep_generate_release_description.exe ${{ steps.vars.outputs.sha_short }} ${{ steps.vars.outputs.branch }} ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) 158 | MY_STRING="${MY_STRING//'%'/'%25'}" 159 | MY_STRING="${MY_STRING//$'\n'/'%0A'}" 160 | MY_STRING="${MY_STRING//$'\r'/'%0D'}" 161 | echo "::set-output name=data::$MY_STRING" 162 | id: release_description 163 | 164 | - name: Create/update release (valinet) 165 | uses: actions/create-release@v1 166 | if: github.repository_owner == 'valinet' && github.ref == 'refs/heads/master' && github.event.inputs.ref == '' 167 | id: create_release 168 | with: 169 | draft: false 170 | prerelease: ${{ !startsWith(github.event.head_commit.message, 'rel_') }} 171 | release_name: ${{ steps.release_name.outputs.data }} 172 | tag_name: ${{ steps.release_name.outputs.data }}_${{ steps.vars.outputs.sha_short }} 173 | body: ${{ steps.release_description.outputs.data }} 174 | env: 175 | GITHUB_TOKEN: ${{ secrets.PAT }} 176 | 177 | - name: Upload setup (valinet) 178 | uses: actions/upload-release-asset@v1 179 | if: github.repository_owner == 'valinet' && github.ref == 'refs/heads/master' && github.event.inputs.ref == '' 180 | with: 181 | upload_url: ${{ steps.create_release.outputs.upload_url }} 182 | asset_path: ./build/Release/ep_setup.exe 183 | asset_name: ep_setup.exe 184 | asset_content_type: application/x-msdownload 185 | env: 186 | GITHUB_TOKEN: ${{ secrets.PAT }} 187 | 188 | - name: Create/update release (forks) 189 | uses: actions/create-release@v1 190 | if: github.repository_owner != 'valinet' && github.ref == 'refs/heads/master' && github.event.inputs.ref == '' 191 | id: create_release_fork 192 | with: 193 | draft: false 194 | prerelease: ${{ !startsWith(github.event.head_commit.message, 'rel_') }} 195 | release_name: ${{ steps.release_name.outputs.data }} 196 | tag_name: ${{ steps.release_name.outputs.data }}_${{ steps.vars.outputs.sha_short }} 197 | body: ${{ steps.release_description.outputs.data }} 198 | env: 199 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 200 | 201 | - name: Upload setup (forks) 202 | uses: actions/upload-release-asset@v1 203 | if: github.repository_owner != 'valinet' && github.ref == 'refs/heads/master' && github.event.inputs.ref == '' 204 | with: 205 | upload_url: ${{ steps.create_release_fork.outputs.upload_url }} 206 | asset_path: ./build/Release/ep_setup.exe 207 | asset_name: ep_setup.exe 208 | asset_content_type: application/x-msdownload 209 | env: 210 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 211 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ep_private.h 2 | 3 | ## Ignore Visual Studio temporary files, build results, and 4 | ## files generated by popular Visual Studio add-ons. 5 | ## 6 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 7 | 8 | # User-specific files 9 | *.rsuser 10 | *.suo 11 | *.user 12 | *.userosscache 13 | *.sln.docstates 14 | 15 | # User-specific files (MonoDevelop/Xamarin Studio) 16 | *.userprefs 17 | 18 | # Mono auto generated files 19 | mono_crash.* 20 | 21 | # Build results 22 | [Dd]ebug/ 23 | [Dd]ebugPublic/ 24 | [Rr]elease/ 25 | [Rr]eleases/ 26 | x64/ 27 | x86/ 28 | [Aa][Rr][Mm]/ 29 | [Aa][Rr][Mm]64/ 30 | bld/ 31 | [Bb]in/ 32 | [Oo]bj/ 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 | # StyleCop 67 | StyleCopReport.xml 68 | 69 | # Files built by Visual Studio 70 | *_i.c 71 | *_p.c 72 | *_h.h 73 | *.ilk 74 | *.meta 75 | *.obj 76 | *.iobj 77 | *.pch 78 | *.pdb 79 | *.ipdb 80 | *.pgc 81 | *.pgd 82 | *.rsp 83 | *.sbr 84 | *.tlb 85 | *.tli 86 | *.tlh 87 | *.tmp 88 | *.tmp_proj 89 | *_wpftmp.csproj 90 | *.log 91 | *.vspscc 92 | *.vssscc 93 | .builds 94 | *.pidb 95 | *.svclog 96 | *.scc 97 | 98 | # Chutzpah Test files 99 | _Chutzpah* 100 | 101 | # Visual C++ cache files 102 | ipch/ 103 | *.aps 104 | *.ncb 105 | *.opendb 106 | *.opensdf 107 | *.sdf 108 | *.cachefile 109 | *.VC.db 110 | *.VC.VC.opendb 111 | 112 | # Visual Studio profiler 113 | *.psess 114 | *.vsp 115 | *.vspx 116 | *.sap 117 | 118 | # Visual Studio Trace Files 119 | *.e2e 120 | 121 | # TFS 2012 Local Workspace 122 | $tf/ 123 | 124 | # Guidance Automation Toolkit 125 | *.gpState 126 | 127 | # ReSharper is a .NET coding add-in 128 | _ReSharper*/ 129 | *.[Rr]e[Ss]harper 130 | *.DotSettings.user 131 | 132 | # TeamCity is a build add-in 133 | _TeamCity* 134 | 135 | # DotCover is a Code Coverage Tool 136 | *.dotCover 137 | 138 | # AxoCover is a Code Coverage Tool 139 | .axoCover/* 140 | !.axoCover/settings.json 141 | 142 | # Visual Studio code coverage results 143 | *.coverage 144 | *.coveragexml 145 | 146 | # NCrunch 147 | _NCrunch_* 148 | .*crunch*.local.xml 149 | nCrunchTemp_* 150 | 151 | # MightyMoose 152 | *.mm.* 153 | AutoTest.Net/ 154 | 155 | # Web workbench (sass) 156 | .sass-cache/ 157 | 158 | # Installshield output folder 159 | [Ee]xpress/ 160 | 161 | # DocProject is a documentation generator add-in 162 | DocProject/buildhelp/ 163 | DocProject/Help/*.HxT 164 | DocProject/Help/*.HxC 165 | DocProject/Help/*.hhc 166 | DocProject/Help/*.hhk 167 | DocProject/Help/*.hhp 168 | DocProject/Help/Html2 169 | DocProject/Help/html 170 | 171 | # Click-Once directory 172 | publish/ 173 | 174 | # Publish Web Output 175 | *.[Pp]ublish.xml 176 | *.azurePubxml 177 | # Note: Comment the next line if you want to checkin your web deploy settings, 178 | # but database connection strings (with potential passwords) will be unencrypted 179 | *.pubxml 180 | *.publishproj 181 | 182 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 183 | # checkin your Azure Web App publish settings, but sensitive information contained 184 | # in these scripts will be unencrypted 185 | PublishScripts/ 186 | 187 | # NuGet Packages 188 | *.nupkg 189 | # NuGet Symbol Packages 190 | *.snupkg 191 | # The packages folder can be ignored because of Package Restore 192 | **/[Pp]ackages/* 193 | # except build/, which is used as an MSBuild target. 194 | !**/[Pp]ackages/build/ 195 | # Uncomment if necessary however generally it will be regenerated when needed 196 | #!**/[Pp]ackages/repositories.config 197 | # NuGet v3's project.json files produces more ignorable files 198 | *.nuget.props 199 | *.nuget.targets 200 | 201 | # Microsoft Azure Build Output 202 | csx/ 203 | *.build.csdef 204 | 205 | # Microsoft Azure Emulator 206 | ecf/ 207 | rcf/ 208 | 209 | # Windows Store app package directories and files 210 | AppPackages/ 211 | BundleArtifacts/ 212 | Package.StoreAssociation.xml 213 | _pkginfo.txt 214 | *.appx 215 | *.appxbundle 216 | *.appxupload 217 | 218 | # Visual Studio cache files 219 | # files ending in .cache can be ignored 220 | *.[Cc]ache 221 | # but keep track of directories ending in .cache 222 | !?*.[Cc]ache/ 223 | 224 | # Others 225 | ClientBin/ 226 | ~$* 227 | *~ 228 | *.dbmdl 229 | *.dbproj.schemaview 230 | *.jfm 231 | *.pfx 232 | *.publishsettings 233 | orleans.codegen.cs 234 | 235 | # Including strong name files can present a security risk 236 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 237 | #*.snk 238 | 239 | # Since there are multiple workflows, uncomment next line to ignore bower_components 240 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 241 | #bower_components/ 242 | 243 | # RIA/Silverlight projects 244 | Generated_Code/ 245 | 246 | # Backup & report files from converting an old project file 247 | # to a newer Visual Studio version. Backup files are not needed, 248 | # because we have git ;-) 249 | _UpgradeReport_Files/ 250 | Backup*/ 251 | UpgradeLog*.XML 252 | UpgradeLog*.htm 253 | ServiceFabricBackup/ 254 | *.rptproj.bak 255 | 256 | # SQL Server files 257 | *.mdf 258 | *.ldf 259 | *.ndf 260 | 261 | # Business Intelligence projects 262 | *.rdl.data 263 | *.bim.layout 264 | *.bim_*.settings 265 | *.rptproj.rsuser 266 | *- [Bb]ackup.rdl 267 | *- [Bb]ackup ([0-9]).rdl 268 | *- [Bb]ackup ([0-9][0-9]).rdl 269 | 270 | # Microsoft Fakes 271 | FakesAssemblies/ 272 | 273 | # GhostDoc plugin setting file 274 | *.GhostDoc.xml 275 | 276 | # Node.js Tools for Visual Studio 277 | .ntvs_analysis.dat 278 | node_modules/ 279 | 280 | # Visual Studio 6 build log 281 | *.plg 282 | 283 | # Visual Studio 6 workspace options file 284 | *.opt 285 | 286 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 287 | *.vbw 288 | 289 | # Visual Studio LightSwitch build output 290 | **/*.HTMLClient/GeneratedArtifacts 291 | **/*.DesktopClient/GeneratedArtifacts 292 | **/*.DesktopClient/ModelManifest.xml 293 | **/*.Server/GeneratedArtifacts 294 | **/*.Server/ModelManifest.xml 295 | _Pvt_Extensions 296 | 297 | # Paket dependency manager 298 | .paket/paket.exe 299 | paket-files/ 300 | 301 | # FAKE - F# Make 302 | .fake/ 303 | 304 | # CodeRush personal settings 305 | .cr/personal 306 | 307 | # Python Tools for Visual Studio (PTVS) 308 | __pycache__/ 309 | *.pyc 310 | 311 | # Cake - Uncomment if you are using it 312 | # tools/** 313 | # !tools/packages.config 314 | 315 | # Tabs Studio 316 | *.tss 317 | 318 | # Telerik's JustMock configuration file 319 | *.jmconfig 320 | 321 | # BizTalk build output 322 | *.btp.cs 323 | *.btm.cs 324 | *.odx.cs 325 | *.xsd.cs 326 | 327 | # OpenCover UI analysis results 328 | OpenCover/ 329 | 330 | # Azure Stream Analytics local run output 331 | ASALocalRun/ 332 | 333 | # MSBuild Binary and Structured Log 334 | *.binlog 335 | 336 | # NVidia Nsight GPU debugger configuration file 337 | *.nvuser 338 | 339 | # MFractors (Xamarin productivity tool) working folder 340 | .mfractor/ 341 | 342 | # Local History for Visual Studio 343 | .localhistory/ 344 | 345 | # BeatPulse healthcheck temp database 346 | healthchecksdb 347 | 348 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 349 | MigrationBackup/ 350 | 351 | # Ionide (cross platform F# VS Code tools) working folder 352 | .ionide/ 353 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "libs/libvalinet"] 2 | path = libs/libvalinet 3 | url = https://github.com/valinet/libvalinet 4 | [submodule "libs/funchook"] 5 | path = libs/funchook 6 | url = https://github.com/kubo/funchook 7 | [submodule "libs/Detours"] 8 | path = libs/Detours 9 | url = https://github.com/microsoft/Detours 10 | [submodule "libs/sws"] 11 | path = libs/sws 12 | url = https://github.com/valinet/sws 13 | [submodule "ep_dwm"] 14 | path = ep_dwm 15 | url = https://github.com/valinet/ep_dwm 16 | -------------------------------------------------------------------------------- /ExplorerPatcher.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.32126.317 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExplorerPatcher", "ExplorerPatcher\ExplorerPatcher.vcxproj", "{DB3E4319-2969-42B6-B7E8-BB57AA8C9FA9}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {314A50C1-F0A0-4D0C-89E1-AD8F3951043E} = {314A50C1-F0A0-4D0C-89E1-AD8F3951043E} 9 | {AF02ABAC-EAEB-471C-9957-73D430B8B4DE} = {AF02ABAC-EAEB-471C-9957-73D430B8B4DE} 10 | EndProjectSection 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ep_generate_release_description", "ep_generate_release_description\ep_generate_release_description.vcxproj", "{C362CFBE-7C6B-4457-8D01-839818D42ECB}" 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ep_generate_release_name", "ep_generate_release_name\ep_generate_release_name.vcxproj", "{78D0C3CF-25C0-41D4-9359-0E9AB72B9874}" 15 | EndProject 16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ep_setup", "ep_setup\ep_setup.vcxproj", "{2FD40B09-F224-4E9A-B2FE-A22B50B2DEBF}" 17 | ProjectSection(ProjectDependencies) = postProject 18 | {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87} = {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87} 19 | {314A50C1-F0A0-4D0C-89E1-AD8F3951043E} = {314A50C1-F0A0-4D0C-89E1-AD8F3951043E} 20 | {6BF03EEA-200A-4698-9555-057DD52B0C78} = {6BF03EEA-200A-4698-9555-057DD52B0C78} 21 | {DB3E4319-2969-42B6-B7E8-BB57AA8C9FA9} = {DB3E4319-2969-42B6-B7E8-BB57AA8C9FA9} 22 | EndProjectSection 23 | EndProject 24 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ep_setup_patch", "ep_setup_patch\ep_setup_patch.vcxproj", "{0C13E5F3-106B-4836-A7C2-8E5808A6ED78}" 25 | ProjectSection(ProjectDependencies) = postProject 26 | {2FD40B09-F224-4E9A-B2FE-A22B50B2DEBF} = {2FD40B09-F224-4E9A-B2FE-A22B50B2DEBF} 27 | EndProjectSection 28 | EndProject 29 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ep_dwm", "ep_dwm\ep_dwm\ep_dwm.vcxproj", "{1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87}" 30 | EndProject 31 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ep_weather_host", "ep_weather_host\ep_weather_host.vcxproj", "{314A50C1-F0A0-4D0C-89E1-AD8F3951043E}" 32 | ProjectSection(ProjectDependencies) = postProject 33 | {AF02ABAC-EAEB-471C-9957-73D430B8B4DE} = {AF02ABAC-EAEB-471C-9957-73D430B8B4DE} 34 | EndProjectSection 35 | EndProject 36 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ep_weather_host_stub", "ep_weather_host_stub\ep_weather_host_stub.vcxproj", "{AF02ABAC-EAEB-471C-9957-73D430B8B4DE}" 37 | EndProject 38 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ep_startmenu", "ep_startmenu\ep_startmenu.vcxproj", "{6BF03EEA-200A-4698-9555-057DD52B0C78}" 39 | EndProject 40 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ep_extra", "ep_extra\ep_extra.vcxproj", "{93FA47CC-7753-4F86-B583-69048F51C5AB}" 41 | EndProject 42 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ep_extra_valinet.win7alttab", "ep_extra_valinet.win7alttab\ep_extra_valinet.win7alttab.vcxproj", "{A66C5F27-DBF8-45A4-BDF3-BA54D8D82D0F}" 43 | ProjectSection(ProjectDependencies) = postProject 44 | {93FA47CC-7753-4F86-B583-69048F51C5AB} = {93FA47CC-7753-4F86-B583-69048F51C5AB} 45 | EndProjectSection 46 | EndProject 47 | Global 48 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 49 | Debug|amd64 = Debug|amd64 50 | Debug|IA-32 = Debug|IA-32 51 | Release|amd64 = Release|amd64 52 | Release|IA-32 = Release|IA-32 53 | EndGlobalSection 54 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 55 | {DB3E4319-2969-42B6-B7E8-BB57AA8C9FA9}.Debug|amd64.ActiveCfg = Debug|x64 56 | {DB3E4319-2969-42B6-B7E8-BB57AA8C9FA9}.Debug|amd64.Build.0 = Debug|x64 57 | {DB3E4319-2969-42B6-B7E8-BB57AA8C9FA9}.Debug|IA-32.ActiveCfg = Debug|Win32 58 | {DB3E4319-2969-42B6-B7E8-BB57AA8C9FA9}.Debug|IA-32.Build.0 = Debug|Win32 59 | {DB3E4319-2969-42B6-B7E8-BB57AA8C9FA9}.Release|amd64.ActiveCfg = Release|x64 60 | {DB3E4319-2969-42B6-B7E8-BB57AA8C9FA9}.Release|amd64.Build.0 = Release|x64 61 | {DB3E4319-2969-42B6-B7E8-BB57AA8C9FA9}.Release|IA-32.ActiveCfg = Release|Win32 62 | {DB3E4319-2969-42B6-B7E8-BB57AA8C9FA9}.Release|IA-32.Build.0 = Release|Win32 63 | {C362CFBE-7C6B-4457-8D01-839818D42ECB}.Debug|amd64.ActiveCfg = Debug|x64 64 | {C362CFBE-7C6B-4457-8D01-839818D42ECB}.Debug|amd64.Build.0 = Debug|x64 65 | {C362CFBE-7C6B-4457-8D01-839818D42ECB}.Debug|IA-32.ActiveCfg = Debug|Win32 66 | {C362CFBE-7C6B-4457-8D01-839818D42ECB}.Release|amd64.ActiveCfg = Release|x64 67 | {C362CFBE-7C6B-4457-8D01-839818D42ECB}.Release|amd64.Build.0 = Release|x64 68 | {C362CFBE-7C6B-4457-8D01-839818D42ECB}.Release|IA-32.ActiveCfg = Release|Win32 69 | {78D0C3CF-25C0-41D4-9359-0E9AB72B9874}.Debug|amd64.ActiveCfg = Debug|x64 70 | {78D0C3CF-25C0-41D4-9359-0E9AB72B9874}.Debug|amd64.Build.0 = Debug|x64 71 | {78D0C3CF-25C0-41D4-9359-0E9AB72B9874}.Debug|IA-32.ActiveCfg = Debug|Win32 72 | {78D0C3CF-25C0-41D4-9359-0E9AB72B9874}.Release|amd64.ActiveCfg = Release|x64 73 | {78D0C3CF-25C0-41D4-9359-0E9AB72B9874}.Release|amd64.Build.0 = Release|x64 74 | {78D0C3CF-25C0-41D4-9359-0E9AB72B9874}.Release|IA-32.ActiveCfg = Release|Win32 75 | {2FD40B09-F224-4E9A-B2FE-A22B50B2DEBF}.Debug|amd64.ActiveCfg = Debug|x64 76 | {2FD40B09-F224-4E9A-B2FE-A22B50B2DEBF}.Debug|amd64.Build.0 = Debug|x64 77 | {2FD40B09-F224-4E9A-B2FE-A22B50B2DEBF}.Debug|IA-32.ActiveCfg = Debug|Win32 78 | {2FD40B09-F224-4E9A-B2FE-A22B50B2DEBF}.Release|amd64.ActiveCfg = Release|x64 79 | {2FD40B09-F224-4E9A-B2FE-A22B50B2DEBF}.Release|amd64.Build.0 = Release|x64 80 | {2FD40B09-F224-4E9A-B2FE-A22B50B2DEBF}.Release|IA-32.ActiveCfg = Release|Win32 81 | {0C13E5F3-106B-4836-A7C2-8E5808A6ED78}.Debug|amd64.ActiveCfg = Debug|x64 82 | {0C13E5F3-106B-4836-A7C2-8E5808A6ED78}.Debug|amd64.Build.0 = Debug|x64 83 | {0C13E5F3-106B-4836-A7C2-8E5808A6ED78}.Debug|IA-32.ActiveCfg = Debug|Win32 84 | {0C13E5F3-106B-4836-A7C2-8E5808A6ED78}.Release|amd64.ActiveCfg = Release|x64 85 | {0C13E5F3-106B-4836-A7C2-8E5808A6ED78}.Release|amd64.Build.0 = Release|x64 86 | {0C13E5F3-106B-4836-A7C2-8E5808A6ED78}.Release|IA-32.ActiveCfg = Release|Win32 87 | {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87}.Debug|amd64.ActiveCfg = Debug|x64 88 | {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87}.Debug|amd64.Build.0 = Debug|x64 89 | {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87}.Debug|IA-32.ActiveCfg = Debug|Win32 90 | {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87}.Release|amd64.ActiveCfg = Release|x64 91 | {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87}.Release|amd64.Build.0 = Release|x64 92 | {1ECCAB38-61B6-4C85-BBB5-2E2232DA3A87}.Release|IA-32.ActiveCfg = Release|Win32 93 | {314A50C1-F0A0-4D0C-89E1-AD8F3951043E}.Debug|amd64.ActiveCfg = Debug|x64 94 | {314A50C1-F0A0-4D0C-89E1-AD8F3951043E}.Debug|amd64.Build.0 = Debug|x64 95 | {314A50C1-F0A0-4D0C-89E1-AD8F3951043E}.Debug|IA-32.ActiveCfg = Debug|Win32 96 | {314A50C1-F0A0-4D0C-89E1-AD8F3951043E}.Release|amd64.ActiveCfg = Release|x64 97 | {314A50C1-F0A0-4D0C-89E1-AD8F3951043E}.Release|amd64.Build.0 = Release|x64 98 | {314A50C1-F0A0-4D0C-89E1-AD8F3951043E}.Release|IA-32.ActiveCfg = Release|Win32 99 | {AF02ABAC-EAEB-471C-9957-73D430B8B4DE}.Debug|amd64.ActiveCfg = Debug|x64 100 | {AF02ABAC-EAEB-471C-9957-73D430B8B4DE}.Debug|amd64.Build.0 = Debug|x64 101 | {AF02ABAC-EAEB-471C-9957-73D430B8B4DE}.Debug|IA-32.ActiveCfg = Debug|Win32 102 | {AF02ABAC-EAEB-471C-9957-73D430B8B4DE}.Release|amd64.ActiveCfg = Release|x64 103 | {AF02ABAC-EAEB-471C-9957-73D430B8B4DE}.Release|amd64.Build.0 = Release|x64 104 | {AF02ABAC-EAEB-471C-9957-73D430B8B4DE}.Release|IA-32.ActiveCfg = Release|Win32 105 | {6BF03EEA-200A-4698-9555-057DD52B0C78}.Debug|amd64.ActiveCfg = Debug|x64 106 | {6BF03EEA-200A-4698-9555-057DD52B0C78}.Debug|amd64.Build.0 = Debug|x64 107 | {6BF03EEA-200A-4698-9555-057DD52B0C78}.Debug|IA-32.ActiveCfg = Debug|Win32 108 | {6BF03EEA-200A-4698-9555-057DD52B0C78}.Release|amd64.ActiveCfg = Release|x64 109 | {6BF03EEA-200A-4698-9555-057DD52B0C78}.Release|amd64.Build.0 = Release|x64 110 | {6BF03EEA-200A-4698-9555-057DD52B0C78}.Release|IA-32.ActiveCfg = Release|Win32 111 | {93FA47CC-7753-4F86-B583-69048F51C5AB}.Debug|amd64.ActiveCfg = Debug|x64 112 | {93FA47CC-7753-4F86-B583-69048F51C5AB}.Debug|amd64.Build.0 = Debug|x64 113 | {93FA47CC-7753-4F86-B583-69048F51C5AB}.Debug|IA-32.ActiveCfg = Debug|Win32 114 | {93FA47CC-7753-4F86-B583-69048F51C5AB}.Release|amd64.ActiveCfg = Release|x64 115 | {93FA47CC-7753-4F86-B583-69048F51C5AB}.Release|amd64.Build.0 = Release|x64 116 | {93FA47CC-7753-4F86-B583-69048F51C5AB}.Release|IA-32.ActiveCfg = Release|Win32 117 | {A66C5F27-DBF8-45A4-BDF3-BA54D8D82D0F}.Debug|amd64.ActiveCfg = Debug|x64 118 | {A66C5F27-DBF8-45A4-BDF3-BA54D8D82D0F}.Debug|amd64.Build.0 = Debug|x64 119 | {A66C5F27-DBF8-45A4-BDF3-BA54D8D82D0F}.Debug|IA-32.ActiveCfg = Debug|Win32 120 | {A66C5F27-DBF8-45A4-BDF3-BA54D8D82D0F}.Release|amd64.ActiveCfg = Release|x64 121 | {A66C5F27-DBF8-45A4-BDF3-BA54D8D82D0F}.Release|amd64.Build.0 = Release|x64 122 | {A66C5F27-DBF8-45A4-BDF3-BA54D8D82D0F}.Release|IA-32.ActiveCfg = Release|Win32 123 | EndGlobalSection 124 | GlobalSection(SolutionProperties) = preSolution 125 | HideSolutionNode = FALSE 126 | EndGlobalSection 127 | GlobalSection(ExtensibilityGlobals) = postSolution 128 | SolutionGuid = {39EBC2F0-6949-46EC-9FC2-776591FEE2DA} 129 | EndGlobalSection 130 | EndGlobal 131 | -------------------------------------------------------------------------------- /ExplorerPatcher/ArchiveMenu.c: -------------------------------------------------------------------------------- 1 | #include "ArchiveMenu.h" 2 | 3 | DWORD ArchiveMenuThread(ArchiveMenuThreadParams* params) 4 | { 5 | Sleep(1000); 6 | printf("Started \"Archive menu\" thread.\n"); 7 | 8 | HRESULT hr = CoInitialize(NULL); 9 | if (FAILED(hr)) 10 | { 11 | return 0; 12 | } 13 | 14 | WNDCLASS wc = { 0 }; 15 | wc.style = CS_DBLCLKS; 16 | wc.lpfnWndProc = params->wndProc; 17 | wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); 18 | wc.hInstance = GetModuleHandle(NULL); 19 | wc.lpszClassName = L"ArchiveMenuWindowExplorer"; 20 | wc.hCursor = LoadCursorW(NULL, IDC_ARROW); 21 | RegisterClass(&wc); 22 | 23 | *(params->hWnd) = params->CreateWindowInBand( 24 | 0, 25 | L"ArchiveMenuWindowExplorer", 26 | 0, 27 | WS_POPUP, 28 | 0, 29 | 0, 30 | 0, 31 | 0, 32 | 0, 33 | 0, 34 | GetModuleHandle(NULL), 35 | NULL, 36 | 7 37 | ); 38 | if (!*(params->hWnd)) 39 | { 40 | return 0; 41 | } 42 | ITaskbarList* pTaskList = NULL; 43 | hr = CoCreateInstance( 44 | &__uuidof_TaskbarList, 45 | NULL, 46 | CLSCTX_ALL, 47 | &__uuidof_ITaskbarList, 48 | (void**)(&pTaskList) 49 | ); 50 | if (FAILED(hr)) 51 | { 52 | return 0; 53 | } 54 | hr = pTaskList->lpVtbl->HrInit(pTaskList); 55 | if (FAILED(hr)) 56 | { 57 | return 0; 58 | } 59 | ShowWindow(*(params->hWnd), SW_SHOW); 60 | hr = pTaskList->lpVtbl->DeleteTab(pTaskList, *(params->hWnd)); 61 | if (FAILED(hr)) 62 | { 63 | return 0; 64 | } 65 | hr = pTaskList->lpVtbl->Release(pTaskList); 66 | if (FAILED(hr)) 67 | { 68 | return 0; 69 | } 70 | 71 | MSG msg = { 0 }; 72 | while (GetMessage(&msg, NULL, 0, 0)) 73 | { 74 | TranslateMessage(&msg); 75 | DispatchMessage(&msg); 76 | } 77 | 78 | printf("Ended \"Archive menu\" thread.\n"); 79 | } 80 | 81 | LRESULT CALLBACK ArchiveMenuWndProc( 82 | _In_ HWND hWnd, 83 | _In_ UINT uMsg, 84 | _In_ WPARAM wParam, 85 | _In_ LPARAM lParam, 86 | INT64(*ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc)( 87 | HMENU h1, 88 | HMENU h2, 89 | HWND a3, 90 | unsigned int a4, 91 | void* data 92 | ), 93 | void(*ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc)( 94 | HMENU _this, 95 | HMENU hWnd, 96 | HWND a3 97 | ) 98 | ) 99 | { 100 | LRESULT result; 101 | 102 | if (uMsg == WM_COPYDATA) 103 | { 104 | COPYDATASTRUCT* st = lParam; 105 | HWND srcWnd = wParam; 106 | 107 | POINT pt; 108 | GetCursorPos(&pt); 109 | 110 | HWND prevhWnd = GetForegroundWindow(); 111 | SetForegroundWindow(hWnd); 112 | 113 | HMENU hMenu = CreatePopupMenu(); 114 | 115 | TCHAR buffer[MAX_PATH + 100]; 116 | TCHAR filename[MAX_PATH]; 117 | ZeroMemory(filename, MAX_PATH * sizeof(TCHAR)); 118 | memcpy(filename, st->lpData, wcslen(st->lpData) * sizeof(TCHAR)); 119 | PathUnquoteSpacesW(filename); 120 | PathRemoveExtensionW(filename); 121 | PathStripPathW(filename); 122 | wsprintf(buffer, EXTRACT_NAME, filename); 123 | 124 | InsertMenu(hMenu, 0, MF_BYPOSITION | MF_STRING, 1, buffer); 125 | InsertMenu(hMenu, 0, MF_BYPOSITION | MF_STRING, 2, OPEN_NAME); 126 | 127 | INT64* unknown_array = calloc(4, sizeof(INT64)); 128 | ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc( 129 | hMenu, 130 | hWnd, 131 | &(pt), 132 | 0xc, 133 | unknown_array 134 | ); 135 | 136 | BOOL res = TrackPopupMenu( 137 | hMenu, 138 | TPM_RETURNCMD, 139 | pt.x - 15, 140 | pt.y - 15, 141 | 0, 142 | hWnd, 143 | 0 144 | ); 145 | 146 | ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc( 147 | hMenu, 148 | hWnd, 149 | &(pt) 150 | ); 151 | free(unknown_array); 152 | SetForegroundWindow(prevhWnd); 153 | 154 | if (res == 1 || res == 2) 155 | { 156 | ZeroMemory(buffer, (MAX_PATH + 100) * sizeof(TCHAR)); 157 | if (res == 2) 158 | { 159 | wsprintf(buffer, OPEN_CMD, st->lpData); 160 | //wprintf(L"%s\n%s\n\n", st->lpData, buffer); 161 | } 162 | else if (res == 1) 163 | { 164 | TCHAR path[MAX_PATH + 1], path_orig[MAX_PATH + 1]; 165 | ZeroMemory(path, (MAX_PATH + 1) * sizeof(TCHAR)); 166 | ZeroMemory(path_orig, (MAX_PATH + 1) * sizeof(TCHAR)); 167 | memcpy(path, st->lpData, wcslen(st->lpData) * sizeof(TCHAR)); 168 | memcpy(path_orig, st->lpData, wcslen(st->lpData) * sizeof(TCHAR)); 169 | PathUnquoteSpacesW(path_orig); 170 | PathRemoveExtensionW(path_orig); 171 | wsprintf(buffer, EXTRACT_CMD, path_orig, path); 172 | //wprintf(L"%s\n%s\n\n", st->lpData, buffer); 173 | } 174 | STARTUPINFO si = { sizeof(si) }; 175 | PROCESS_INFORMATION pi; 176 | BOOL b = CreateProcess( 177 | NULL, 178 | buffer, 179 | NULL, 180 | NULL, 181 | TRUE, 182 | CREATE_UNICODE_ENVIRONMENT, 183 | NULL, 184 | NULL, 185 | &si, 186 | &pi 187 | ); 188 | CloseHandle(pi.hProcess); 189 | CloseHandle(pi.hThread); 190 | } 191 | DestroyMenu(hMenu); 192 | ShowWindow(hWnd, SW_HIDE); 193 | return 0; 194 | } 195 | else if (uMsg == WM_CLOSE) 196 | { 197 | return 0; 198 | } 199 | return 1; 200 | } 201 | -------------------------------------------------------------------------------- /ExplorerPatcher/ArchiveMenu.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_ARCHIVEMENU_H_ 2 | #define _H_ARCHIVEMENU_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | #define OPEN_NAME L"&Open archive" 8 | #define EXTRACT_NAME L"&Extract to \"%s\\\"" 9 | #define OPEN_CMD L"\"C:\\Program Files\\7-Zip\\7zFM.exe\" %s" 10 | #define EXTRACT_CMD L"\"C:\\Program Files\\7-Zip\\7zG.exe\" x -o\"%s\" -spe %s" 11 | 12 | DEFINE_GUID(__uuidof_TaskbarList, 13 | 0x56FDF344, 14 | 0xFD6D, 0x11d0, 0x95, 0x8A, 15 | 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90 16 | ); 17 | DEFINE_GUID(__uuidof_ITaskbarList, 18 | 0x56FDF342, 19 | 0xFD6D, 0x11d0, 0x95, 0x8A, 20 | 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90 21 | ); 22 | 23 | typedef struct _ArchiveMenuThreadParams 24 | { 25 | HWND* hWnd; 26 | WNDPROC wndProc; 27 | HWND(WINAPI* CreateWindowInBand)( 28 | _In_ DWORD dwExStyle, 29 | _In_opt_ ATOM atom, 30 | _In_opt_ LPCWSTR lpWindowName, 31 | _In_ DWORD dwStyle, 32 | _In_ int X, 33 | _In_ int Y, 34 | _In_ int nWidth, 35 | _In_ int nHeight, 36 | _In_opt_ HWND hWndParent, 37 | _In_opt_ HMENU hMenu, 38 | _In_opt_ HINSTANCE hInstance, 39 | _In_opt_ LPVOID lpParam, 40 | DWORD band 41 | ); 42 | } ArchiveMenuThreadParams; 43 | DWORD ArchiveMenuThread(ArchiveMenuThreadParams* params); 44 | 45 | LRESULT CALLBACK ArchiveMenuWndProc( 46 | _In_ HWND hWnd, 47 | _In_ UINT uMsg, 48 | _In_ WPARAM wParam, 49 | _In_ LPARAM lParam, 50 | INT64(*ImmersiveContextMenuHelper_ApplyOwnerDrawToMenuFunc)( 51 | HMENU h1, 52 | HMENU h2, 53 | HWND a3, 54 | unsigned int a4, 55 | void* data 56 | ), 57 | void(*ImmersiveContextMenuHelper_RemoveOwnerDrawFromMenuFunc)( 58 | HMENU _this, 59 | HMENU hWnd, 60 | HWND a3 61 | ) 62 | ); 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /ExplorerPatcher/ExplorerPatcher.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yukari316/ExplorerPatcher_zh-CN/f908378cbc712de9f8e7ba4e9f2b93d83418af58/ExplorerPatcher/ExplorerPatcher.rc -------------------------------------------------------------------------------- /ExplorerPatcher/GUI.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_GUI_H_ 2 | #define _H_GUI_H_ 3 | #define _CRTDBG_MAP_ALLOC 4 | #include 5 | #include 6 | #pragma comment(linker,"\"/manifestdependency:type='win32' \ 7 | name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \ 8 | processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 9 | #include 10 | #pragma comment(lib, "Version.lib") 11 | #include 12 | #pragma comment(lib, "Shlwapi.lib") 13 | #include 14 | #include 15 | #include 16 | #pragma comment(lib, "Shcore.lib") 17 | #include 18 | #include 19 | #include 20 | #pragma comment(lib, "UxTheme.lib") 21 | #include 22 | #pragma comment(lib, "Dwmapi.lib") 23 | #include "resource.h" 24 | #include "getline.h" 25 | #include "fmemopen.h" 26 | #include "utility.h" 27 | #include "../ep_weather_host/ep_weather.h" 28 | #include "../ep_weather_host/ep_weather_host_h.h" 29 | 30 | #define MAX_LINE_LENGTH 2000 31 | extern HMODULE hModule; 32 | 33 | #define GUI_POSITION_X CW_USEDEFAULT 34 | #define GUI_POSITION_Y CW_USEDEFAULT 35 | #define GUI_POSITION_WIDTH 367 36 | #define GUI_POSITION_HEIGHT 316 37 | #define GUI_WINDOWSWITCHER_THEME_CLASS "ControlPanelStyle" 38 | #define GUI_CAPTION_FONT_SIZE -12 39 | #define GUI_SECTION_FONT_SIZE -12 40 | #define GUI_SECTION_HEIGHT 32 41 | #define GUI_TITLE_FONT_SIZE -12 42 | #define GUI_LINE_HEIGHT 26 43 | #define GUI_CAPTION_LINE_HEIGHT_DEFAULT 42 44 | #define GUI_TEXTCOLOR RGB(0, 0, 0) 45 | #define GUI_TEXTCOLOR_SELECTED RGB(255, 0, 0) 46 | #define GUI_TEXTCOLOR_DARK RGB(240, 240, 240) 47 | #define GUI_TEXTCOLOR_SELECTED_DARK RGB(255, 150, 150) 48 | #define GUI_MAX_TABORDER 9999 49 | #define GUI_PADDING 5 50 | #define GUI_PADDING_LEFT GUI_PADDING * 3 51 | #define GUI_SIDEBAR_WIDTH 110 52 | #define GUI_PADDING_RIGHT GUI_PADDING * 3 53 | #define GUI_PADDING_TOP GUI_PADDING 54 | #define GUI_PADDING_BOTTOM GUI_PADDING 55 | #define GUI_STATUS_PADDING 10 56 | 57 | #define GUI_TIMER_READ_HELP 1 58 | #define GUI_TIMER_READ_HELP_TIMEOUT 1000 59 | #define GUI_TIMER_READ_REPEAT_SELECTION 2 60 | #define GUI_TIMER_READ_REPEAT_SELECTION_TIMEOUT 1000 61 | #define GUI_TIMER_REFRESH_FOR_PEOPLEBAND 2 62 | #define GUI_TIMER_REFRESH_FOR_PEOPLEBAND_TIMEOUT 1000 63 | typedef struct _GUI 64 | { 65 | POINT location; 66 | SIZE size; 67 | RECT padding; 68 | UINT sidebarWidth; 69 | HBRUSH hBackgroundBrush; 70 | HTHEME hTheme; 71 | POINT dpi; 72 | MARGINS extent; 73 | UINT tabOrder; 74 | DWORD bCalcExtent; 75 | SIZE_T section; 76 | DWORD dwStatusbarY; 77 | HICON hIcon; 78 | RECT border_thickness; 79 | UINT GUI_CAPTION_LINE_HEIGHT; 80 | long long LeftClickTime; 81 | long long LastClickTime; 82 | HMODULE hExplorerFrame; 83 | void* pAccPropServices; 84 | HWND hAccLabel; 85 | BOOL bShouldAnnounceSelected; 86 | WCHAR sectionNames[20][20]; 87 | BOOL bRebuildIfTabOrderIsEmpty; 88 | int dwPageLocation; 89 | DWORD last_section; 90 | } GUI; 91 | 92 | static HRESULT GUI_AboutProc( 93 | HWND hwnd, 94 | UINT uNotification, 95 | WPARAM wParam, 96 | LPARAM lParam, 97 | LONG_PTR lpRefData 98 | ); 99 | 100 | static BOOL GUI_Build(HDC hDC, HWND hWnd); 101 | 102 | static LRESULT CALLBACK GUI_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 103 | 104 | __declspec(dllexport) int ZZGUI(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow); 105 | #endif 106 | -------------------------------------------------------------------------------- /ExplorerPatcher/HideExplorerSearchBar.c: -------------------------------------------------------------------------------- 1 | #include "HideExplorerSearchBar.h" 2 | 3 | HWND FindChildWindow( 4 | HWND hwndParent, 5 | wchar_t* lpszClass 6 | ) 7 | { 8 | HWND hwnd = FindWindowEx( 9 | hwndParent, 10 | NULL, 11 | lpszClass, 12 | NULL 13 | ); 14 | if (hwnd == NULL) 15 | { 16 | HWND hwndChild = FindWindowEx( 17 | hwndParent, 18 | NULL, 19 | NULL, 20 | NULL 21 | ); 22 | while (hwndChild != NULL && hwnd == NULL) 23 | { 24 | hwnd = FindChildWindow( 25 | hwndChild, 26 | lpszClass 27 | ); 28 | if (hwnd == NULL) 29 | { 30 | hwndChild = FindWindowEx( 31 | hwndParent, 32 | hwndChild, 33 | NULL, 34 | NULL 35 | ); 36 | } 37 | } 38 | } 39 | return hwnd; 40 | } 41 | 42 | VOID HideExplorerSearchBar(HWND hWnd) 43 | { 44 | HWND band = NULL, rebar = NULL; 45 | band = FindChildWindow( 46 | hWnd, 47 | (wchar_t*)L"TravelBand" 48 | ); 49 | if (!band) 50 | { 51 | return; 52 | } 53 | rebar = GetParent(band); 54 | if (!rebar) 55 | { 56 | return; 57 | } 58 | int idx = 0; 59 | idx = (int)SendMessage( 60 | rebar, 61 | RB_IDTOINDEX, 62 | 4, 63 | 0 64 | ); 65 | if (idx >= 0) 66 | { 67 | SendMessage( 68 | rebar, 69 | RB_SHOWBAND, 70 | idx, 71 | FALSE 72 | ); 73 | } 74 | idx = (int)SendMessage( 75 | rebar, 76 | RB_IDTOINDEX, 77 | 5, 78 | 0 79 | ); 80 | if (idx >= 0) 81 | { 82 | SendMessage( 83 | rebar, 84 | RB_SHOWBAND, 85 | idx, 86 | TRUE 87 | ); 88 | } 89 | RedrawWindow( 90 | rebar, 91 | NULL, 92 | NULL, 93 | RDW_UPDATENOW | RDW_ALLCHILDREN 94 | ); 95 | } 96 | 97 | LRESULT CALLBACK HideExplorerSearchBarSubClass( 98 | HWND hWnd, 99 | UINT uMsg, 100 | WPARAM wParam, 101 | LPARAM lParam, 102 | UINT_PTR uIdSubclass, 103 | DWORD_PTR dwRefData 104 | ) 105 | { 106 | if (uMsg == WM_SIZE || uMsg == WM_PARENTNOTIFY) 107 | { 108 | if (uMsg == WM_SIZE && IsWindows11Version22H2OrHigher()) HideExplorerSearchBar(hWnd); 109 | else if (uMsg == WM_PARENTNOTIFY && (WORD)wParam == 1) HideExplorerSearchBar(hWnd); 110 | } 111 | else if (uMsg == WM_DESTROY) 112 | { 113 | RemoveWindowSubclass(hWnd, HideExplorerSearchBarSubClass, (UINT_PTR)HideExplorerSearchBarSubClass); 114 | } 115 | return DefSubclassProc(hWnd, uMsg, wParam, lParam); 116 | } -------------------------------------------------------------------------------- /ExplorerPatcher/HideExplorerSearchBar.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_HIDEEXPLORERSEARCHBAR_H_ 2 | #define _H_HIDEEXPLORERSEARCHBAR_H_ 3 | #include 4 | #include 5 | #pragma comment(lib, "Comctl32.lib") 6 | #include "osutility.h" 7 | 8 | // https://stackoverflow.com/questions/30141592/how-do-i-find-a-handle-inside-a-control 9 | HWND FindChildWindow( 10 | HWND hwndParent, 11 | wchar_t* lpszClass 12 | ); 13 | 14 | // https://github.com/Open-Shell/Open-Shell-Menu/blob/master/Src/ClassicExplorer/ExplorerBHO.cpp 15 | VOID HideExplorerSearchBar(HWND hWnd); 16 | 17 | LRESULT CALLBACK HideExplorerSearchBarSubClass( 18 | HWND hWnd, 19 | UINT uMsg, 20 | WPARAM wParam, 21 | LPARAM lParam, 22 | UINT_PTR uIdSubclass, 23 | DWORD_PTR dwRefData 24 | ); 25 | #endif -------------------------------------------------------------------------------- /ExplorerPatcher/ImmersiveFlyouts.c: -------------------------------------------------------------------------------- 1 | #include "ImmersiveFlyouts.h" 2 | 3 | void InvokeActionCenter() 4 | { 5 | HRESULT hr = S_OK; 6 | IUnknown* pImmersiveShell = NULL; 7 | hr = CoCreateInstance( 8 | &CLSID_ImmersiveShell, 9 | NULL, 10 | CLSCTX_NO_CODE_DOWNLOAD | CLSCTX_LOCAL_SERVER, 11 | &IID_IServiceProvider, 12 | &pImmersiveShell 13 | ); 14 | if (SUCCEEDED(hr)) 15 | { 16 | IShellExperienceManagerFactory* pShellExperienceManagerFactory = NULL; 17 | IUnknown_QueryService( 18 | pImmersiveShell, 19 | &CLSID_ShellExperienceManagerFactory, 20 | &CLSID_ShellExperienceManagerFactory, 21 | &pShellExperienceManagerFactory 22 | ); 23 | if (pShellExperienceManagerFactory) 24 | { 25 | HSTRING_HEADER hstringHeader; 26 | HSTRING hstring = NULL; 27 | hr = WindowsCreateStringReference( 28 | L"Windows.Internal.ShellExperience.ControlCenter", 29 | (UINT32)(sizeof(L"Windows.Internal.ShellExperience.ControlCenter") / sizeof(wchar_t) - 1), 30 | &hstringHeader, 31 | &hstring 32 | ); 33 | if (hstring) 34 | { 35 | IUnknown* pIntf = NULL; 36 | pShellExperienceManagerFactory->lpVtbl->GetExperienceManager( 37 | pShellExperienceManagerFactory, 38 | hstring, 39 | &pIntf 40 | ); 41 | if (pIntf) 42 | { 43 | IActionCenterOrControlCenterExperienceManager* pControlCenterExperienceManager = NULL; 44 | pIntf->lpVtbl->QueryInterface(pIntf, &IID_ControlCenterExperienceManager, &pControlCenterExperienceManager); 45 | if (pControlCenterExperienceManager) 46 | { 47 | pControlCenterExperienceManager->lpVtbl->HotKeyInvoked(pControlCenterExperienceManager, 0); 48 | pControlCenterExperienceManager->lpVtbl->Release(pControlCenterExperienceManager); 49 | } 50 | } 51 | WindowsDeleteString(hstring); 52 | } 53 | pShellExperienceManagerFactory->lpVtbl->Release(pShellExperienceManagerFactory); 54 | } 55 | pImmersiveShell->lpVtbl->Release(pImmersiveShell); 56 | } 57 | } 58 | 59 | HRESULT InvokeFlyoutRect(BOOL bAction, DWORD dwWhich, __x_ABI_CWindows_CFoundation_CRect* pRc) 60 | { 61 | HRESULT hr = S_OK; 62 | IUnknown* pImmersiveShell = NULL; 63 | hr = CoCreateInstance( 64 | &CLSID_ImmersiveShell, 65 | NULL, 66 | CLSCTX_NO_CODE_DOWNLOAD | CLSCTX_LOCAL_SERVER, 67 | &IID_IServiceProvider, 68 | &pImmersiveShell 69 | ); 70 | if (SUCCEEDED(hr)) 71 | { 72 | IShellExperienceManagerFactory* pShellExperienceManagerFactory = NULL; 73 | hr = IUnknown_QueryService( 74 | pImmersiveShell, 75 | &CLSID_ShellExperienceManagerFactory, 76 | &CLSID_ShellExperienceManagerFactory, 77 | &pShellExperienceManagerFactory 78 | ); 79 | if (SUCCEEDED(hr)) 80 | { 81 | HSTRING_HEADER hstringHeader; 82 | HSTRING hstring = NULL; 83 | WCHAR* pwszStr = NULL; 84 | switch (dwWhich) 85 | { 86 | case INVOKE_FLYOUT_NETWORK: 87 | pwszStr = L"Windows.Internal.ShellExperience.NetworkFlyout"; 88 | break; 89 | case INVOKE_FLYOUT_CLOCK: 90 | pwszStr = L"Windows.Internal.ShellExperience.TrayClockFlyout"; 91 | break; 92 | case INVOKE_FLYOUT_BATTERY: 93 | pwszStr = L"Windows.Internal.ShellExperience.TrayBatteryFlyout"; 94 | break; 95 | case INVOKE_FLYOUT_SOUND: 96 | pwszStr = L"Windows.Internal.ShellExperience.MtcUvc"; 97 | break; 98 | } 99 | hr = WindowsCreateStringReference( 100 | pwszStr, 101 | pwszStr ? wcslen(pwszStr) : 0, 102 | &hstringHeader, 103 | &hstring 104 | ); 105 | if (SUCCEEDED(hr)) 106 | { 107 | IUnknown* pIntf = NULL; 108 | hr = pShellExperienceManagerFactory->lpVtbl->GetExperienceManager( 109 | pShellExperienceManagerFactory, 110 | hstring, 111 | &pIntf 112 | ); 113 | if (SUCCEEDED(hr)) 114 | { 115 | IExperienceManager* pExperienceManager = NULL; 116 | hr = pIntf->lpVtbl->QueryInterface( 117 | pIntf, 118 | dwWhich == INVOKE_FLYOUT_NETWORK ? &IID_NetworkFlyoutExperienceManager : 119 | (dwWhich == INVOKE_FLYOUT_CLOCK ? &IID_TrayClockFlyoutExperienceManager : 120 | (dwWhich == INVOKE_FLYOUT_BATTERY ? &IID_TrayBatteryFlyoutExperienceManager : 121 | (dwWhich == INVOKE_FLYOUT_SOUND ? &IID_TrayMtcUvcFlyoutExperienceManager : &IID_IUnknown))), 122 | &pExperienceManager 123 | ); 124 | if (SUCCEEDED(hr)) 125 | { 126 | if (bAction == INVOKE_FLYOUT_SHOW) 127 | { 128 | hr = pExperienceManager->lpVtbl->ShowFlyout(pExperienceManager, pRc); 129 | } 130 | else if (bAction == INVOKE_FLYOUT_HIDE) 131 | { 132 | hr = pExperienceManager->lpVtbl->HideFlyout(pExperienceManager); 133 | } 134 | pExperienceManager->lpVtbl->Release(pExperienceManager); 135 | } 136 | 137 | } 138 | WindowsDeleteString(hstring); 139 | } 140 | pShellExperienceManagerFactory->lpVtbl->Release(pShellExperienceManagerFactory); 141 | } 142 | pImmersiveShell->lpVtbl->Release(pImmersiveShell); 143 | } 144 | return hr; 145 | } 146 | -------------------------------------------------------------------------------- /ExplorerPatcher/ImmersiveFlyouts.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_IMMERSIVEFLYOUTS_H_ 2 | #define _H_IMMERSIVEFLYOUTS_H_ 3 | #include 4 | #include 5 | #include "utility.h" 6 | 7 | DEFINE_GUID(IID_TrayBatteryFlyoutExperienceManager, 8 | 0x0a73aedc, 9 | 0x1c68, 0x410d, 0x8d, 0x53, 10 | 0x63, 0xaf, 0x80, 0x95, 0x1e, 0x8f 11 | ); 12 | DEFINE_GUID(IID_TrayClockFlyoutExperienceManager, 13 | 0xb1604325, 14 | 0x6b59, 0x427b, 0xbf, 0x1b, 15 | 0x80, 0xa2, 0xdb, 0x02, 0xd3, 0xd8 16 | ); 17 | DEFINE_GUID(IID_TrayMtcUvcFlyoutExperienceManager, 18 | 0x7154c95d, 19 | 0xc519, 0x49bd, 0xa9, 0x7e, 20 | 0x64, 0x5b, 0xbf, 0xab, 0xE1, 0x11 21 | ); 22 | DEFINE_GUID(IID_NetworkFlyoutExperienceManager, 23 | 0xC9DDC674, 24 | 0xB44B, 0x4C67, 0x9D, 0x79, 25 | 0x2B, 0x23, 0x7D, 0x9B, 0xE0, 0x5A 26 | ); 27 | typedef interface IExperienceManager IExperienceManager; 28 | 29 | typedef struct IExperienceManagerVtbl // : IInspectable 30 | { 31 | BEGIN_INTERFACE 32 | 33 | HRESULT(STDMETHODCALLTYPE* QueryInterface)( 34 | IExperienceManager* This, 35 | /* [in] */ REFIID riid, 36 | /* [annotation][iid_is][out] */ 37 | _COM_Outptr_ void** ppvObject); 38 | 39 | ULONG(STDMETHODCALLTYPE* AddRef)( 40 | IExperienceManager* This); 41 | 42 | ULONG(STDMETHODCALLTYPE* Release)( 43 | IExperienceManager* This); 44 | 45 | HRESULT(STDMETHODCALLTYPE* GetIids)( 46 | IExperienceManager* This, 47 | ULONG* iidCount, 48 | IID** iids); 49 | 50 | HRESULT(STDMETHODCALLTYPE* GetRuntimeClassName)( 51 | IExperienceManager* This, 52 | HSTRING* className); 53 | 54 | HRESULT(STDMETHODCALLTYPE* GetTrustLevel)( 55 | IExperienceManager* This, 56 | TrustLevel* trustLevel); 57 | 58 | HRESULT(STDMETHODCALLTYPE* ShowFlyout)( 59 | IExperienceManager* This, 60 | /* [in] */ __x_ABI_CWindows_CFoundation_CRect* rect); 61 | 62 | HRESULT(STDMETHODCALLTYPE* HideFlyout)( 63 | IExperienceManager* This); 64 | 65 | END_INTERFACE 66 | } IExperienceManagerVtbl; 67 | 68 | interface IExperienceManager 69 | { 70 | CONST_VTBL struct IExperienceManagerVtbl* lpVtbl; 71 | }; 72 | 73 | DEFINE_GUID(CLSID_ShellExperienceManagerFactory, 74 | 0x2E8FCB18, 75 | 0xA0EE, 0x41AD, 0x8E, 0xF8, 76 | 0x77, 0xFB, 0x3A, 0x37, 0x0C, 0xA5 77 | ); 78 | typedef interface IShellExperienceManagerFactory IShellExperienceManagerFactory; 79 | 80 | typedef struct IShellExperienceManagerFactoryVtbl // : IInspectable 81 | { 82 | BEGIN_INTERFACE 83 | 84 | HRESULT(STDMETHODCALLTYPE* QueryInterface)( 85 | IShellExperienceManagerFactory* This, 86 | /* [in] */ REFIID riid, 87 | /* [annotation][iid_is][out] */ 88 | _COM_Outptr_ void** ppvObject); 89 | 90 | ULONG(STDMETHODCALLTYPE* AddRef)( 91 | IShellExperienceManagerFactory* This); 92 | 93 | ULONG(STDMETHODCALLTYPE* Release)( 94 | IShellExperienceManagerFactory* This); 95 | 96 | HRESULT(STDMETHODCALLTYPE* GetIids)( 97 | IShellExperienceManagerFactory* This, 98 | ULONG* iidCount, 99 | IID** iids); 100 | 101 | HRESULT(STDMETHODCALLTYPE* GetRuntimeClassName)( 102 | IShellExperienceManagerFactory* This, 103 | HSTRING* className); 104 | 105 | HRESULT(STDMETHODCALLTYPE* GetTrustLevel)( 106 | IShellExperienceManagerFactory* This, 107 | TrustLevel* trustLevel); 108 | 109 | HRESULT(STDMETHODCALLTYPE* GetExperienceManager)( 110 | IShellExperienceManagerFactory* This, 111 | /* [in] */ HSTRING* experience, 112 | _COM_Outptr_ IInspectable** ppvObject); 113 | 114 | END_INTERFACE 115 | } IShellExperienceManagerFactoryVtbl; 116 | 117 | interface IShellExperienceManagerFactory 118 | { 119 | CONST_VTBL struct IShellExperienceManagerFactoryVtbl* lpVtbl; 120 | }; 121 | 122 | DEFINE_GUID(IID_ActionCenterExperienceManager, 123 | 0xdec04b18, 124 | 0x357e, 0x41d8, 0x9b, 0x71, 125 | 0xb9, 0x91, 0x24, 0x3b, 0xea, 0x34 126 | ); 127 | DEFINE_GUID(IID_ControlCenterExperienceManager, 128 | 0xd669a58e, 129 | 0x6b18, 0x4d1d, 0x90, 0x04, 130 | 0xa8, 0x86, 0x2a, 0xdb, 0x0a, 0x20 131 | ); 132 | typedef interface IActionCenterOrControlCenterExperienceManager IActionCenterOrControlCenterExperienceManager; 133 | 134 | typedef struct IActionCenterOrControlCenterExperienceManagerVtbl // : IInspectable 135 | { 136 | BEGIN_INTERFACE 137 | 138 | HRESULT(STDMETHODCALLTYPE* QueryInterface)( 139 | IActionCenterOrControlCenterExperienceManager* This, 140 | /* [in] */ REFIID riid, 141 | /* [annotation][iid_is][out] */ 142 | _COM_Outptr_ void** ppvObject); 143 | 144 | ULONG(STDMETHODCALLTYPE* AddRef)( 145 | IActionCenterOrControlCenterExperienceManager* This); 146 | 147 | ULONG(STDMETHODCALLTYPE* Release)( 148 | IActionCenterOrControlCenterExperienceManager* This); 149 | 150 | HRESULT(STDMETHODCALLTYPE* GetIids)( 151 | IActionCenterOrControlCenterExperienceManager* This, 152 | ULONG* iidCount, 153 | IID** iids); 154 | 155 | HRESULT(STDMETHODCALLTYPE* GetRuntimeClassName)( 156 | IActionCenterOrControlCenterExperienceManager* This, 157 | HSTRING* className); 158 | 159 | HRESULT(STDMETHODCALLTYPE* GetTrustLevel)( 160 | IActionCenterOrControlCenterExperienceManager* This, 161 | TrustLevel* trustLevel); 162 | 163 | HRESULT(STDMETHODCALLTYPE* HotKeyInvoked)( 164 | IActionCenterOrControlCenterExperienceManager* This, 165 | /* [in] */ void* kind); 166 | 167 | HRESULT(STDMETHODCALLTYPE* Show)( // only in control center 168 | IActionCenterOrControlCenterExperienceManager* This, 169 | HSTRING hstringUnknown, 170 | void* bSupressAnimations, 171 | void* dwUnknown_ShouldBeOne); 172 | 173 | HRESULT(STDMETHODCALLTYPE* Hide)( // only in control center 174 | IActionCenterOrControlCenterExperienceManager* This, 175 | HSTRING hstringUnknown, 176 | void* bSupressAnimations); 177 | 178 | END_INTERFACE 179 | } IActionCenterOrControlCenterExperienceManagerVtbl; 180 | 181 | interface IActionCenterOrControlCenterExperienceManager 182 | { 183 | CONST_VTBL struct IActionCenterOrControlCenterExperienceManagerVtbl* lpVtbl; 184 | }; 185 | 186 | void InvokeActionCenter(); 187 | 188 | #define INVOKE_FLYOUT_SHOW 1 189 | #define INVOKE_FLYOUT_HIDE 2 190 | #define INVOKE_FLYOUT_NETWORK 1 191 | #define INVOKE_FLYOUT_CLOCK 2 192 | #define INVOKE_FLYOUT_BATTERY 3 193 | #define INVOKE_FLYOUT_SOUND 4 194 | 195 | HRESULT InvokeFlyoutRect(BOOL bAction, DWORD dwWhich, __x_ABI_CWindows_CFoundation_CRect* pRc); 196 | 197 | inline HRESULT InvokeFlyout(BOOL bAction, DWORD dwWhich) 198 | { 199 | __x_ABI_CWindows_CFoundation_CRect rc; 200 | ZeroMemory(&rc, sizeof(rc)); 201 | return InvokeFlyoutRect(bAction, dwWhich, &rc); 202 | } 203 | 204 | #endif -------------------------------------------------------------------------------- /ExplorerPatcher/RefreshedStyles.xbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yukari316/ExplorerPatcher_zh-CN/f908378cbc712de9f8e7ba4e9f2b93d83418af58/ExplorerPatcher/RefreshedStyles.xbf -------------------------------------------------------------------------------- /ExplorerPatcher/SettingsMonitor.c: -------------------------------------------------------------------------------- 1 | #include "SettingsMonitor.h" 2 | 3 | DWORD WINAPI MonitorSettings(SettingsChangeParameters* params) 4 | { 5 | BOOL bShouldExit = FALSE; 6 | HANDLE* handles = NULL; 7 | while (TRUE) 8 | { 9 | handles = calloc(sizeof(HANDLE), params->size); 10 | if (handles) 11 | { 12 | for (unsigned int i = 0; i < params->size; ++i) 13 | { 14 | if (i == 0) 15 | { 16 | if (params->settings[i].hEvent) 17 | { 18 | handles[i] = params->settings[i].hEvent; 19 | continue; 20 | } 21 | else 22 | { 23 | free(handles); 24 | free(params->settings); 25 | free(params); 26 | return 0; 27 | } 28 | } 29 | params->settings[i].hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); 30 | if (!params->settings[i].hEvent) 31 | { 32 | free(handles); 33 | free(params->settings); 34 | free(params); 35 | return 0; 36 | } 37 | handles[i] = params->settings[i].hEvent; 38 | if (RegCreateKeyExW( 39 | params->settings[i].origin, 40 | params->settings[i].name, 41 | 0, 42 | NULL, 43 | REG_OPTION_NON_VOLATILE, 44 | KEY_READ, 45 | NULL, 46 | &(params->settings[i].hKey), 47 | NULL 48 | ) != ERROR_SUCCESS) 49 | { 50 | free(handles); 51 | free(params->settings); 52 | free(params); 53 | return 0; 54 | } 55 | if (RegNotifyChangeKeyValue( 56 | params->settings[i].hKey, 57 | FALSE, 58 | REG_NOTIFY_CHANGE_LAST_SET, 59 | params->settings[i].hEvent, 60 | TRUE 61 | ) != ERROR_SUCCESS) 62 | { 63 | free(handles); 64 | free(params->settings); 65 | free(params); 66 | return 0; 67 | } 68 | } 69 | DWORD dwRes = WaitForMultipleObjects( 70 | params->size, 71 | handles, 72 | FALSE, 73 | INFINITE 74 | ); 75 | if (dwRes != WAIT_FAILED) 76 | { 77 | unsigned int i = dwRes - WAIT_OBJECT_0; 78 | if (i >= 1 && i < params->size) 79 | { 80 | params->settings[i].callback(params->settings[i].data); 81 | } 82 | else if (i == 0) 83 | { 84 | bShouldExit = TRUE; 85 | } 86 | for (unsigned int j = 1; j < params->size; ++j) 87 | { 88 | if (WaitForSingleObject(handles[j], 0) == WAIT_OBJECT_0) 89 | { 90 | params->settings[j].callback(params->settings[j].data); 91 | } 92 | } 93 | } 94 | free(handles); 95 | for (unsigned int i = 1; i < params->size; ++i) 96 | { 97 | if (params->settings[i].hEvent) 98 | { 99 | CloseHandle(params->settings[i].hEvent); 100 | } 101 | if (params->settings[i].hKey) 102 | { 103 | RegCloseKey(params->settings[i].hKey); 104 | } 105 | } 106 | if (bShouldExit) 107 | { 108 | break; 109 | } 110 | } 111 | else 112 | { 113 | free(params->settings); 114 | free(params); 115 | return 0; 116 | } 117 | } 118 | free(params->settings); 119 | free(params); 120 | return 0; 121 | } 122 | 123 | -------------------------------------------------------------------------------- /ExplorerPatcher/SettingsMonitor.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_SETTINGSMONITOR_H_ 2 | #define _H_SETTINGSMONITOR_H_ 3 | #include 4 | #include 5 | #pragma comment(lib, "Shlwapi.lib") 6 | #include 7 | 8 | typedef struct _Setting 9 | { 10 | HKEY origin; 11 | wchar_t name[MAX_PATH]; 12 | HKEY hKey; 13 | HANDLE hEvent; 14 | void(__stdcall *callback)(void*); 15 | void* data; 16 | } Setting; 17 | typedef struct _SettingsChangeParameters 18 | { 19 | Setting* settings; 20 | DWORD size; 21 | HANDLE hThread; 22 | } SettingsChangeParameters; 23 | DWORD WINAPI MonitorSettings(SettingsChangeParameters*); 24 | #endif 25 | -------------------------------------------------------------------------------- /ExplorerPatcher/StartupSound.c: -------------------------------------------------------------------------------- 1 | #include "StartupSound.h" 2 | 3 | DWORD PlayStartupSound(PlayStartupSoundParams* unused) 4 | { 5 | Sleep(2000); 6 | printf("Started \"Play startup sound\" thread.\n"); 7 | 8 | HRESULT hr = CoInitialize(NULL); 9 | 10 | // this checks Software\\Microsoft\\Windows\\CurrentVersion\\Authentication\\LogonUI\\LogonSoundPlayed 11 | // and then plays the startup sound 12 | 13 | AuthUILogonSound* ppv; 14 | hr = CoCreateInstance( 15 | &__uuidof_AuthUILogonSound, 16 | NULL, 17 | CLSCTX_INPROC_SERVER, 18 | &__uuidof_IAuthUILogonSound, 19 | &ppv 20 | ); 21 | if (SUCCEEDED(hr)) 22 | { 23 | ppv->lpVtbl->PlayIfNecessary(ppv, 1); 24 | ppv->lpVtbl->Release(ppv); 25 | } 26 | 27 | printf("Ended \"Play startup sound\" thread.\n"); 28 | return 0; 29 | } -------------------------------------------------------------------------------- /ExplorerPatcher/StartupSound.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_STARTUPSOUND_H_ 2 | #define _H_STARTUPSOUND_H_ 3 | #include 4 | #include 5 | 6 | DEFINE_GUID(__uuidof_AuthUILogonSound, 7 | 0x0A0D018EE, 8 | 0x1100, 0x4389, 0xAB, 0x44, 9 | 0x46, 0x4F, 0xAF, 0x00, 0x12, 0x88 10 | ); 11 | DEFINE_GUID(__uuidof_IAuthUILogonSound, 12 | 0xc35243ea, 13 | 0x4cfc, 0x435a, 0x91, 0xc2, 14 | 0x9d, 0xbd, 0xec, 0xbf, 0xfc, 0x95 15 | ); 16 | 17 | typedef interface AuthUILogonSound AuthUILogonSound; 18 | 19 | typedef struct AuthUILogonSoundVtbl 20 | { 21 | BEGIN_INTERFACE 22 | 23 | HRESULT(STDMETHODCALLTYPE* QueryInterface)( 24 | AuthUILogonSound* This, 25 | /* [in] */ REFIID riid, 26 | /* [annotation][iid_is][out] */ 27 | _COM_Outptr_ void** ppvObject); 28 | 29 | ULONG(STDMETHODCALLTYPE* AddRef)( 30 | AuthUILogonSound* This); 31 | 32 | ULONG(STDMETHODCALLTYPE* Release)( 33 | AuthUILogonSound* This); 34 | 35 | HRESULT(STDMETHODCALLTYPE* PlayIfNecessary)( 36 | AuthUILogonSound* This, 37 | /* [in] */ INT64 a1); 38 | 39 | END_INTERFACE 40 | } AuthUILogonSoundVtbl; 41 | 42 | interface AuthUILogonSound 43 | { 44 | CONST_VTBL struct AuthUILogonSoundVtbl* lpVtbl; 45 | }; 46 | 47 | typedef DWORD PlayStartupSoundParams; 48 | 49 | DWORD PlayStartupSound(PlayStartupSoundParams* unused); 50 | #endif -------------------------------------------------------------------------------- /ExplorerPatcher/TaskbarCenter.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_TASKBARCENTER_H_ 2 | #define _H_TASKBARCENTER_H_ 3 | #include 4 | #include 5 | #include 6 | #include 7 | #pragma comment(lib, "Oleacc.lib") 8 | #include 9 | #include 10 | #include 11 | #define MAX(a,b) ((a) > (b) ? (a) : (b)) 12 | #define MIN(a,b) ((a) < (b) ? (a) : (b)) 13 | #define MIN_DIM 600 14 | 15 | inline BOOL TaskbarCenter_IsTaskbarHorizontal(HWND hWnd) 16 | { 17 | __int64 v1; 18 | __int64 result; 19 | v1 = *((__int64*)GetWindowLongPtrW(hWnd, 0) + 13); 20 | result = 1i64; 21 | if (v1) 22 | return (*(__int64(__fastcall**)(__int64))(*(__int64*)v1 + 96))(v1); 23 | return result; 24 | } 25 | 26 | inline BOOL TaskbarCenter_ShouldCenter(DWORD dwSetting) 27 | { 28 | return (dwSetting & 0b001); 29 | } 30 | 31 | inline BOOL TaskbarCenter_ShouldStartBeCentered(DWORD dwSetting) 32 | { 33 | return (dwSetting & 0b010); 34 | } 35 | 36 | inline BOOL TaskbarCenter_ShouldLeftAlignWhenSpaceConstrained(DWORD dwSetting) 37 | { 38 | return (dwSetting & 0b100); 39 | } 40 | 41 | BOOL TaskbarCenter_GetClientRectHook(HWND hWnd, LPRECT lpRect); 42 | 43 | BOOL TaskbarCenter_SHWindowsPolicy(REFIID riid); 44 | #endif -------------------------------------------------------------------------------- /ExplorerPatcher/def.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_DEF_H_ 2 | #define _H_DEF_H_ 3 | #define APPID L"Microsoft.Windows.Explorer" 4 | #define REGPATH "Software\\ExplorerPatcher" 5 | #define REGPATH_OLD "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ExplorerPatcher" 6 | #define REGPATH_STARTMENU REGPATH_OLD 7 | #define SPECIAL_FOLDER CSIDL_PROGRAM_FILES 8 | #define SPECIAL_FOLDER_LEGACY CSIDL_APPDATA 9 | #define PRODUCT_NAME "ExplorerPatcher" 10 | #define PRODUCT_PUBLISHER "VALINET Solutions SRL" 11 | #define APP_RELATIVE_PATH "\\" PRODUCT_NAME 12 | #define EP_CLSID_LITE "D17F1E1A-5919-4427-8F89-A1A8503CA3EB" 13 | #define EP_CLSID "{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}" 14 | #define DOSMODE_OFFSET 78 15 | #define SETUP_UTILITY_NAME "ep_setup.exe" 16 | #define TOAST_BUFSIZ 1024 17 | #define SEH_REGPATH "Control Panel\\Quick Actions\\Control Center\\QuickActionsStateCapture\\ExplorerPatcher" 18 | #define EP_SETUP_HELPER_SWITCH "/CreateExplorerShellUnelevatedAfterServicing" 19 | #define EP_DWM_SERVICENAME "ep_dwm_" EP_CLSID_LITE 20 | #define EP_DWM_EVENTNAME "Global\\ep_dwm_2_" EP_CLSID_LITE 21 | #define EP_SETUP_EVENTNAME "Global\\ep_setup_" EP_CLSID_LITE 22 | #endif -------------------------------------------------------------------------------- /ExplorerPatcher/dxgi_imp.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_DXGI_IMP_H_ 2 | #define _H_DXGI_IMP_H_ 3 | #include 4 | static HRESULT(*ApplyCompatResolutionQuirkingFunc)(void*, void*); 5 | __declspec(dllexport) HRESULT ApplyCompatResolutionQuirking(void* p1, void* p2) 6 | { 7 | return ApplyCompatResolutionQuirkingFunc(p1, p2); 8 | } 9 | static HRESULT(*CompatStringFunc)(void*, void*, void*, BOOL); 10 | __declspec(dllexport) HRESULT CompatString(void* p1, void* p2, void* p3, BOOL p4) 11 | { 12 | return CompatStringFunc(p1, p2, p3, p4); 13 | } 14 | static HRESULT(*CompatValueFunc)(void*, void*); 15 | __declspec(dllexport) HRESULT CompatValue(void* p1, void* p2) 16 | { 17 | return CompatValueFunc(p1, p2); 18 | } 19 | static HRESULT(*CreateDXGIFactoryFunc)(void*, void**); 20 | __declspec(dllexport) HRESULT CreateDXGIFactory(void* p1, void** p2) 21 | { 22 | return CreateDXGIFactoryFunc(p1, p2); 23 | } 24 | static HRESULT(*CreateDXGIFactory1Func)(void*, void**); 25 | static HRESULT(*CreateDXGIFactory2Func)(UINT, void*, void**); 26 | __declspec(dllexport) HRESULT CreateDXGIFactory2(UINT p1, void* p2, void** p3) 27 | { 28 | return CreateDXGIFactory2Func(p1, p2, p3); 29 | } 30 | static HRESULT(*DXGID3D10CreateDeviceFunc)(); 31 | __declspec(dllexport) HRESULT DXGID3D10CreateDevice() { 32 | return DXGID3D10CreateDeviceFunc(); 33 | } 34 | static HRESULT(*DXGID3D10CreateLayeredDeviceFunc)(); 35 | __declspec(dllexport) HRESULT DXGID3D10CreateLayeredDevice() 36 | { 37 | return DXGID3D10CreateLayeredDeviceFunc(); 38 | } 39 | static HRESULT(*DXGID3D10GetLayeredDeviceSizeFunc)(); 40 | __declspec(dllexport) HRESULT DXGID3D10GetLayeredDeviceSize() 41 | { 42 | return DXGID3D10GetLayeredDeviceSizeFunc(); 43 | } 44 | static HRESULT(*DXGID3D10RegisterLayersFunc)(); 45 | __declspec(dllexport) HRESULT DXGID3D10RegisterLayers() 46 | { 47 | return DXGID3D10RegisterLayersFunc(); 48 | } 49 | static HRESULT(*DXGIDeclareAdapterRemovalSupportFunc)(); 50 | static HRESULT(*DXGIDumpJournalFunc)(void*); 51 | __declspec(dllexport) HRESULT DXGIDumpJournal(void* p1) 52 | { 53 | return DXGIDumpJournalFunc(p1); 54 | } 55 | static HRESULT(*DXGIGetDebugInterface1Func)(UINT, void*, void**); 56 | __declspec(dllexport) HRESULT DXGIGetDebugInterface1(UINT p1, void* p2, void* p3) 57 | { 58 | return DXGIGetDebugInterface1Func(p1, p2, p3); 59 | } 60 | static HRESULT(*DXGIReportAdapterConfigurationFunc)(); 61 | __declspec(dllexport) HRESULT DXGIReportAdapterConfiguration(void* p1) 62 | { 63 | return DXGIReportAdapterConfigurationFunc(p1); 64 | } 65 | static HRESULT(*PIXBeginCaptureFunc)(INT64, void*); 66 | __declspec(dllexport) HRESULT PIXBeginCapture(INT64 p1, void* p2) 67 | { 68 | return PIXBeginCaptureFunc(p1, p2); 69 | } 70 | static HRESULT(*PIXEndCaptureFunc)(); 71 | __declspec(dllexport) HRESULT PIXEndCapture() 72 | { 73 | return PIXEndCaptureFunc(); 74 | } 75 | static HRESULT(*PIXGetCaptureStateFunc)(); 76 | __declspec(dllexport) HRESULT PIXGetCaptureState() 77 | { 78 | return PIXGetCaptureStateFunc(); 79 | } 80 | static HRESULT(*SetAppCompatStringPointerFunc)(SIZE_T, void*); 81 | __declspec(dllexport) HRESULT SetAppCompatStringPointer(SIZE_T p1, void* p2) 82 | { 83 | return SetAppCompatStringPointerFunc(p1, p2); 84 | } 85 | static HRESULT(*UpdateHMDEmulationStatusFunc)(char); 86 | __declspec(dllexport) HRESULT UpdateHMDEmulationStatus(char p1) 87 | { 88 | return UpdateHMDEmulationStatusFunc(p1); 89 | } 90 | inline void SetupDXGIImportFunctions(HMODULE hModule) 91 | { 92 | ApplyCompatResolutionQuirkingFunc = (HRESULT(*)(void*, void*))GetProcAddress(hModule, "ApplyCompatResolutionQuirking"); 93 | CompatStringFunc = (HRESULT(*)(void*, void*, void*, BOOL))GetProcAddress(hModule, "CompatString"); 94 | CompatValueFunc = (HRESULT(*)(void*, void*))GetProcAddress(hModule, "CompatValue"); 95 | CreateDXGIFactoryFunc = (HRESULT(*)(void*, void**))GetProcAddress(hModule, "CreateDXGIFactory"); 96 | CreateDXGIFactory1Func = (HRESULT(*)(void*, void**))GetProcAddress(hModule, "CreateDXGIFactory1"); 97 | CreateDXGIFactory2Func = (HRESULT(*)(UINT, void*, void**))GetProcAddress(hModule, "CreateDXGIFactory2"); 98 | DXGID3D10CreateDeviceFunc = (HRESULT(*)())GetProcAddress(hModule, "DXGID3D10CreateDevice"); 99 | DXGID3D10CreateLayeredDeviceFunc = (HRESULT(*)())GetProcAddress(hModule, "DXGID3D10CreateLayeredDevice"); 100 | DXGID3D10GetLayeredDeviceSizeFunc = (HRESULT(*)())GetProcAddress(hModule, "DXGID3D10GetLayeredDeviceSize"); 101 | DXGID3D10RegisterLayersFunc = (HRESULT(*)())GetProcAddress(hModule, "DXGID3D10RegisterLayers"); 102 | DXGIDeclareAdapterRemovalSupportFunc = (HRESULT(*)())GetProcAddress(hModule, "DXGIDeclareAdapterRemovalSupport"); 103 | DXGIDumpJournalFunc = (HRESULT(*)(void*))GetProcAddress(hModule, "DXGIDumpJournal"); 104 | DXGIGetDebugInterface1Func = (HRESULT(*)(UINT, void*, void**))GetProcAddress(hModule, "DXGIGetDebugInterface1"); 105 | DXGIReportAdapterConfigurationFunc = (HRESULT(*)())GetProcAddress(hModule, "DXGIReportAdapterConfiguration"); 106 | PIXBeginCaptureFunc = (HRESULT(*)(INT64, void*))GetProcAddress(hModule, "PIXBeginCapture"); 107 | PIXEndCaptureFunc = (HRESULT(*)())GetProcAddress(hModule, "PIXEndCapture"); 108 | PIXGetCaptureStateFunc = (HRESULT(*)())GetProcAddress(hModule, "PIXGetCaptureState"); 109 | SetAppCompatStringPointerFunc = (HRESULT(*)(SIZE_T, void*))GetProcAddress(hModule, "SetAppCompatStringPointer"); 110 | UpdateHMDEmulationStatusFunc = (HRESULT(*)(char))GetProcAddress(hModule, "UpdateHMDEmulationStatus"); 111 | } 112 | #endif 113 | -------------------------------------------------------------------------------- /ExplorerPatcher/fmemopen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Joachim Nilsson 3 | * 4 | * Permission to use, copy, modify, and/or distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | 17 | #include "fmemopen.h" 18 | 19 | FILE* fmemopen(void* buf, size_t len, const char* type) 20 | { 21 | int fd; 22 | FILE* fp; 23 | char tp[MAX_PATH - 13]; 24 | char fn[MAX_PATH + 1]; 25 | 26 | if (!GetTempPathA(sizeof(tp), tp)) 27 | return NULL; 28 | 29 | if (!GetTempFileNameA(tp, "eptmp", 0, fn)) 30 | return NULL; 31 | 32 | _sopen_s(&fd, fn, 33 | _O_CREAT | _O_RDWR | _O_SHORT_LIVED | _O_TEMPORARY | _O_BINARY, 34 | _SH_DENYRW, 35 | _S_IREAD | _S_IWRITE); 36 | if (fd == -1) 37 | return NULL; 38 | 39 | fp = _fdopen(fd, "w+"); 40 | if (!fp) { 41 | _close(fd); 42 | return NULL; 43 | } 44 | 45 | fwrite(buf, len, 1, fp); 46 | rewind(fp); 47 | 48 | return fp; 49 | } -------------------------------------------------------------------------------- /ExplorerPatcher/fmemopen.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_FMEMOPEN_H_ 2 | #define _H_FMEMOPEN_H_ 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | FILE* fmemopen(void* buf, size_t len, const char* type); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif -------------------------------------------------------------------------------- /ExplorerPatcher/getline.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2011 The NetBSD Foundation, Inc. 3 | * All rights reserved. 4 | * 5 | * This code is derived from software contributed to The NetBSD Foundation 6 | * by Christos Zoulas. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | #include "getline.h" 30 | 31 | ssize_t 32 | getdelim(char** buf, size_t* bufsiz, int delimiter, FILE* fp) 33 | { 34 | char* ptr, * eptr; 35 | 36 | 37 | if (*buf == NULL || *bufsiz == 0) { 38 | *bufsiz = BUFSIZ; 39 | if ((*buf = (char*)malloc(*bufsiz)) == NULL) 40 | return -1; 41 | } 42 | 43 | for (ptr = *buf, eptr = *buf + *bufsiz;;) { 44 | int c = fgetc(fp); 45 | if (c == -1) { 46 | if (feof(fp)) { 47 | ssize_t diff = (ssize_t)(ptr - *buf); 48 | if (diff != 0) { 49 | *ptr = '\0'; 50 | return diff; 51 | } 52 | } 53 | return -1; 54 | } 55 | *ptr++ = c; 56 | if (c == delimiter) { 57 | *ptr = '\0'; 58 | return ptr - *buf; 59 | } 60 | if (ptr + 2 >= eptr) { 61 | char* nbuf; 62 | size_t nbufsiz = *bufsiz * 2; 63 | ssize_t d = ptr - *buf; 64 | if ((nbuf = (char*)realloc(*buf, nbufsiz)) == NULL) 65 | return -1; 66 | *buf = nbuf; 67 | *bufsiz = nbufsiz; 68 | eptr = nbuf + nbufsiz; 69 | ptr = nbuf + d; 70 | } 71 | } 72 | } 73 | 74 | ssize_t 75 | getline(char** buf, size_t* bufsiz, FILE* fp) 76 | { 77 | return getdelim(buf, bufsiz, '\n', fp); 78 | } -------------------------------------------------------------------------------- /ExplorerPatcher/getline.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_GETLINE_H_ 2 | #define _H_GETLINE_H_ 3 | #include 4 | #include 5 | #include 6 | typedef SSIZE_T ssize_t; 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | ssize_t getdelim(char** buf, size_t* bufsiz, int delimiter, FILE* fp); 13 | 14 | ssize_t getline(char** buf, size_t* bufsiz, FILE* fp); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif -------------------------------------------------------------------------------- /ExplorerPatcher/helper.c: -------------------------------------------------------------------------------- 1 | #include "helper.h" 2 | 3 | LPWSTR Utf8Text(LPCCH input) 4 | { 5 | //获取输入字符串大小 6 | // int bufSize = strlen(input); 7 | 8 | //获取所需缓冲大小 9 | int cchSize = MultiByteToWideChar( 10 | CP_UTF8, 11 | MB_PRECOMPOSED, 12 | input, 13 | -1, 14 | NULL, 15 | 0 16 | ); 17 | 18 | LPWSTR output = (wchar_t*)malloc(cchSize*sizeof(wchar_t)); 19 | 20 | MultiByteToWideChar( 21 | CP_UTF8, 22 | MB_PRECOMPOSED, 23 | input, 24 | -1, 25 | output, 26 | cchSize 27 | ); 28 | 29 | return output; 30 | } 31 | -------------------------------------------------------------------------------- /ExplorerPatcher/helper.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_HELPER_H_ 2 | #define _H_HELPER_H_ 3 | 4 | #include 5 | 6 | LPWSTR Utf8Text(LPCCH input); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ExplorerPatcher/hooking.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_HOOKING_H_ 2 | #define _H_HOOKING_H_ 3 | #define STRAT_REPLACE_ANY_TYPE_OF_JUMP_WITH_NOP 0 4 | #define STRAT_REPLACE_ANY_TYPE_OF_JUMP_WITH_ALWAYS_JUMP 1 5 | #define HOOK_WITH_FUNCHOOK 0 6 | #define HOOK_WITH_DETOURS 1 7 | #define HOW_TO_HOOK HOOK_WITH_FUNCHOOK 8 | #if HOW_TO_HOOK == HOOK_WITH_FUNCHOOK 9 | #ifdef _M_ARM64 10 | #error Cannot compile for ARM64 using funchook. Change the source to hook with Detours and try again. Compilation aborted. 11 | #endif 12 | #include 13 | #include 14 | #pragma comment(lib, "funchook.lib") 15 | #pragma comment(lib, "Psapi.lib") // required by funchook 16 | #pragma comment(lib, "distorm.lib") 17 | #elif HOW_TO_HOOK == HOOK_WITH_DETOURS 18 | #include 19 | #pragma comment(lib, "detours.lib") 20 | void* funchook_create(void) 21 | { 22 | return 1; 23 | } 24 | int funchook_uninstall( 25 | void* _this, 26 | int flags 27 | ) 28 | { 29 | return 0; 30 | } 31 | int funchook_destroy(void* _this) 32 | { 33 | return 0; 34 | } 35 | int funchook_prepare( 36 | void* funchook, 37 | void** target_func, 38 | void* hook_func 39 | ) 40 | { 41 | DetourTransactionBegin(); 42 | DetourUpdateThread(GetCurrentThread()); 43 | DetourAttach(target_func, hook_func); 44 | return DetourTransactionCommit(); 45 | } 46 | int funchook_install( 47 | void* funchook, 48 | int flags 49 | ) 50 | { 51 | return 0; 52 | } 53 | #endif 54 | #if HOW_TO_HOOK == HOOK_WITH_FUNCHOOK 55 | funchook_t* funchook = 0; 56 | #elif HOW_TO_HOOK == HOOK_WITH_DETOURS 57 | void* funchook = 0; 58 | #endif 59 | #endif -------------------------------------------------------------------------------- /ExplorerPatcher/osutility.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_OSUTILITY_H_ 2 | #define _H_OSUTILITY_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | // This allows compiling with older Windows SDKs as well 8 | #ifndef NTDDI_WIN10_CO 9 | #define DWMWA_USE_HOSTBACKDROPBRUSH 17 // [set] BOOL, Allows the use of host backdrop brushes for the window. 10 | #define DWMWA_USE_IMMERSIVE_DARK_MODE 20 // [set] BOOL, Allows a window to either use the accent color, or dark, according to the user Color Mode preferences. 11 | #define DWMWA_WINDOW_CORNER_PREFERENCE 33 // [set] WINDOW_CORNER_PREFERENCE, Controls the policy that rounds top-level window corners 12 | #define DWMWA_BORDER_COLOR 34 // [set] COLORREF, The color of the thin border around a top-level window 13 | #define DWMWA_CAPTION_COLOR 35 // [set] COLORREF, The color of the caption 14 | #define DWMWA_TEXT_COLOR 36 // [set] COLORREF, The color of the caption text 15 | #define DWMWA_VISIBLE_FRAME_BORDER_THICKNESS 37 // [get] UINT, width of the visible border around a thick frame window 16 | #define DWMWCP_DEFAULT 0 17 | #define DWMWCP_DONOTROUND 1 18 | #define DWMWCP_ROUND 2 19 | #define DWMWCP_ROUNDSMALL 3 20 | #endif 21 | #define DWMWA_MICA_EFFFECT 1029 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | extern RTL_OSVERSIONINFOW global_rovi; 28 | extern DWORD32 global_ubr; 29 | 30 | inline void InitializeGlobalVersionAndUBR() 31 | { 32 | global_ubr = VnGetOSVersionAndUBR(&global_rovi); 33 | } 34 | 35 | inline BOOL IsWindows11() 36 | { 37 | if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi); 38 | if (global_rovi.dwBuildNumber >= 21996) return TRUE; 39 | return FALSE; 40 | } 41 | 42 | inline BOOL IsDwmExtendFrameIntoClientAreaBrokenInThisBuild() 43 | { 44 | if (!IsWindows11()) 45 | { 46 | return FALSE; 47 | } 48 | if ((global_rovi.dwBuildNumber >= 21996 && global_rovi.dwBuildNumber < 22000) || (global_rovi.dwBuildNumber == 22000 && (global_ubr >= 1 && global_ubr <= 51))) 49 | { 50 | return TRUE; 51 | } 52 | return FALSE; 53 | } 54 | 55 | inline HRESULT SetMicaMaterialForThisWindow(HWND hWnd, BOOL bApply) 56 | { 57 | if (!IsWindows11() || IsDwmExtendFrameIntoClientAreaBrokenInThisBuild()) return S_FALSE; 58 | DWORD dwAttribute = (global_rovi.dwBuildNumber >= 22523) ? 38 : DWMWA_MICA_EFFFECT; 59 | DWORD dwProp = (bApply ? ((global_rovi.dwBuildNumber >= 22523) ? 2 : 1) : 0); 60 | return DwmSetWindowAttribute(hWnd, dwAttribute, &dwProp, sizeof(DWORD)); 61 | } 62 | 63 | inline BOOL IsWindows11Version22H2OrHigher() 64 | { 65 | if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi); 66 | return global_rovi.dwBuildNumber >= 22621; 67 | } 68 | 69 | inline BOOL IsWindows11Version23H2OrHigher() 70 | { 71 | if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi); 72 | return global_rovi.dwBuildNumber >= 22631; 73 | } 74 | 75 | inline BOOL IsWindows11BuildHigherThan25158() 76 | { 77 | if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi); 78 | return global_rovi.dwBuildNumber > 25158; 79 | } 80 | 81 | inline BOOL IsWindows11Version22H2Build1413OrHigher() 82 | { 83 | if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi); 84 | if (global_rovi.dwBuildNumber > 22621) return TRUE; 85 | return global_rovi.dwBuildNumber == 22621 && global_ubr >= 1413; 86 | } 87 | 88 | inline BOOL IsWindows11Version22H2Build2134OrHigher() 89 | { 90 | if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi); 91 | if (global_rovi.dwBuildNumber > 22621) return TRUE; 92 | return global_rovi.dwBuildNumber == 22621 && global_ubr >= 2134; 93 | } 94 | 95 | inline BOOL IsWindows11Version22H2Build2361OrHigher() 96 | { 97 | if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi); 98 | if (global_rovi.dwBuildNumber > 22621) return TRUE; 99 | return global_rovi.dwBuildNumber == 22621 && global_ubr >= 2361; 100 | } 101 | 102 | #ifdef __cplusplus 103 | } 104 | #endif 105 | 106 | #endif 107 | -------------------------------------------------------------------------------- /ExplorerPatcher/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ExplorerPatcher/queryversion.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_QUERYVERSION_H_ 2 | #define _H_QUERYVERSION_H_ 3 | #include 4 | #pragma comment(lib, "Version.lib") 5 | 6 | inline void QueryVersionInfo(HMODULE hModule, WORD Resource, DWORD* dwLeftMost, DWORD* dwSecondLeft, DWORD* dwSecondRight, DWORD* dwRightMost) 7 | { 8 | HRSRC hResInfo; 9 | DWORD dwSize; 10 | HGLOBAL hResData; 11 | LPVOID pRes, pResCopy; 12 | UINT uLen; 13 | VS_FIXEDFILEINFO* lpFfi; 14 | 15 | hResInfo = FindResource(hModule, MAKEINTRESOURCE(Resource), RT_VERSION); 16 | dwSize = SizeofResource(hModule, hResInfo); 17 | hResData = LoadResource(hModule, hResInfo); 18 | pRes = LockResource(hResData); 19 | pResCopy = LocalAlloc(LMEM_FIXED, dwSize); 20 | CopyMemory(pResCopy, pRes, dwSize); 21 | FreeResource(hResData); 22 | 23 | VerQueryValue(pResCopy, TEXT("\\"), (LPVOID*)&lpFfi, &uLen); 24 | 25 | DWORD dwFileVersionMS = lpFfi->dwFileVersionMS; 26 | DWORD dwFileVersionLS = lpFfi->dwFileVersionLS; 27 | 28 | *dwLeftMost = HIWORD(dwFileVersionMS); 29 | *dwSecondLeft = LOWORD(dwFileVersionMS); 30 | *dwSecondRight = HIWORD(dwFileVersionLS); 31 | *dwRightMost = LOWORD(dwFileVersionLS); 32 | 33 | LocalFree(pResCopy); 34 | } 35 | #endif -------------------------------------------------------------------------------- /ExplorerPatcher/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by ExplorerPatcher.rc 4 | // 5 | #define IDR_REGISTRY1 101 6 | #define IDS_PRODUCTNAME 102 7 | #define IDS_COPYRIGHT 103 8 | #define IDS_VERSION 104 9 | #define IDS_PRODUCTTAG 105 10 | #define IDS_VISITGITHUB 106 11 | #define IDS_VISITWEBSITE 107 12 | #define IDS_LICENSEINFO 108 13 | #define IDS_INSTALL_SUCCESS_TEXT 109 14 | #define IDS_INSTALL_ERROR_TEXT 110 15 | #define IDS_UNINSTALL_SUCCESS_TEXT 111 16 | #define IDS_UNINSTALL_ERROR_TEXT 112 17 | #define IDS_OPERATION_NONE 113 18 | #define IDR_REGISTRY2 114 19 | #define IDR_REFRESHEDSTYLES_XBF 115 20 | #define IDS_DRIVECATEGORY_HARDDISKDRIVES 40000 21 | #define IDS_DRIVECATEGORY_REMOVABLESTORAGE 40001 22 | #define IDS_DRIVECATEGORY_OTHER 40002 23 | #define IDS_DRIVECATEGORY_IMAGING 40003 24 | #define IDS_DRIVECATEGORY_PORTABLEMEDIA 40004 25 | #define IDS_DRIVECATEGORY_PORTABLEMEDIADEVICE 40004 26 | #define IDS_DRIVECATEGORY_PORTABLEDEVICE 40005 27 | 28 | // Next default values for new objects 29 | // 30 | #ifdef APSTUDIO_INVOKED 31 | #ifndef APSTUDIO_READONLY_SYMBOLS 32 | #define _APS_NEXT_RESOURCE_VALUE 111 33 | #define _APS_NEXT_COMMAND_VALUE 40001 34 | #define _APS_NEXT_CONTROL_VALUE 1001 35 | #define _APS_NEXT_SYMED_VALUE 101 36 | #endif 37 | #endif 38 | -------------------------------------------------------------------------------- /ExplorerPatcher/symbols.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_SYMBOLS_H_ 2 | #define _H_SYMBOLS_H_ 3 | #include 4 | #define _LIBVALINET_INCLUDE_UNIVERSAL 5 | #include 6 | #include 7 | #include 8 | #include "utility.h" 9 | 10 | #define EXIT_CODE_EXPLORER 1 11 | 12 | #define TWINUI_PCSHELL_SB_NAME "twinui.pcshell" 13 | #define TWINUI_PCSHELL_SB_0 "CImmersiveContextMenuOwnerDrawHelper::s_ContextMenuWndProc" 14 | #define TWINUI_PCSHELL_SB_1 "CLauncherTipContextMenu::GetMenuItemsAsync" 15 | #define TWINUI_PCSHELL_SB_2 "ImmersiveContextMenuHelper::ApplyOwnerDrawToMenu" 16 | #define TWINUI_PCSHELL_SB_3 "ImmersiveContextMenuHelper::RemoveOwnerDrawFromMenu" 17 | #define TWINUI_PCSHELL_SB_4 "CLauncherTipContextMenu::_ExecuteShutdownCommand" 18 | #define TWINUI_PCSHELL_SB_5 "CLauncherTipContextMenu::_ExecuteCommand" 19 | #define TWINUI_PCSHELL_SB_6 "CLauncherTipContextMenu::ShowLauncherTipContextMenu" 20 | #define TWINUI_PCSHELL_SB_7 "IsUndockedAssetAvailable" 21 | #define TWINUI_PCSHELL_SB_8 "winrt::Windows::Internal::Shell::implementation::MeetAndChatManager::OnMessage" // should be always last 22 | #define TWINUI_PCSHELL_SB_LAST TWINUI_PCSHELL_SB_8 23 | #define TWINUI_PCSHELL_SB_CNT 9 24 | #define STARTDOCKED_SB_NAME "StartDocked" 25 | #define STARTDOCKED_SB_0 "StartDocked::LauncherFrame::ShowAllApps" // UNUSED 26 | #define STARTDOCKED_SB_1 "StartDocked::LauncherFrame::ShowAllApps" 27 | #define STARTDOCKED_SB_2 "StartDocked::LauncherFrame::OnVisibilityChanged" 28 | #define STARTDOCKED_SB_3 "StartDocked::SystemListPolicyProvider::GetMaximumFrequentApps" 29 | #define STARTDOCKED_SB_4 "StartDocked::StartSizingFrame::StartSizingFrame" 30 | #define STARTDOCKED_SB_CNT 5 31 | #define STARTUI_SB_NAME "StartUI" 32 | #define STARTUI_SB_0 "StartUI::SystemListPolicyProvider::GetMaximumFrequentApps" 33 | #define STARTUI_SB_CNT 1 34 | #pragma pack(push, 1) 35 | typedef struct symbols_addr 36 | { 37 | DWORD twinui_pcshell_PTRS[TWINUI_PCSHELL_SB_CNT]; 38 | DWORD startdocked_PTRS[STARTDOCKED_SB_CNT]; 39 | DWORD startui_PTRS[STARTUI_SB_CNT]; 40 | } symbols_addr; 41 | #pragma pack(pop) 42 | 43 | typedef struct _LoadSymbolsResult 44 | { 45 | BOOL bSuccess : 1; 46 | BOOL bNeedToDownloadTwinuiPcshellSymbols : 1; 47 | BOOL bNeedToDownloadStartDockedSymbols : 1; 48 | BOOL bNeedToDownloadStartUISymbols : 1; 49 | } LoadSymbolsResult; 50 | 51 | inline BOOL NeedToDownloadSymbols(const LoadSymbolsResult* pLoadResult) 52 | { 53 | return pLoadResult->bNeedToDownloadTwinuiPcshellSymbols || pLoadResult->bNeedToDownloadStartDockedSymbols || pLoadResult->bNeedToDownloadStartUISymbols; 54 | } 55 | 56 | typedef struct _DownloadSymbolsParams 57 | { 58 | HMODULE hModule; 59 | BOOL bVerbose; 60 | LoadSymbolsResult loadResult; 61 | } DownloadSymbolsParams; 62 | DWORD DownloadSymbols(DownloadSymbolsParams* params); 63 | 64 | LoadSymbolsResult LoadSymbols(symbols_addr* symbols_PTRS); 65 | 66 | inline BOOL IsBuild(RTL_OSVERSIONINFOW rovi, DWORD32 ubr, DWORD BuildNumber, DWORD BuildMinor) 67 | { 68 | return (rovi.dwMajorVersion == 10 && 69 | rovi.dwMinorVersion == 0 && 70 | rovi.dwBuildNumber == BuildNumber && 71 | ubr == BuildMinor); 72 | } 73 | #endif -------------------------------------------------------------------------------- /ExplorerPatcher/updates.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_UPDATES_H_ 2 | #define _H_UPDATES_H_ 3 | #include 4 | #include 5 | #include 6 | #pragma comment(lib, "Wininet.lib") 7 | #include 8 | #include "utility.h" 9 | #include "helper.h" 10 | 11 | extern HMODULE hModule; 12 | 13 | #define UPDATES_VERBOSE_OUTPUT 14 | 15 | #define UPDATE_POLICY_AUTO 0 16 | #define UPDATE_POLICY_NOTIFY 1 17 | #define UPDATE_POLICY_MANUAL 2 18 | #define UPDATE_POLICY_DEFAULT UPDATE_POLICY_NOTIFY 19 | 20 | #define UPDATES_OP_DEFAULT 0 21 | #define UPDATES_OP_CHECK 1 22 | #define UPDATES_OP_INSTALL 2 23 | 24 | #define UPDATES_USER_AGENT "ExplorerPatcher" 25 | #define UPDATES_FORM_HEADERS "Content-Type: text/plain;\r\n" 26 | #define UPDATES_HASH_SIZE 32 27 | #define UPDATES_BUFSIZ 10240 28 | #define UPDATES_DEFAULT_TIMEOUT 600 29 | 30 | #define UPDATES_RELEASE_INFO_URL "https://github.com/Yukari316/ExplorerPatcher_zh-CN" 31 | #define UPDATES_RELEASE_INFO_URL_STABLE "https://github.com/Yukari316/ExplorerPatcher_zh-CN/releases/latest" 32 | #define UPDATES_RELEASE_INFO_URL_STAGING "https://github.com/Yukari316/ExplorerPatcher_zh-CN/releases?per_page=1" 33 | 34 | typedef struct IsUpdateAvailableParameters 35 | { 36 | HINTERNET hInternet; 37 | HANDLE hEvent; 38 | }; 39 | 40 | BOOL IsUpdatePolicy(LPCWSTR wszDataStore, DWORD dwUpdatePolicy); 41 | BOOL ShowUpdateSuccessNotification( 42 | HMODULE hModule, 43 | __x_ABI_CWindows_CUI_CNotifications_CIToastNotifier* notifier, 44 | __x_ABI_CWindows_CUI_CNotifications_CIToastNotificationFactory* notifFactory, 45 | __x_ABI_CWindows_CUI_CNotifications_CIToastNotification** toast 46 | ); 47 | BOOL InstallUpdatesIfAvailable( 48 | HMODULE hModule, 49 | __x_ABI_CWindows_CUI_CNotifications_CIToastNotifier* notifier, 50 | __x_ABI_CWindows_CUI_CNotifications_CIToastNotificationFactory* notifFactory, 51 | __x_ABI_CWindows_CUI_CNotifications_CIToastNotification** toast, 52 | DWORD dwOperation, DWORD bAllocConsole, DWORD dwUpdatePolicy 53 | ); 54 | #endif -------------------------------------------------------------------------------- /FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['https://www.paypal.com/donate?business=valentingabrielradu%40gmail.com&no_recurring=0&item_name=ExplorerPatcher'] 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ExplorerPatcher 2 | 该项目旨在增强 Windows 上的工作环境. 3 | 4 | 本fork项目为我所翻译的中文版本,官方版本现在已经支持了简体中文,该版本只有部分文本和官方的翻译不同 5 | 6 | 给原作者赞助PayPal: [here](https://www.paypal.com/donate?business=valentingabrielradu%40gmail.com&no_recurring=0&item_name=ExplorerPatcher¤cy_code=EUR) ,邮箱 valentingabrielradu@gmail.com 7 | 8 | 源repo英文[wiki](https://github.com/valinet/ExplorerPatcher/wiki) 9 | 10 | ExplorerPatcher Discord [here](https://discord.gg/gsPcfqHTD2) 11 | 12 | ![Build status](https://github.com/Yukari316/ExplorerPatcher_zh-CN/actions/workflows/build.yml/badge.svg) 13 | 14 | 此为对gui进行翻译并适配字符后的汉化版本,目前只汉化了在`Windows 11`系统下运行的GUI文本,`Windows 10`环境暂无计划进行汉化,如果有时间会尽量完成所有汉化并保持更新 15 | 16 | ### 本地化的部分 17 | > 如果有遗漏可以通过issue或PR进行补充 18 | - Windows11 GUI文本(ExplorerPatcher/settings.reg) 19 | - ~~Windows10 GUI文本(ExplorerPatcher/settings.reg)~~ 20 | - 更新相关动态文本及系统通知(ExplorerPatcher/update.c) 21 | - GUI自动生成的文本`swprintf_s函数相关`(ExplorerPatcher/GUI.c) 22 | - GUI自动生成的文本`MessageBoxW对话框`(ExplorerPatcher/GUI.c) 23 | - 更新服务器(ExplorerPatcher/update.h) 24 | 25 | ## 如何使用 26 | 27 | > ⚠⚠⚠⚠ 28 | > 29 | > **安装过程中将会终止`Windows资源管理器(explorer.exe)`的运行,显示器上可能不会显示任何画面(包括桌面)** 30 | > 31 | > **安装过程必须联网!(最好挂梯)** 32 | > 33 | > ⚠⚠⚠⚠ 34 | 35 | > 双击安装后如果超过`1分钟`都妹有看到`Windows资源管理器(explorer.exe)`重启,请使用`Win+R`输入`explorer.exe`进行手动重启 36 | 37 | 1. 在releases中下载最新的版本(或预发布版本) [ep_setup.exe](https://github.com/Yukari316/ExplorerPatcher_zh-CN/releases/). 38 | 39 | 2. 运行安装程序。安装程序会自动进行系统组件的修改。 40 | 41 | 3. 安装完成后,程序将重新启动`Windows资源管理器(explorer.exe)`,您将看到熟悉的Windows10任务栏。 42 | 43 | 4. 需要修改设置选项,右键任务栏并选择“属性”选项进行修改。 44 | 45 | ## 如何卸载 46 | 47 | 进入控制面板 -> 程序和功能 -> 双击`ExplorerPatcher` -> 卸载 48 | -------------------------------------------------------------------------------- /debug.h: -------------------------------------------------------------------------------- 1 | #define _CRTDBG_MAP_ALLOC 2 | #include 3 | #include -------------------------------------------------------------------------------- /ep_extra/README.md: -------------------------------------------------------------------------------- 1 | # ExplorerPatcher Custom Libraries Chainloader 2 | 3 | ExplorerPatcher has a simple, built-in mechanism that allows users to load their own DLL into `explorer.exe` right after ExplorerPatcher finishes initializing its hooks. Interested users should place a DLL called `ep_extra.dll` in `C:\Windows`. When ExplorerPatcher finishes its setup, it loads the `ep_extra.dll` library and calls the `ep_extra_EntryPoint` function. Although this is very useful so that users can load their custom code, it is quite limited at the moment, as it loads just one DLL. 4 | 5 | This project is a solution to this issue. A chainloader is implemented here, that looks for other modules matching the `ep_extra_*.dll` pattern in `C:\Windows` as well, and loads them one after the other. 6 | -------------------------------------------------------------------------------- /ep_extra/ep_extra.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (United States) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Version 51 | // 52 | 53 | VS_VERSION_INFO VERSIONINFO 54 | FILEVERSION 1,0,0,1 55 | PRODUCTVERSION 1,0,0,1 56 | FILEFLAGSMASK 0x3fL 57 | #ifdef _DEBUG 58 | FILEFLAGS 0x1L 59 | #else 60 | FILEFLAGS 0x0L 61 | #endif 62 | FILEOS 0x40004L 63 | FILETYPE 0x2L 64 | FILESUBTYPE 0x0L 65 | BEGIN 66 | BLOCK "StringFileInfo" 67 | BEGIN 68 | BLOCK "040904b0" 69 | BEGIN 70 | VALUE "CompanyName", "VALINET Solutions SRL" 71 | VALUE "FileDescription", "ExplorerPatcher Custom Libraries Chainloader" 72 | VALUE "FileVersion", "1.0.0.0" 73 | VALUE "InternalName", "ep_extra.dll" 74 | VALUE "LegalCopyright", "Copyright (C) 2006-2023 VALINET Solutions SRL. All rights reserved." 75 | VALUE "OriginalFilename", "ep_extra.dll" 76 | VALUE "ProductName", "ExplorerPatcher" 77 | VALUE "ProductVersion", "1.0.0.0" 78 | END 79 | END 80 | BLOCK "VarFileInfo" 81 | BEGIN 82 | VALUE "Translation", 0x409, 1200 83 | END 84 | END 85 | 86 | #endif // English (United States) resources 87 | ///////////////////////////////////////////////////////////////////////////// 88 | 89 | 90 | 91 | #ifndef APSTUDIO_INVOKED 92 | ///////////////////////////////////////////////////////////////////////////// 93 | // 94 | // Generated from the TEXTINCLUDE 3 resource. 95 | // 96 | 97 | 98 | ///////////////////////////////////////////////////////////////////////////// 99 | #endif // not APSTUDIO_INVOKED 100 | 101 | -------------------------------------------------------------------------------- /ep_extra/ep_extra.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 | 16.0 23 | Win32Proj 24 | {93fa47cc-7753-4f86-b583-69048f51c5ab} 25 | epextra 26 | 10.0 27 | 28 | 29 | 30 | DynamicLibrary 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | DynamicLibrary 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | DynamicLibrary 44 | true 45 | v142 46 | Unicode 47 | 48 | 49 | DynamicLibrary 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | true 76 | $(SolutionDir)\build\$(Configuration) 77 | 78 | 79 | false 80 | $(SolutionDir)\build\$(Configuration) 81 | 82 | 83 | true 84 | $(SolutionDir)\build\$(Configuration) 85 | 86 | 87 | false 88 | $(SolutionDir)\build\$(Configuration) 89 | 90 | 91 | 92 | Level3 93 | true 94 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 95 | true 96 | MultiThreadedDebug 97 | 98 | 99 | Console 100 | true 101 | 102 | 103 | /EXPORT:ep_extra_EntryPoint %(AdditionalOptions) 104 | 105 | 106 | 107 | 108 | Level3 109 | true 110 | true 111 | true 112 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 113 | true 114 | MultiThreaded 115 | 116 | 117 | Console 118 | true 119 | true 120 | true 121 | 122 | 123 | /EXPORT:ep_extra_EntryPoint %(AdditionalOptions) 124 | 125 | 126 | 127 | 128 | Level3 129 | true 130 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 131 | true 132 | MultiThreadedDebug 133 | 134 | 135 | Console 136 | true 137 | 138 | 139 | /EXPORT:ep_extra_EntryPoint %(AdditionalOptions) 140 | 141 | 142 | 143 | 144 | Level3 145 | true 146 | true 147 | true 148 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 149 | true 150 | MultiThreaded 151 | 152 | 153 | Console 154 | true 155 | true 156 | true 157 | 158 | 159 | %(AdditionalOptions) 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /ep_extra/ep_extra.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 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | 28 | 29 | Header Files 30 | 31 | 32 | 33 | 34 | Resource Files 35 | 36 | 37 | -------------------------------------------------------------------------------- /ep_extra/main.asm: -------------------------------------------------------------------------------- 1 | EXTERN worker : PROC 2 | 3 | .CODE 4 | 5 | ep_extra_EntryPoint PROC EXPORT 6 | PUSH RBP 7 | MOV RBP, RSP 8 | SUB RSP, 30H 9 | CALL worker 10 | CMP RAX, 0 11 | JE finish 12 | JMP RAX 13 | finish: 14 | LEAVE 15 | RET 16 | ep_extra_EntryPoint ENDP 17 | 18 | END -------------------------------------------------------------------------------- /ep_extra/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by ep_extra.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /ep_extra/worker.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #pragma comment(lib, "Shlwapi.lib") 4 | #include 5 | 6 | HMODULE hModule = NULL; 7 | HANDLE sigFinish = NULL; 8 | void* pFinishProc = NULL; 9 | 10 | void done() { 11 | WaitForSingleObject(sigFinish, INFINITE); 12 | FreeLibraryAndExitThread(hModule, 0); 13 | } 14 | 15 | void* worker() { 16 | wchar_t pattern[MAX_PATH]; 17 | GetWindowsDirectoryW(pattern, MAX_PATH); 18 | wcscat_s(pattern, MAX_PATH, L"\\ep_extra_*.dll"); 19 | 20 | WIN32_FIND_DATA data; 21 | HANDLE hFind = FindFirstFileW(pattern, &data); 22 | if (hFind != INVALID_HANDLE_VALUE) { 23 | do { 24 | wprintf(L">> Found ep_extra library: \"%s\"\n", data.cFileName); 25 | GetWindowsDirectoryW(pattern, MAX_PATH); 26 | wcscat_s(pattern, MAX_PATH, L"\\"); 27 | wcscat_s(pattern, MAX_PATH, data.cFileName); 28 | HMODULE hLib = LoadLibraryW(pattern); 29 | if (hLib) { 30 | FARPROC proc = (FARPROC)(GetProcAddress(hLib, "setup")); 31 | if (proc) { 32 | if (proc()) FreeLibrary(hLib); 33 | } 34 | else FreeLibrary(hLib); 35 | } 36 | } while (FindNextFileW(hFind, &data)); 37 | FindClose(hFind); 38 | } 39 | 40 | sigFinish = CreateEventW(NULL, FALSE, FALSE, NULL); 41 | if (sigFinish) { 42 | BYTE payload[] = { 43 | 0x48, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // mov rcx, sigFinish 44 | 0x48, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // mov rax, SetEvent 45 | 0xFF, 0xD0, // call SetEvent 46 | 0xC9, // leave 47 | 0xC3 // ret 48 | }; 49 | *(INT64*)(payload + 2) = sigFinish; 50 | *(INT64*)(payload + 12) = SetEvent; 51 | 52 | pFinishProc = VirtualAlloc(NULL, sizeof(payload), MEM_COMMIT, PAGE_EXECUTE_READWRITE); 53 | if (pFinishProc) { 54 | memcpy(pFinishProc, payload, sizeof(payload)); 55 | SHCreateThread(done, 0, CTF_NOADDREFLIB, NULL); 56 | return pFinishProc; 57 | } 58 | } 59 | return NULL; 60 | } 61 | 62 | BOOL WINAPI DllMain( 63 | _In_ HINSTANCE hinstDLL, 64 | _In_ DWORD fdwReason, 65 | _In_ LPVOID lpvReserved 66 | ) 67 | { 68 | switch (fdwReason) 69 | { 70 | case DLL_PROCESS_ATTACH: 71 | DisableThreadLibraryCalls(hinstDLL); 72 | hModule = hinstDLL; 73 | break; 74 | case DLL_THREAD_ATTACH: 75 | break; 76 | case DLL_THREAD_DETACH: 77 | break; 78 | case DLL_PROCESS_DETACH: 79 | break; 80 | } 81 | return TRUE; 82 | } 83 | -------------------------------------------------------------------------------- /ep_extra_valinet.win7alttab/README.md: -------------------------------------------------------------------------------- 1 | # ExplorerPatcher Windows 7 Alt-Tab Module 2 | 3 | This module patches the Windows 7 genuine Alt-Tab implementation to work on newer Windows versions. 4 | 5 | To install, make sure you have the following files in `C:\Windows`: 6 | 7 | * `ep_extra_valinet.win7alttab.dll` - this DLL 8 | * `ep_extra.dll` - a chainloader capable of being invoked by ExplorerPatcher (implements `ep_extra_EntryPoint` and which loads other `ep_extra_*.dll` modules 9 | * `AltTab.dll` - a copy of the `AltTab.dll` in `C:\Windows\System32` from a Windows 7 installation 10 | -------------------------------------------------------------------------------- /ep_extra_valinet.win7alttab/Resource.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (United States) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Version 51 | // 52 | 53 | VS_VERSION_INFO VERSIONINFO 54 | FILEVERSION 1,0,0,1 55 | PRODUCTVERSION 1,0,0,1 56 | FILEFLAGSMASK 0x3fL 57 | #ifdef _DEBUG 58 | FILEFLAGS 0x1L 59 | #else 60 | FILEFLAGS 0x0L 61 | #endif 62 | FILEOS 0x40004L 63 | FILETYPE 0x1L 64 | FILESUBTYPE 0x0L 65 | BEGIN 66 | BLOCK "StringFileInfo" 67 | BEGIN 68 | BLOCK "040904b0" 69 | BEGIN 70 | VALUE "CompanyName", "VALINET Solutions SRL" 71 | VALUE "FileDescription", "ExplorerPatcher Windows 7 Alt-Tab Module" 72 | VALUE "FileVersion", "1.0.0.0" 73 | VALUE "InternalName", "ep_extra_valinet.win7alttab" 74 | VALUE "LegalCopyright", "Copyright (C) 2006-2023 VALINET Solutions SRL. All rights reserved." 75 | VALUE "OriginalFilename", "ep_extra_valinet.win7alttab" 76 | VALUE "ProductName", "ExplorerPatcher" 77 | VALUE "ProductVersion", "1.0.0.0" 78 | END 79 | END 80 | BLOCK "VarFileInfo" 81 | BEGIN 82 | VALUE "Translation", 0x409, 1200 83 | END 84 | END 85 | 86 | #endif // English (United States) resources 87 | ///////////////////////////////////////////////////////////////////////////// 88 | 89 | 90 | 91 | #ifndef APSTUDIO_INVOKED 92 | ///////////////////////////////////////////////////////////////////////////// 93 | // 94 | // Generated from the TEXTINCLUDE 3 resource. 95 | // 96 | 97 | 98 | ///////////////////////////////////////////////////////////////////////////// 99 | #endif // not APSTUDIO_INVOKED 100 | 101 | -------------------------------------------------------------------------------- /ep_extra_valinet.win7alttab/ep_extra_valinet.win7alttab.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 | 16.0 23 | Win32Proj 24 | {a66c5f27-dbf8-45a4-bdf3-ba54d8d82d0f} 25 | epextravalinetwin7alttab 26 | 10.0 27 | 28 | 29 | 30 | DynamicLibrary 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | DynamicLibrary 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | DynamicLibrary 44 | true 45 | v142 46 | Unicode 47 | 48 | 49 | DynamicLibrary 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | $(SolutionDir)\build\$(Configuration) 75 | 76 | 77 | $(SolutionDir)\build\$(Configuration) 78 | 79 | 80 | $(SolutionDir)\build\$(Configuration) 81 | 82 | 83 | $(SolutionDir)\build\$(Configuration) 84 | 85 | 86 | 87 | Level3 88 | true 89 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 90 | true 91 | MultiThreadedDebug 92 | 93 | 94 | Console 95 | true 96 | 97 | 98 | 99 | 100 | Level3 101 | true 102 | true 103 | true 104 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 105 | true 106 | MultiThreaded 107 | 108 | 109 | Console 110 | true 111 | true 112 | true 113 | 114 | 115 | 116 | 117 | Level3 118 | true 119 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 120 | true 121 | MultiThreadedDebug 122 | 123 | 124 | Console 125 | true 126 | 127 | 128 | 129 | 130 | Level3 131 | true 132 | true 133 | true 134 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 135 | true 136 | MultiThreaded 137 | 138 | 139 | Console 140 | true 141 | true 142 | true 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /ep_extra_valinet.win7alttab/ep_extra_valinet.win7alttab.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 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | 32 | 33 | Header Files 34 | 35 | 36 | Header Files 37 | 38 | 39 | 40 | 41 | Resource Files 42 | 43 | 44 | -------------------------------------------------------------------------------- /ep_extra_valinet.win7alttab/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "../libs/libvalinet/valinet/hooking/iatpatch.h" 4 | #include "../libs/sws/SimpleWindowSwitcher/sws_WindowHelpers.h" 5 | #pragma comment(lib, "Uxtheme.lib") 6 | 7 | HMODULE hModule = NULL; 8 | HMODULE hAltTab = NULL; 9 | IOleCommandTarget* pAltTabSSO = NULL; 10 | 11 | DEFINE_GUID(CLSID_AltTabSSO, 12 | 0xA1607060, 0x5D4C, 0x467A, 0xB7, 0x11, 0x2B, 0x59, 0xA6, 0xF2, 0x59, 0x57); 13 | 14 | HRESULT AltTab_DwmpActivateLivePreview(int s, HWND hWnd, int c, int d) { 15 | return S_OK; 16 | } 17 | 18 | int AltTab_LoadStringW(HINSTANCE hInstance, UINT uID, LPWSTR lpBuffer, int cchBufferMax) { 19 | if (uID == 0x3E8) { 20 | swprintf_s(lpBuffer, cchBufferMax, L"AltTab"); return 6; 21 | } 22 | else if (uID == 0x3EA) { 23 | if (cchBufferMax < MAX_PATH) return 0; 24 | sws_WindowHelpers_GetDesktopText(lpBuffer); 25 | int len = wcslen(lpBuffer); 26 | for (int i = 0; i < len; ++i) if (lpBuffer[i] == L'&') lpBuffer[i] = L'\u200E'; 27 | return len; 28 | } 29 | return LoadStringW(hInstance, uID, lpBuffer, cchBufferMax); 30 | } 31 | 32 | HTHEME AltTab_OpenThemeData(HWND hwnd, LPCWSTR pszClassList) { 33 | if (!wcscmp(pszClassList, L"AltTab")) return OpenThemeData(hwnd, L"WINDOW"); 34 | return OpenThemeData(hwnd, pszClassList); 35 | } 36 | 37 | HRESULT AltTab_DrawThemeTextEx(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int cchText, DWORD dwTextFlags, LPRECT pRect, const DTTOPTS* pOptions) { 38 | HRESULT hr = S_OK; 39 | HTHEME hTheme2 = OpenThemeData(NULL, L"TEXTSTYLE"); 40 | if (hTheme2) hr = DrawThemeTextEx(hTheme2, hdc, iPartId + 1, iStateId, pszText, cchText, dwTextFlags, pRect, pOptions); 41 | if (hTheme2) CloseThemeData(hTheme2); 42 | return hr; 43 | } 44 | 45 | BOOL AltTab_IsWindowEnabled(HWND hWnd) { 46 | if (!IsWindowEnabled(hWnd)) return FALSE; 47 | BOOL isCloaked; 48 | DwmGetWindowAttribute(hWnd, DWMWA_CLOAKED, &isCloaked, sizeof(BOOL)); 49 | if (isCloaked) return FALSE; 50 | if (sws_IsShellFrameWindow(hWnd) && !_sws_GhostWindowFromHungWindow(hWnd)) return TRUE; 51 | if (_sws_IsShellManagedWindow(hWnd) && !sws_WindowHelpers_ShouldTreatShellManagedWindowAsNotShellManaged(hWnd)) return FALSE; 52 | if (sws_WindowHelpers_IsWindowShellManagedByExplorerPatcher(hWnd)) return FALSE; 53 | return TRUE; 54 | } 55 | 56 | HRESULT AltTab_DwmExtendFrameIntoClientArea(HWND hWnd, const MARGINS* pMarInset) { 57 | HRESULT hr = DwmExtendFrameIntoClientArea(hWnd, pMarInset); 58 | sws_WindowHelpers_SetMicaMaterialForThisWindow(hWnd, TRUE); 59 | return hr; 60 | } 61 | 62 | BOOL AltTab_PostMessageW(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { 63 | if (hWnd == FindWindowW(L"Shell_TrayWnd", NULL) && uMsg == 0x5B7 && wParam == 0 && lParam == 0) { 64 | return PostMessageW(hWnd, WM_COMMAND, 407, 0); 65 | } 66 | return PostMessageW(hWnd, uMsg, wParam, lParam); 67 | } 68 | 69 | __declspec(dllexport) void clean() { 70 | if (pAltTabSSO) pAltTabSSO->lpVtbl->Release(pAltTabSSO); 71 | if (hAltTab) sws_WindowHelpers_Clear(); 72 | } 73 | 74 | __declspec(dllexport) int setup() { 75 | hAltTab = LoadLibraryW(L"AltTab.dll"); 76 | if (hAltTab) { 77 | sws_WindowHelpers_Initialize(); 78 | VnPatchIAT(hAltTab, "dwmapi.dll", "DwmExtendFrameIntoClientArea", AltTab_DwmExtendFrameIntoClientArea); 79 | VnPatchIAT(hAltTab, "dwmapi.dll", (LPCSTR)113, AltTab_DwmpActivateLivePreview); 80 | VnPatchIAT(hAltTab, "user32.dll", "PostMessageW", AltTab_PostMessageW); 81 | VnPatchIAT(hAltTab, "user32.dll", "LoadStringW", AltTab_LoadStringW); 82 | VnPatchIAT(hAltTab, "user32.dll", "IsWindowEnabled", AltTab_IsWindowEnabled); 83 | VnPatchDelayIAT(hAltTab, "uxtheme.dll", "OpenThemeData", AltTab_OpenThemeData); 84 | VnPatchDelayIAT(hAltTab, "uxtheme.dll", "DrawThemeTextEx", AltTab_DrawThemeTextEx); 85 | HRESULT(*pDllGetClassObject)(REFCLSID, REFIID, LPVOID) = GetProcAddress(hAltTab, "DllGetClassObject"); 86 | IClassFactory* pFactory = NULL; 87 | if (pDllGetClassObject && SUCCEEDED(pDllGetClassObject(&CLSID_AltTabSSO, &IID_IClassFactory, &pFactory)) && pFactory) { 88 | if (SUCCEEDED(pFactory->lpVtbl->CreateInstance(pFactory, NULL, &IID_IOleCommandTarget, &pAltTabSSO)) && pAltTabSSO) { 89 | if (SUCCEEDED(pAltTabSSO->lpVtbl->Exec(pAltTabSSO, &CGID_ShellServiceObject, 2, 0, NULL, NULL))) { 90 | printf(">>> Using Windows 7 AltTab\n"); 91 | } 92 | } 93 | pFactory->lpVtbl->Release(pFactory); 94 | } 95 | FreeLibrary(hAltTab); 96 | return 0; 97 | } 98 | return 1; 99 | } 100 | 101 | BOOL WINAPI DllMain( 102 | _In_ HINSTANCE hinstDLL, 103 | _In_ DWORD fdwReason, 104 | _In_ LPVOID lpvReserved 105 | ) { 106 | switch (fdwReason) 107 | { 108 | case DLL_PROCESS_ATTACH: 109 | DisableThreadLibraryCalls(hinstDLL); 110 | hModule = hinstDLL; 111 | break; 112 | case DLL_THREAD_ATTACH: 113 | break; 114 | case DLL_THREAD_DETACH: 115 | break; 116 | case DLL_PROCESS_DETACH: 117 | break; 118 | } 119 | return TRUE; 120 | } -------------------------------------------------------------------------------- /ep_extra_valinet.win7alttab/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Resource.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /ep_generate_release_description/ep_generate_release_description.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "../ExplorerPatcher/queryversion.h" 4 | #define FILE_NAME "CHANGELOG.md" 5 | #define MAX_LINE_LENGTH 200000 6 | 7 | int main(int argc, char** argv) 8 | { 9 | SetConsoleOutputCP(CP_UTF8); 10 | 11 | char szStartPattern[MAX_PATH]; 12 | char szEndPattern[MAX_PATH]; 13 | 14 | DWORD dwLeftMost = 0; 15 | DWORD dwSecondLeft = 0; 16 | DWORD dwSecondRight = 0; 17 | DWORD dwRightMost = 0; 18 | 19 | QueryVersionInfo(GetModuleHandle(NULL), VS_VERSION_INFO, &dwLeftMost, &dwSecondLeft, &dwSecondRight, &dwRightMost); 20 | 21 | sprintf_s(szStartPattern, MAX_PATH, "## %d.%d.%d\n", dwLeftMost, dwSecondLeft, dwSecondRight); 22 | sprintf_s(szEndPattern, MAX_PATH, "## "); 23 | 24 | FILE* f = NULL; 25 | fopen_s(&f, "..\\..\\" FILE_NAME, "r"); 26 | if (!f) 27 | { 28 | fopen_s(&f, "..\\" FILE_NAME, "r"); 29 | if (!f) 30 | { 31 | fopen_s(&f, "" FILE_NAME, "r"); 32 | } 33 | } 34 | if (f) 35 | { 36 | int state = 0; 37 | size_t bufsiz = MAX_LINE_LENGTH, numChRd = 0; 38 | char* line = malloc(MAX_LINE_LENGTH * sizeof(char)); 39 | while ((numChRd = getline(&line, &bufsiz, f)) != -1) 40 | { 41 | if (state == 0 && !strcmp(line, szStartPattern)) 42 | { 43 | state = 1; 44 | numChRd = getline(&line, &bufsiz, f); 45 | continue; 46 | } 47 | else if (state == 1 && !strncmp(line, szEndPattern, strlen(szEndPattern))) 48 | { 49 | state = 2; 50 | break; 51 | } 52 | if (state == 1) 53 | { 54 | printf("%s", line); 55 | } 56 | } 57 | free(line); 58 | printf( 59 | "Please consult the [README](https://github.com/valinet/ExplorerPatcher/blob/master/README.md) for more details.\n" 60 | "A detailed change log is available [here](https://github.com/valinet/ExplorerPatcher/blob/master/CHANGELOG.md).\n" 61 | "An archive containing all the files generated during the build process (including `dxgi.dll` and symbol files) is available [here](%s).\n\n" 62 | "*This release has been published automatically from %s %s in branch [%s](https://github.com/valinet/ExplorerPatcher/tree/%s/).*", 63 | argc == 4 ? argv[3] : "https://github.com/valinet/ExplorerPatcher/actions", 64 | argc == 4 ? "commits up to and including" : "the latest commits", 65 | argc == 4 ? argv[1] : "", 66 | argc == 4 ? argv[2] : "master", 67 | argc == 4 ? argv[2] : "master" 68 | ); 69 | fclose(f); 70 | } 71 | 72 | return 0; 73 | } 74 | -------------------------------------------------------------------------------- /ep_generate_release_description/ep_generate_release_description.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 | 16.0 23 | Win32Proj 24 | {c362cfbe-7c6b-4457-8d01-839818d42ecb} 25 | epgeneratereleasedescription 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v142 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | $(SolutionDir)\build\$(Configuration) 76 | 77 | 78 | false 79 | $(SolutionDir)\build\$(Configuration) 80 | 81 | 82 | true 83 | $(SolutionDir)\build\$(Configuration) 84 | 85 | 86 | false 87 | $(SolutionDir)\build\$(Configuration) 88 | 89 | 90 | 91 | Level3 92 | true 93 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 94 | true 95 | MultiThreadedDebug 96 | 97 | 98 | Console 99 | true 100 | 101 | 102 | 103 | 104 | Level3 105 | true 106 | true 107 | true 108 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 109 | true 110 | MultiThreaded 111 | 112 | 113 | Console 114 | true 115 | true 116 | true 117 | 118 | 119 | 120 | 121 | Level3 122 | true 123 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 124 | true 125 | MultiThreadedDebug 126 | 127 | 128 | Console 129 | true 130 | 131 | 132 | 133 | 134 | Level3 135 | true 136 | true 137 | true 138 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 139 | true 140 | MultiThreaded 141 | 142 | 143 | Console 144 | true 145 | true 146 | true 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /ep_generate_release_description/ep_generate_release_description.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 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | Header Files 28 | 29 | 30 | Header Files 31 | 32 | 33 | 34 | 35 | Resource Files 36 | 37 | 38 | -------------------------------------------------------------------------------- /ep_generate_release_name/ep_generate_release_name.c: -------------------------------------------------------------------------------- 1 | #include "../ExplorerPatcher/queryversion.h" 2 | 3 | int main(int argc, char** argv) 4 | { 5 | SetConsoleOutputCP(CP_UTF8); 6 | 7 | DWORD dwLeftMost = 0; 8 | DWORD dwSecondLeft = 0; 9 | DWORD dwSecondRight = 0; 10 | DWORD dwRightMost = 0; 11 | 12 | QueryVersionInfo(GetModuleHandle(NULL), VS_VERSION_INFO, &dwLeftMost, &dwSecondLeft, &dwSecondRight, &dwRightMost); 13 | 14 | printf("%d.%d.%d.%d", dwLeftMost, dwSecondLeft, dwSecondRight, dwRightMost); 15 | 16 | return 0; 17 | } -------------------------------------------------------------------------------- /ep_generate_release_name/ep_generate_release_name.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 | 16.0 23 | Win32Proj 24 | {78d0c3cf-25c0-41d4-9359-0e9ab72b9874} 25 | epqueryversion 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v142 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | $(SolutionDir)\build\$(Configuration) 76 | 77 | 78 | false 79 | $(SolutionDir)\build\$(Configuration) 80 | 81 | 82 | true 83 | $(SolutionDir)\build\$(Configuration) 84 | 85 | 86 | false 87 | $(SolutionDir)\build\$(Configuration) 88 | 89 | 90 | 91 | Level3 92 | true 93 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 94 | true 95 | MultiThreadedDebug 96 | 97 | 98 | Console 99 | true 100 | 101 | 102 | 103 | 104 | Level3 105 | true 106 | true 107 | true 108 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 109 | true 110 | MultiThreaded 111 | 112 | 113 | Console 114 | true 115 | true 116 | true 117 | 118 | 119 | 120 | 121 | Level3 122 | true 123 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 124 | true 125 | MultiThreadedDebug 126 | 127 | 128 | Console 129 | true 130 | 131 | 132 | 133 | 134 | Level3 135 | true 136 | true 137 | true 138 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 139 | true 140 | MultiThreaded 141 | 142 | 143 | Console 144 | true 145 | true 146 | true 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /ep_generate_release_name/ep_generate_release_name.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 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | Header Files 25 | 26 | 27 | 28 | 29 | Resource Files 30 | 31 | 32 | -------------------------------------------------------------------------------- /ep_generate_release_name/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by ep_setup.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /ep_setup/ep_setup.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (United States) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Version 51 | // 52 | #include "..\version.h" 53 | 54 | VS_VERSION_INFO VERSIONINFO 55 | FILEVERSION VER_FILE 56 | PRODUCTVERSION VER_PRODUCT 57 | FILEFLAGSMASK 0x3fL 58 | #ifdef _DEBUG 59 | FILEFLAGS 0x1L 60 | #else 61 | FILEFLAGS 0x0L 62 | #endif 63 | FILEOS 0x40004L 64 | FILETYPE 0x1L 65 | FILESUBTYPE 0x0L 66 | BEGIN 67 | BLOCK "StringFileInfo" 68 | BEGIN 69 | BLOCK "040904b0" 70 | BEGIN 71 | VALUE "CompanyName", "VALINET Solutions SRL" 72 | VALUE "FileDescription", "ExplorerPatcher Setup Program" 73 | VER_FILE_STRING 74 | VALUE "InternalName", "ep_setup.exe" 75 | VALUE "LegalCopyright", "Copyright (C) 2006-2023 VALINET Solutions SRL. All rights reserved." 76 | VALUE "OriginalFilename", "ep_setup.exe" 77 | VALUE "ProductName", "ExplorerPatcher" 78 | VER_PRODUCT_STRING 79 | END 80 | END 81 | BLOCK "VarFileInfo" 82 | BEGIN 83 | VALUE "Translation", 0x409, 1200 84 | END 85 | END 86 | 87 | 88 | ///////////////////////////////////////////////////////////////////////////// 89 | // 90 | // RCDATA 91 | // 92 | 93 | IDR_EP_AMD64 RCDATA "..\\build\\Release\\ExplorerPatcher.amd64.dll" 94 | 95 | IDR_EP_IA32 RCDATA "..\\build\\Release\\ExplorerPatcher.IA-32.dll" 96 | 97 | IDR_EP_DWM RCDATA "..\\build\\Release\\ep_dwm.exe" 98 | 99 | IDR_EP_WEATHER RCDATA "..\\build\\Release\\ep_weather_host.dll" 100 | 101 | IDR_EP_WEATHER_STUB RCDATA "..\\build\\Release\\ep_weather_host_stub.dll" 102 | 103 | IDR_MS_WEBVIEW2_LOADER RCDATA "..\\build\\Release\\WebView2Loader.dll" 104 | 105 | IDR_EP_STARTMENU RCDATA "..\\build\\Release\\ep_startmenu.dll" 106 | 107 | #endif // English (United States) resources 108 | ///////////////////////////////////////////////////////////////////////////// 109 | 110 | 111 | 112 | #ifndef APSTUDIO_INVOKED 113 | ///////////////////////////////////////////////////////////////////////////// 114 | // 115 | // Generated from the TEXTINCLUDE 3 resource. 116 | // 117 | 118 | 119 | ///////////////////////////////////////////////////////////////////////////// 120 | #endif // not APSTUDIO_INVOKED 121 | 122 | -------------------------------------------------------------------------------- /ep_setup/ep_setup.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 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | Header Files 28 | 29 | 30 | Header Files 31 | 32 | 33 | 34 | 35 | Resource Files 36 | 37 | 38 | Resource Files 39 | 40 | 41 | 42 | 43 | 44 | 45 | Resource Files 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /ep_setup/ep_setup_debug.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (United States) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Version 51 | // 52 | #include "..\version.h" 53 | 54 | VS_VERSION_INFO VERSIONINFO 55 | FILEVERSION VER_FILE 56 | PRODUCTVERSION VER_PRODUCT 57 | FILEFLAGSMASK 0x3fL 58 | #ifdef _DEBUG 59 | FILEFLAGS 0x1L 60 | #else 61 | FILEFLAGS 0x0L 62 | #endif 63 | FILEOS 0x40004L 64 | FILETYPE 0x1L 65 | FILESUBTYPE 0x0L 66 | BEGIN 67 | BLOCK "StringFileInfo" 68 | BEGIN 69 | BLOCK "040904b0" 70 | BEGIN 71 | VALUE "CompanyName", "VALINET Solutions SRL" 72 | VALUE "FileDescription", "ExplorerPatcher Setup Program (Debug Build)" 73 | VER_FILE_STRING 74 | VALUE "InternalName", "ep_setup.exe" 75 | VALUE "LegalCopyright", "Copyright (C) 2006-2023 VALINET Solutions SRL. All rights reserved." 76 | VALUE "OriginalFilename", "ep_setup.exe" 77 | VALUE "ProductName", "ExplorerPatcher" 78 | VER_PRODUCT_STRING 79 | END 80 | END 81 | BLOCK "VarFileInfo" 82 | BEGIN 83 | VALUE "Translation", 0x409, 1200 84 | END 85 | END 86 | 87 | 88 | ///////////////////////////////////////////////////////////////////////////// 89 | // 90 | // RCDATA 91 | // 92 | 93 | IDR_EP_AMD64 RCDATA "..\\build\\Debug\\ExplorerPatcher.amd64.dll" 94 | 95 | IDR_EP_IA32 RCDATA "..\\build\\Debug\\ExplorerPatcher.IA-32.dll" 96 | 97 | IDR_EP_DWM RCDATA "..\\build\\Debug\\ep_dwm.exe" 98 | 99 | IDR_EP_WEATHER RCDATA "..\\build\\Debug\\ep_weather_host.dll" 100 | 101 | IDR_EP_WEATHER_STUB RCDATA "..\\build\\Debug\\ep_weather_host_stub.dll" 102 | 103 | IDR_MS_WEBVIEW2_LOADER RCDATA "..\\build\\Debug\\WebView2Loader.dll" 104 | 105 | IDR_EP_STARTMENU RCDATA "..\\build\\Debug\\ep_startmenu.dll" 106 | 107 | #endif // English (United States) resources 108 | ///////////////////////////////////////////////////////////////////////////// 109 | 110 | 111 | 112 | #ifndef APSTUDIO_INVOKED 113 | ///////////////////////////////////////////////////////////////////////////// 114 | // 115 | // Generated from the TEXTINCLUDE 3 resource. 116 | // 117 | 118 | 119 | ///////////////////////////////////////////////////////////////////////////// 120 | #endif // not APSTUDIO_INVOKED 121 | 122 | -------------------------------------------------------------------------------- /ep_setup/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by ep_setup.rc 4 | // 5 | #define IDR_EP_AMD64 103 6 | #define IDR_EP_IA32 104 7 | #define IDR_EP_DWM 105 8 | #define IDR_EP_WEATHER 106 9 | #define IDR_EP_WEATHER_STUB 107 10 | #define IDR_MS_WEBVIEW2_LOADER 201 11 | #define IDR_EP_STARTMENU 108 12 | 13 | 14 | // Next default values for new objects 15 | // 16 | #ifdef APSTUDIO_INVOKED 17 | #ifndef APSTUDIO_READONLY_SYMBOLS 18 | #define _APS_NEXT_RESOURCE_VALUE 105 19 | #define _APS_NEXT_COMMAND_VALUE 40001 20 | #define _APS_NEXT_CONTROL_VALUE 1001 21 | #define _APS_NEXT_SYMED_VALUE 101 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /ep_setup_patch/ep_setup_patch.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #pragma comment(lib, "Shlwapi.lib") 4 | #include "../ExplorerPatcher/utility.h" 5 | 6 | int WINAPI wWinMain( 7 | _In_ HINSTANCE hInstance, 8 | _In_opt_ HINSTANCE hPrevInstance, 9 | _In_ LPWSTR lpCmdLine, 10 | _In_ int nShowCmd 11 | ) 12 | { 13 | WCHAR wszPath[MAX_PATH]; 14 | GetModuleFileNameW(GetModuleHandle(NULL), wszPath, MAX_PATH); 15 | PathRemoveFileSpecW(wszPath); 16 | wcscat_s(wszPath, MAX_PATH, L"\\" _T(PRODUCT_NAME) L".amd64.dll"); 17 | HMODULE hModule = LoadLibraryExW(wszPath, NULL, LOAD_LIBRARY_AS_DATAFILE); 18 | 19 | CHAR hash[100]; 20 | ZeroMemory(hash, 100); 21 | ComputeFileHash2(hModule, wszPath, hash, 100); 22 | FreeLibrary(hModule); 23 | 24 | PathRemoveFileSpecW(wszPath); 25 | wcscat_s(wszPath, MAX_PATH, L"\\" _T(SETUP_UTILITY_NAME)); 26 | 27 | HANDLE hFile = CreateFileW(wszPath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); 28 | if (hFile == INVALID_HANDLE_VALUE) 29 | { 30 | return 1; 31 | } 32 | 33 | HANDLE hFileMapping = CreateFileMappingW(hFile, NULL, PAGE_READWRITE, 0, 0, NULL); 34 | if (hFileMapping == 0) 35 | { 36 | CloseHandle(hFile); 37 | return 2; 38 | } 39 | 40 | char* lpFileBase = MapViewOfFile(hFileMapping, FILE_MAP_ALL_ACCESS, 0, 0, 0); 41 | if (lpFileBase == 0) 42 | { 43 | CloseHandle(hFileMapping); 44 | CloseHandle(hFile); 45 | return 3; 46 | } 47 | 48 | memcpy(lpFileBase + DOSMODE_OFFSET, hash, strlen(hash)); 49 | 50 | UnmapViewOfFile(lpFileBase); 51 | CloseHandle(hFileMapping); 52 | CloseHandle(hFile); 53 | 54 | if (__argc > 1) 55 | { 56 | SHELLEXECUTEINFO ShExecInfo = { 0 }; 57 | ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); 58 | ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; 59 | ShExecInfo.hwnd = NULL; 60 | ShExecInfo.lpVerb = L"runas"; 61 | ShExecInfo.lpFile = wszPath; 62 | ShExecInfo.lpParameters = NULL; 63 | ShExecInfo.lpDirectory = NULL; 64 | ShExecInfo.nShow = SW_SHOW; 65 | ShExecInfo.hInstApp = NULL; 66 | if (ShellExecuteExW(&ShExecInfo) && ShExecInfo.hProcess) 67 | { 68 | WaitForSingleObject(ShExecInfo.hProcess, INFINITE); 69 | DWORD dwExitCode = 0; 70 | GetExitCodeProcess(ShExecInfo.hProcess, &dwExitCode); 71 | CloseHandle(ShExecInfo.hProcess); 72 | return dwExitCode; 73 | } 74 | } 75 | 76 | return 0; 77 | } -------------------------------------------------------------------------------- /ep_setup_patch/ep_setup_patch.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 | 16.0 23 | Win32Proj 24 | {0c13e5f3-106b-4836-a7c2-8e5808a6ed78} 25 | epsetuppatch 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v142 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | $(SolutionDir)\build\$(Configuration) 76 | 77 | 78 | false 79 | $(SolutionDir)\build\$(Configuration) 80 | 81 | 82 | true 83 | $(SolutionDir)\build\$(Configuration) 84 | 85 | 86 | false 87 | $(SolutionDir)\build\$(Configuration) 88 | 89 | 90 | 91 | Level3 92 | true 93 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 94 | true 95 | MultiThreadedDebug 96 | $(SolutionDir)libs\libvalinet;%(AdditionalIncludeDirectories) 97 | 98 | 99 | Windows 100 | true 101 | 102 | 103 | 104 | 105 | Level3 106 | true 107 | true 108 | true 109 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 110 | true 111 | MultiThreaded 112 | $(SolutionDir)libs\libvalinet;%(AdditionalIncludeDirectories) 113 | 114 | 115 | Windows 116 | true 117 | true 118 | true 119 | 120 | 121 | 122 | 123 | Level3 124 | true 125 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 126 | true 127 | MultiThreadedDebug 128 | $(SolutionDir)libs\libvalinet;%(AdditionalIncludeDirectories) 129 | 130 | 131 | Windows 132 | true 133 | 134 | 135 | 136 | 137 | Level3 138 | true 139 | true 140 | true 141 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 142 | true 143 | MultiThreaded 144 | $(SolutionDir)libs\libvalinet;%(AdditionalIncludeDirectories) 145 | 146 | 147 | Windows 148 | true 149 | true 150 | true 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /ep_setup_patch/ep_setup_patch.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 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | Header Files 28 | 29 | 30 | 31 | 32 | Resource Files 33 | 34 | 35 | -------------------------------------------------------------------------------- /ep_startmenu/ep_sm_main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "ep_sm_forwards.h" 4 | #pragma comment(lib, "Dbghelp.lib") 5 | 6 | HMODULE hModule = NULL; 7 | HMODULE hOrig = NULL; 8 | wchar_t* (*pGetCmdArguments)(int*) = NULL; 9 | SRWLOCK lockInstanced = { .Ptr = SRWLOCK_INIT }; 10 | BOOL bInstanced = FALSE; 11 | 12 | BOOL start_GetProductInfo(DWORD dwOSMajorVersion, DWORD dwOSMinorVersion, DWORD dwSpMajorVersion, DWORD dwSpMinorVersion, PDWORD pdwReturnedProductType) 13 | { 14 | *pdwReturnedProductType = 119; 15 | return TRUE; 16 | } 17 | 18 | void Init() 19 | { 20 | DWORD dwStartShowClassicMode = 0, dwSize = sizeof(DWORD); 21 | RegGetValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"Start_ShowClassicMode", RRF_RT_DWORD, NULL, &dwStartShowClassicMode, &dwSize); 22 | if (dwStartShowClassicMode) 23 | { 24 | VnPatchIAT(GetModuleHandleW(NULL), "api-ms-win-core-sysinfo-l1-2-0.dll", "GetProductInfo", start_GetProductInfo); 25 | } 26 | HMODULE hMod; 27 | GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, hModule, &hMod); 28 | bInstanced = TRUE; 29 | } 30 | 31 | #pragma comment(linker, "/export:?GetCmdArguments@Details@Platform@@YAPEAPEA_WPEAH@Z=GetCmdArguments,@130") 32 | wchar_t* GetCmdArguments(int* a1) 33 | { 34 | AcquireSRWLockExclusive(&lockInstanced); 35 | if (!hOrig) 36 | { 37 | hOrig = LoadLibraryW(L"wincorlib_orig.dll"); 38 | if (hOrig) 39 | { 40 | pGetCmdArguments = GetProcAddress(hOrig, "?GetCmdArguments@Details@Platform@@YAPEAPEA_WPEAH@Z"); 41 | } 42 | } 43 | if (pGetCmdArguments) 44 | { 45 | if (!bInstanced) Init(); 46 | ReleaseSRWLockExclusive(&lockInstanced); 47 | return pGetCmdArguments(a1); 48 | } 49 | ReleaseSRWLockExclusive(&lockInstanced); 50 | return NULL; 51 | } 52 | 53 | BOOL WINAPI DllMain( 54 | _In_ HINSTANCE hinstDLL, 55 | _In_ DWORD fdwReason, 56 | _In_ LPVOID lpvReserved 57 | ) 58 | { 59 | switch (fdwReason) 60 | { 61 | case DLL_PROCESS_ATTACH: 62 | DisableThreadLibraryCalls(hinstDLL); 63 | hModule = hinstDLL; 64 | break; 65 | case DLL_THREAD_ATTACH: 66 | break; 67 | case DLL_THREAD_DETACH: 68 | break; 69 | case DLL_PROCESS_DETACH: 70 | break; 71 | } 72 | return TRUE; 73 | } 74 | -------------------------------------------------------------------------------- /ep_startmenu/ep_startmenu.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 | 16.0 23 | Win32Proj 24 | {6bf03eea-200a-4698-9555-057dd52b0c78} 25 | epstartmenu 26 | 10.0 27 | 28 | 29 | 30 | DynamicLibrary 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | DynamicLibrary 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | DynamicLibrary 44 | true 45 | v142 46 | Unicode 47 | 48 | 49 | DynamicLibrary 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | $(SolutionDir)\build\$(Configuration) 76 | $(ProjectName) 77 | 78 | 79 | false 80 | $(SolutionDir)\build\$(Configuration) 81 | $(ProjectName) 82 | 83 | 84 | true 85 | $(SolutionDir)\build\$(Configuration) 86 | $(ProjectName) 87 | 88 | 89 | false 90 | $(SolutionDir)\build\$(Configuration) 91 | $(ProjectName) 92 | 93 | 94 | 95 | Level3 96 | true 97 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 98 | true 99 | MultiThreadedDebug 100 | $(SolutionDir)libs\libvalinet;%(AdditionalIncludeDirectories) 101 | 102 | 103 | Console 104 | true 105 | 106 | 107 | 108 | 109 | Level3 110 | true 111 | true 112 | true 113 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 114 | true 115 | MultiThreaded 116 | $(SolutionDir)libs\libvalinet;%(AdditionalIncludeDirectories) 117 | 118 | 119 | Console 120 | true 121 | true 122 | true 123 | 124 | 125 | 126 | 127 | Level3 128 | true 129 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 130 | true 131 | MultiThreadedDebug 132 | $(SolutionDir)libs\libvalinet;%(AdditionalIncludeDirectories) 133 | 134 | 135 | Console 136 | true 137 | 138 | 139 | 140 | 141 | Level3 142 | true 143 | true 144 | true 145 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 146 | true 147 | MultiThreaded 148 | $(SolutionDir)libs\libvalinet;%(AdditionalIncludeDirectories) 149 | 150 | 151 | Console 152 | true 153 | true 154 | true 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /ep_startmenu/ep_startmenu.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 | 18 | 19 | Header Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | 28 | 29 | Resource Files 30 | 31 | 32 | -------------------------------------------------------------------------------- /ep_weather_host/ep_weather.c: -------------------------------------------------------------------------------- 1 | #include "ep_weather.h" 2 | #include "ep_weather_factory.h" 3 | #include "ep_weather_host.h" 4 | 5 | HMODULE epw_hModule; 6 | DWORD epw_OutstandingObjects = 0; 7 | DWORD epw_LockCount = 0; 8 | 9 | void(*RefreshImmersiveColorPolicyState)(); 10 | void(*SetPreferredAppMode)(INT64 bAllowDark); 11 | void(*AllowDarkModeForWindow)(HWND hWnd, INT64 bAllowDark); 12 | BOOL(*ShouldAppsUseDarkMode)(); 13 | BOOL(*ShouldSystemUseDarkMode)(); 14 | 15 | #ifdef _WIN64 16 | #pragma comment(linker, "/export:DllRegisterServer=_DllRegisterServer") 17 | #else 18 | #pragma comment(linker, "/export:DllRegisterServer=__DllRegisterServer@0") 19 | #endif 20 | HRESULT WINAPI _DllRegisterServer() 21 | { 22 | DWORD dwLastError = ERROR_SUCCESS; 23 | HKEY hKey = NULL; 24 | DWORD dwSize = 0; 25 | wchar_t wszFilename[MAX_PATH]; 26 | wchar_t wszInstallPath[MAX_PATH]; 27 | 28 | if (!dwLastError) 29 | { 30 | if (!GetModuleFileNameW(epw_hModule, wszFilename, MAX_PATH)) 31 | { 32 | dwLastError = GetLastError(); 33 | } 34 | } 35 | if (!dwLastError) 36 | { 37 | dwLastError = RegCreateKeyExW( 38 | HKEY_LOCAL_MACHINE, 39 | _T("SOFTWARE\\Classes\\CLSID\\") _T(CLSID_EPWeather_TEXT), 40 | 0, 41 | NULL, 42 | REG_OPTION_NON_VOLATILE, 43 | KEY_WRITE | KEY_WOW64_64KEY, 44 | NULL, 45 | &hKey, 46 | NULL 47 | ); 48 | if (hKey == NULL || hKey == INVALID_HANDLE_VALUE) 49 | { 50 | hKey = NULL; 51 | } 52 | if (hKey) 53 | { 54 | dwLastError = RegSetValueExW( 55 | hKey, 56 | NULL, 57 | 0, 58 | REG_SZ, 59 | _T(CLSID_EPWeather_Name), 60 | 29 * sizeof(wchar_t) 61 | ); 62 | dwLastError = RegSetValueExW( 63 | hKey, 64 | L"AppID", 65 | 0, 66 | REG_SZ, 67 | _T(CLSID_EPWeather_TEXT), 68 | 39 * sizeof(wchar_t) 69 | ); 70 | RegCloseKey(hKey); 71 | } 72 | dwLastError = RegCreateKeyExW( 73 | HKEY_LOCAL_MACHINE, 74 | _T("SOFTWARE\\Classes\\CLSID\\") _T(CLSID_EPWeather_TEXT) _T("\\InProcServer32"), 75 | 0, 76 | NULL, 77 | REG_OPTION_NON_VOLATILE, 78 | KEY_WRITE | KEY_WOW64_64KEY, 79 | NULL, 80 | &hKey, 81 | NULL 82 | ); 83 | if (hKey == NULL || hKey == INVALID_HANDLE_VALUE) 84 | { 85 | hKey = NULL; 86 | } 87 | if (hKey) 88 | { 89 | dwLastError = RegSetValueExW( 90 | hKey, 91 | NULL, 92 | 0, 93 | REG_SZ, 94 | wszFilename, 95 | (wcslen(wszFilename) + 1) * sizeof(wchar_t) 96 | ); 97 | dwLastError = RegSetValueExW( 98 | hKey, 99 | L"ThreadingModel", 100 | 0, 101 | REG_SZ, 102 | L"Apartment", 103 | 10 * sizeof(wchar_t) 104 | ); 105 | RegCloseKey(hKey); 106 | } 107 | dwLastError = RegCreateKeyExW( 108 | HKEY_LOCAL_MACHINE, 109 | _T("SOFTWARE\\Classes\\AppID\\") _T(CLSID_EPWeather_TEXT), 110 | 0, 111 | NULL, 112 | REG_OPTION_NON_VOLATILE, 113 | KEY_WRITE | KEY_WOW64_64KEY, 114 | NULL, 115 | &hKey, 116 | NULL 117 | ); 118 | if (hKey == NULL || hKey == INVALID_HANDLE_VALUE) 119 | { 120 | hKey = NULL; 121 | } 122 | if (hKey) 123 | { 124 | dwLastError = RegSetValueExW( 125 | hKey, 126 | NULL, 127 | 0, 128 | REG_SZ, 129 | _T(CLSID_EPWeather_Name), 130 | 29 * sizeof(wchar_t) 131 | ); 132 | dwLastError = RegSetValueExW( 133 | hKey, 134 | L"DllSurrogate", 135 | 0, 136 | REG_SZ, 137 | L"", 138 | 1 * sizeof(wchar_t) 139 | ); 140 | RegCloseKey(hKey); 141 | } 142 | dwLastError = RegCreateKeyExW( 143 | HKEY_LOCAL_MACHINE, 144 | _T("SOFTWARE\\Classes\\AppID\\") _T(CLSID_EPWeather_TEXT), 145 | 0, 146 | NULL, 147 | REG_OPTION_NON_VOLATILE, 148 | KEY_WRITE | KEY_WOW64_64KEY, 149 | NULL, 150 | &hKey, 151 | NULL 152 | ); 153 | if (hKey == NULL || hKey == INVALID_HANDLE_VALUE) 154 | { 155 | hKey = NULL; 156 | } 157 | if (hKey) 158 | { 159 | dwLastError = RegSetValueExW( 160 | hKey, 161 | NULL, 162 | 0, 163 | REG_SZ, 164 | _T(CLSID_EPWeather_Name), 165 | 29 * sizeof(wchar_t) 166 | ); 167 | dwLastError = RegSetValueExW( 168 | hKey, 169 | L"DllSurrogate", 170 | 0, 171 | REG_SZ, 172 | L"", 173 | 1 * sizeof(wchar_t) 174 | ); 175 | RegCloseKey(hKey); 176 | } 177 | } 178 | 179 | return dwLastError == 0 ? (NOERROR) : (HRESULT_FROM_WIN32(dwLastError)); 180 | } 181 | 182 | #ifdef _WIN64 183 | #pragma comment(linker, "/export:DllUnregisterServer=_DllUnregisterServer") 184 | #else 185 | #pragma comment(linker, "/export:DllUnregisterServer=__DllUnregisterServer@0") 186 | #endif 187 | HRESULT WINAPI _DllUnregisterServer() 188 | { 189 | DWORD dwLastError = ERROR_SUCCESS; 190 | HKEY hKey = NULL; 191 | DWORD dwSize = 0; 192 | wchar_t wszFilename[MAX_PATH]; 193 | 194 | if (!dwLastError) 195 | { 196 | if (!GetModuleFileNameW(epw_hModule, wszFilename, MAX_PATH)) 197 | { 198 | dwLastError = GetLastError(); 199 | } 200 | } 201 | if (!dwLastError) 202 | { 203 | dwLastError = RegOpenKeyW( 204 | HKEY_LOCAL_MACHINE, 205 | _T("SOFTWARE\\Classes\\CLSID\\") _T(CLSID_EPWeather_TEXT), 206 | &hKey 207 | ); 208 | if (hKey == NULL || hKey == INVALID_HANDLE_VALUE) 209 | { 210 | hKey = NULL; 211 | } 212 | if (hKey) 213 | { 214 | dwLastError = RegDeleteTreeW( 215 | hKey, 216 | 0 217 | ); 218 | RegCloseKey(hKey); 219 | if (!dwLastError) 220 | { 221 | RegDeleteTreeW( 222 | HKEY_LOCAL_MACHINE, 223 | _T("SOFTWARE\\Classes\\CLSID\\") _T(CLSID_EPWeather_TEXT) 224 | ); 225 | } 226 | } 227 | dwLastError = RegOpenKeyW( 228 | HKEY_LOCAL_MACHINE, 229 | _T("SOFTWARE\\Classes\\AppID\\") _T(CLSID_EPWeather_TEXT), 230 | &hKey 231 | ); 232 | if (hKey == NULL || hKey == INVALID_HANDLE_VALUE) 233 | { 234 | hKey = NULL; 235 | } 236 | if (hKey) 237 | { 238 | dwLastError = RegDeleteTreeW( 239 | hKey, 240 | 0 241 | ); 242 | RegCloseKey(hKey); 243 | if (!dwLastError) 244 | { 245 | RegDeleteTreeW( 246 | HKEY_LOCAL_MACHINE, 247 | _T("SOFTWARE\\Classes\\AppID\\") _T(CLSID_EPWeather_TEXT) 248 | ); 249 | } 250 | } 251 | } 252 | 253 | return dwLastError == 0 ? (NOERROR) : (HRESULT_FROM_WIN32(dwLastError)); 254 | } 255 | 256 | #ifdef _WIN64 257 | #pragma comment(linker, "/export:DllCanUnloadNow=_DllCanUnloadNow") 258 | #else 259 | #pragma comment(linker, "/export:DllCanUnloadNow=__DllCanUnloadNow@0") 260 | #endif 261 | HRESULT WINAPI _DllCanUnloadNow() 262 | { 263 | return((epw_OutstandingObjects | epw_LockCount) ? S_FALSE : S_OK); 264 | } 265 | 266 | #ifdef _WIN64 267 | #pragma comment(linker, "/export:DllGetClassObject=_DllGetClassObject") 268 | #else 269 | #pragma comment(linker, "/export:DllGetClassObject=__DllGetClassObject@12") 270 | #endif 271 | HRESULT WINAPI _DllGetClassObject( 272 | REFCLSID objGuid, 273 | REFIID factoryGuid, 274 | LPVOID* factoryHandle 275 | ) 276 | { 277 | HRESULT hr; 278 | if (IsEqualCLSID(objGuid, &CLSID_EPWeather)) 279 | { 280 | hr = ClassFactory->lpVtbl->QueryInterface( 281 | ClassFactory, 282 | factoryGuid, 283 | factoryHandle 284 | ); 285 | } 286 | else 287 | { 288 | *factoryHandle = 0; 289 | hr = CLASS_E_CLASSNOTAVAILABLE; 290 | } 291 | 292 | return(hr); 293 | } 294 | 295 | BOOL WINAPI DllMain( 296 | _In_ HINSTANCE hinstDLL, 297 | _In_ DWORD fdwReason, 298 | _In_ LPVOID lpvReserved 299 | ) 300 | { 301 | switch (fdwReason) 302 | { 303 | case DLL_PROCESS_ATTACH: 304 | DisableThreadLibraryCalls(hinstDLL); 305 | epw_hModule = hinstDLL; 306 | break; 307 | case DLL_THREAD_ATTACH: 308 | break; 309 | case DLL_THREAD_DETACH: 310 | break; 311 | case DLL_PROCESS_DETACH: 312 | break; 313 | } 314 | return TRUE; 315 | } 316 | -------------------------------------------------------------------------------- /ep_weather_host/ep_weather.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_AS_H_ 2 | #define _H_AS_H_ 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #pragma comment(lib, "Version.lib") 9 | #pragma comment(lib, "Shlwapi.lib") 10 | 11 | #ifndef NTDDI_WIN10_CO 12 | #define DWMWA_USE_HOSTBACKDROPBRUSH 17 // [set] BOOL, Allows the use of host backdrop brushes for the window. 13 | #define DWMWA_USE_IMMERSIVE_DARK_MODE 20 // [set] BOOL, Allows a window to either use the accent color, or dark, according to the user Color Mode preferences. 14 | #define DWMWA_WINDOW_CORNER_PREFERENCE 33 // [set] WINDOW_CORNER_PREFERENCE, Controls the policy that rounds top-level window corners 15 | #define DWMWA_BORDER_COLOR 34 // [set] COLORREF, The color of the thin border around a top-level window 16 | #define DWMWA_CAPTION_COLOR 35 // [set] COLORREF, The color of the caption 17 | #define DWMWA_TEXT_COLOR 36 // [set] COLORREF, The color of the caption text 18 | #define DWMWA_VISIBLE_FRAME_BORDER_THICKNESS 37 // [get] UINT, width of the visible border around a thick frame window 19 | #define DWMWCP_DEFAULT 0 20 | #define DWMWCP_DONOTROUND 1 21 | #define DWMWCP_ROUND 2 22 | #define DWMWCP_ROUNDSMALL 3 23 | #endif 24 | 25 | #define ALLOC(x) calloc(1, x) 26 | #define FREE(x) free(x) 27 | 28 | extern HMODULE epw_hModule; 29 | extern DWORD epw_OutstandingObjects; 30 | extern DWORD epw_LockCount; 31 | 32 | // {A6EA9C2D-4982-4827-9204-0AC532959F6D} 33 | #define CLSID_EPWeather_Name "ExplorerPatcher Weather Host" 34 | #define CLSID_EPWeather_TEXT "{A6EA9C2D-4982-4827-9204-0AC532959F6D}" 35 | #define EP_Weather_Killswitch "Global\\EP_Weather_Killswitch_" CLSID_EPWeather_TEXT 36 | DEFINE_GUID(CLSID_EPWeather, 37 | 0xa6ea9c2d, 0x4982, 0x4827, 0x92, 0x4, 0xa, 0xc5, 0x32, 0x95, 0x9f, 0x6d); 38 | 39 | #if defined(__cplusplus) && !defined(CINTERFACE) 40 | #else 41 | DEFINE_GUID(IID_IEPWeather, 42 | 0xcdbf3734, 0xf847, 0x4f1b, 0xb9, 0x53, 0xa6, 0x5, 0x43, 0x4d, 0xc1, 0xe7); 43 | #endif 44 | 45 | #define EPW_WEATHER_CLASSNAME "ExplorerPatcher_Weather_" CLSID_EPWeather_TEXT 46 | 47 | #define EP_WEATHER_KEEP_VALUE -1 48 | 49 | #define EP_WEATHER_NUM_PROVIDERS 2 50 | #define EP_WEATHER_PROVIDER_TEST 0 51 | #define EP_WEATHER_PROVIDER_GOOGLE 1 52 | 53 | #define EP_WEATHER_NUM_TUNITS 2 54 | #define EP_WEATHER_TUNIT_CELSIUS 0 55 | #define EP_WEATHER_TUNIT_FAHRENHEIT 1 56 | 57 | #define EP_WEATHER_VIEW_ICONONLY 1 58 | #define EP_WEATHER_VIEW_ICONTEMP 3 59 | #define EP_WEATHER_VIEW_ICONTEXT 0 60 | #define EP_WEATHER_VIEW_TEMPONLY 4 61 | #define EP_WEATHER_VIEW_TEXTONLY 5 62 | 63 | #define EP_WEATHER_UPDATE_NORMAL 1200 64 | #define EP_WEATHER_UPDATE_REDUCED 3600 65 | 66 | #define EP_WEATHER_WM_FETCH_DATA (WM_USER + 10) 67 | #define EP_WEATHER_WM_SET_BROWSER_THEME (WM_USER + 11) 68 | #define EP_WEATHER_WM_REBOUND_BROWSER (WM_USER + 12) 69 | #define EP_WEATHER_WM_SETDEVMODE (WM_USER + 13) 70 | #define EP_WEATHER_WM_SETZOOMFACTOR (WM_USER + 14) 71 | 72 | #define EP_WEATHER_HEIGHT_ERROR 280 73 | #define EP_WEATHER_HEIGHT 353 74 | #define EP_WEATHER_WIDTH 673 75 | 76 | #define EP_WEATHER_ICONPACK_MICROSOFT 0 77 | #define EP_WEATHER_ICONPACK_GOOGLE 1 78 | #endif 79 | -------------------------------------------------------------------------------- /ep_weather_host/ep_weather_error_html.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_EP_WEATHER_ERROR_HTML_H_ 2 | #define _H_EP_WEATHER_ERROR_HTML_H_ 3 | #include 4 | #include 5 | #define EP_WEATHER_ERROR_LEN 2000 6 | LPCWSTR ep_weather_error_html = L"\ 7 | \n\ 8 | \n\ 9 | \n\ 10 | \n\ 11 | \n\ 12 | " _T(CLSID_EPWeather_TEXT) L"_ErrorPage\n\ 13 | \n\ 42 | \n\ 43 |
\n\ 44 |

📰

\n\ 45 |

Unable to load weather information

\n\ 46 |

Make sure that the location you have entered is correct.
\n\ 47 | Verify that you are connected to the Internet.

\n\ 48 | Reload\n\ 49 |
\n\ 50 | "; 51 | #endif 52 | -------------------------------------------------------------------------------- /ep_weather_host/ep_weather_factory.c: -------------------------------------------------------------------------------- 1 | #include "ep_weather_factory.h" 2 | #include "ep_weather_host.h" 3 | 4 | ULONG STDMETHODCALLTYPE epw_factory_AddRef(IClassFactory* _this) 5 | { 6 | return(1); 7 | } 8 | 9 | ULONG STDMETHODCALLTYPE epw_factory_Release(IClassFactory* _this) 10 | { 11 | return(1); 12 | } 13 | 14 | HRESULT STDMETHODCALLTYPE epw_factory_QueryInterface( 15 | IClassFactory* _this, 16 | REFIID riid, 17 | void** ppv 18 | ) 19 | { 20 | if (!IsEqualIID(riid, &IID_IUnknown) && 21 | !IsEqualIID(riid, &IID_IClassFactory)) 22 | { 23 | *ppv = 0; 24 | return(E_NOINTERFACE); 25 | } 26 | *ppv = _this; 27 | _this->lpVtbl->AddRef(_this); 28 | return(NOERROR); 29 | } 30 | 31 | HRESULT STDMETHODCALLTYPE epw_factory_LockServer( 32 | IClassFactory* this, 33 | BOOL flock 34 | ) 35 | { 36 | if (flock) InterlockedIncrement(&epw_LockCount); 37 | else 38 | { 39 | LONG dwOutstandingLocks = InterlockedDecrement(&epw_LockCount); 40 | LONG dwOutstandingObjects = InterlockedAdd(&epw_OutstandingObjects, 0); 41 | if (!dwOutstandingObjects && !dwOutstandingLocks) 42 | { 43 | } 44 | } 45 | return(NOERROR); 46 | } 47 | 48 | HRESULT STDMETHODCALLTYPE epw_factory_CreateInstance( 49 | IClassFactory* _this, 50 | IUnknown* punkOuter, 51 | REFIID vTableGuid, 52 | void** ppv 53 | ) 54 | { 55 | HRESULT hr = E_NOINTERFACE; 56 | EPWeather* thisobj = NULL; 57 | 58 | *ppv = 0; 59 | 60 | if (punkOuter) 61 | { 62 | hr = CLASS_E_NOAGGREGATION; 63 | } 64 | else 65 | { 66 | BOOL bOk = FALSE; 67 | if (IsEqualIID(vTableGuid, &IID_IEPWeather)) 68 | { 69 | if (!(thisobj = ALLOC(sizeof(EPWeather)))) 70 | { 71 | hr = E_OUTOFMEMORY; 72 | } 73 | else 74 | { 75 | thisobj->lpVtbl = &IEPWeather_Vtbl; 76 | bOk = TRUE; 77 | } 78 | } 79 | if (bOk) 80 | { 81 | thisobj->cbCount = 1; 82 | hr = thisobj->lpVtbl->QueryInterface(thisobj, vTableGuid, ppv); 83 | thisobj->lpVtbl->Release(thisobj); 84 | if (SUCCEEDED(hr)) InterlockedIncrement(&epw_OutstandingObjects); 85 | } 86 | else 87 | { 88 | return hr; 89 | } 90 | } 91 | 92 | return(hr); 93 | } -------------------------------------------------------------------------------- /ep_weather_host/ep_weather_factory.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_AS_FACTORY_H_ 2 | #define _H_AS_FACTORY_H_ 3 | #include "ep_weather.h" 4 | ULONG STDMETHODCALLTYPE epw_factory_AddRef(IClassFactory* _this); 5 | ULONG STDMETHODCALLTYPE epw_factory_Release(IClassFactory* _this); 6 | HRESULT STDMETHODCALLTYPE epw_factory_QueryInterface( 7 | IClassFactory* _this, 8 | REFIID riid, 9 | void** ppv 10 | ); 11 | HRESULT STDMETHODCALLTYPE epw_factory_LockServer( 12 | IClassFactory* _this, 13 | BOOL flock 14 | ); 15 | HRESULT STDMETHODCALLTYPE epw_factory_CreateInstance( 16 | IClassFactory* _this, 17 | IUnknown* punkOuter, 18 | REFIID vTableGuid, 19 | void** ppv 20 | ); 21 | typedef interface IEPWeatherFactory IEPWeatherFactory; 22 | // {A25216A3-4223-4CB3-A572-11A7CC1AEE4E} 23 | DEFINE_GUID(IID_IEPWeatherFactory, 24 | 0xa25216a3, 0x4223, 0x4cb3, 0xa5, 0x72, 0x11, 0xa7, 0xcc, 0x1a, 0xee, 0x4e); 25 | static const IClassFactoryVtbl IEPWeatherFactoryVtbl = { 26 | epw_factory_QueryInterface, 27 | epw_factory_AddRef, 28 | epw_factory_Release, 29 | epw_factory_CreateInstance, 30 | epw_factory_LockServer 31 | }; 32 | static IClassFactory IClassFactoryInstance = { &IEPWeatherFactoryVtbl }; 33 | static IClassFactory* ClassFactory = &IClassFactoryInstance; 34 | #endif 35 | -------------------------------------------------------------------------------- /ep_weather_host/ep_weather_host.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (United States) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Version 51 | // 52 | 53 | VS_VERSION_INFO VERSIONINFO 54 | FILEVERSION 1,0,0,0 55 | PRODUCTVERSION 1,0,0,0 56 | FILEFLAGSMASK 0x3fL 57 | #ifdef _DEBUG 58 | FILEFLAGS 0x1L 59 | #else 60 | FILEFLAGS 0x0L 61 | #endif 62 | FILEOS 0x40004L 63 | FILETYPE 0x1L 64 | FILESUBTYPE 0x0L 65 | BEGIN 66 | BLOCK "StringFileInfo" 67 | BEGIN 68 | BLOCK "040904b0" 69 | BEGIN 70 | VALUE "CompanyName", "VALINET Solutions SRL" 71 | VALUE "FileDescription", "ExplorerPatcher Weather Host" 72 | VALUE "FileVersion", "1.0.0.0" 73 | VALUE "InternalName", "ep_weather_host.exe" 74 | VALUE "LegalCopyright", "Copyright (C) 2006-2023 VALINET Solutions SRL. All rights reserved." 75 | VALUE "OriginalFilename", "ep_weather_host.exe" 76 | VALUE "ProductName", "ExplorerPatcher" 77 | VALUE "ProductVersion", "1.0.0.0" 78 | END 79 | END 80 | BLOCK "VarFileInfo" 81 | BEGIN 82 | VALUE "Translation", 0x409, 1200 83 | END 84 | END 85 | 86 | #endif // English (United States) resources 87 | ///////////////////////////////////////////////////////////////////////////// 88 | 89 | 90 | 91 | #ifndef APSTUDIO_INVOKED 92 | ///////////////////////////////////////////////////////////////////////////// 93 | // 94 | // Generated from the TEXTINCLUDE 3 resource. 95 | // 96 | 97 | 98 | ///////////////////////////////////////////////////////////////////////////// 99 | #endif // not APSTUDIO_INVOKED 100 | 101 | -------------------------------------------------------------------------------- /ep_weather_host/ep_weather_host.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 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Header Files 31 | 32 | 33 | Header Files 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | Header Files 55 | 56 | 57 | Header Files 58 | 59 | 60 | 61 | 62 | Resource Files 63 | 64 | 65 | 66 | 67 | Source Files 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /ep_weather_host/ep_weather_provider_google_html.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_EP_WEATHER_PROVIDER_GOOGLE_HTML_H_ 2 | #define _H_EP_WEATHER_PROVIDER_GOOGLE_HTML_H_ 3 | #include 4 | #define EP_WEATHER_PROVIDER_GOOGLE_HTML_LEN 2000 5 | LPCWSTR ep_weather_provider_google_html = L"\ 6 | \n\ 7 | \n\ 8 | \n\ 9 | \n\ 10 | Weather\n\ 11 | \n\ 38 | \n\ 39 | \n\ 40 |
\n\ 41 |
\n\ 42 | \n\ 44 |
\n\ 45 |
\n\ 46 | \n\ 47 | "; 48 | #endif -------------------------------------------------------------------------------- /ep_weather_host/ep_weather_utility.h: -------------------------------------------------------------------------------- 1 | #ifndef _H_EP_WEATHER_UTILITY_H_ 2 | #define _H_EP_WEATHER_UTILITY_H_ 3 | #include 4 | #include 5 | #include "../ExplorerPatcher/queryversion.h" 6 | #include "../ExplorerPatcher/osutility.h" 7 | 8 | extern void(*RefreshImmersiveColorPolicyState)(); 9 | extern void(*SetPreferredAppMode)(INT64 bAllowDark); 10 | extern void(*AllowDarkModeForWindow)(HWND hWnd, INT64 bAllowDark); 11 | extern BOOL(*ShouldAppsUseDarkMode)(); 12 | extern BOOL(*ShouldSystemUseDarkMode)(); 13 | 14 | inline BOOL IsColorSchemeChangeMessage(LPARAM lParam) 15 | { 16 | BOOL is = FALSE; 17 | if (lParam && CompareStringOrdinal(lParam, -1, L"ImmersiveColorSet", -1, TRUE) == CSTR_EQUAL) 18 | { 19 | is = TRUE; 20 | } 21 | return is; 22 | } 23 | 24 | inline BOOL IsHighContrast() 25 | { 26 | HIGHCONTRASTW highContrast; 27 | ZeroMemory(&highContrast, sizeof(HIGHCONTRASTW)); 28 | highContrast.cbSize = sizeof(highContrast); 29 | if (SystemParametersInfoW(SPI_GETHIGHCONTRAST, sizeof(highContrast), &highContrast, FALSE)) 30 | return highContrast.dwFlags & HCF_HIGHCONTRASTON; 31 | return FALSE; 32 | } 33 | #endif -------------------------------------------------------------------------------- /ep_weather_host/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ep_weather_host/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by ep_weather_host.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /ep_weather_host_stub/ep_weather_host.idl: -------------------------------------------------------------------------------- 1 | import "oaidl.idl"; 2 | import "ocidl.idl"; 3 | import "unknwn.idl"; 4 | 5 | [ 6 | object, 7 | uuid(CDBF3734-F847-4F1B-B953-A605434DC1E7), 8 | oleautomation, 9 | helpstring("ExplorerPatcher Weather Information") 10 | ] interface IEPWeather : IUnknown 11 | { 12 | HRESULT About([in] HWND hWnd); 13 | 14 | HRESULT Initialize( 15 | [in] WCHAR wszName[260], 16 | [in] BOOL bAllocConsole, 17 | [in] LONG64 dwProvider, 18 | [in] LONG64 cbx, 19 | [in] LONG64 cby, 20 | [in] LONG64 dwTemperatureUnit, 21 | [in] LONG64 dwUpdateSchedule, 22 | [in] RECT rc, 23 | [in] LONG64 dwDarkMode, 24 | [in] LONG64 dwGeolocationMode, 25 | [out] HWND* hWnd, 26 | [in] LONG64 dwZoomFactor, 27 | [in] LONG64 dpiXInitial, 28 | [in] LONG64 dpiYInitial 29 | ); 30 | 31 | HRESULT Show(); 32 | 33 | HRESULT Hide(); 34 | 35 | HRESULT GetWindowHandle([out] HWND* phWnd); 36 | 37 | HRESULT LockData(); 38 | 39 | HRESULT GetDataSizes( 40 | [out] LPDWORD pcbTemperature, 41 | [out] LPDWORD pcbUnit, 42 | [out] LPDWORD pcbCondition, 43 | [out] LPDWORD pcbImage 44 | ); 45 | 46 | HRESULT GetData( 47 | [in] DWORD cbTemperature, 48 | [out, size_is(cbTemperature)] BYTE* wszTemperature, 49 | [in] DWORD cbUnit, 50 | [ out, size_is(cbUnit)] BYTE* wszUnit, 51 | [in] DWORD cbCondition, 52 | [out, size_is(cbCondition)] BYTE* wszCondition, 53 | [in] DWORD cbImage, 54 | [out, size_is(cbImage)] BYTE* pImage 55 | ); 56 | 57 | HRESULT UnlockData(); 58 | 59 | HRESULT SetNotifyWindow([in] HWND hWndNotify); 60 | 61 | HRESULT IsInitialized([out] BOOL* bIsInitialized); 62 | 63 | HRESULT GetTitle([in] DWORD cbTitle, [out, size_is(cbTitle)] BYTE* wszTitle, [in] DWORD dwType); 64 | 65 | HRESULT SetTemperatureUnit([in] LONG64 dwTemperatureUnit); 66 | 67 | HRESULT SetTerm([in] DWORD cbTerm, [in, size_is(cbTerm)] BYTE* wszTerm); 68 | 69 | HRESULT SetLanguage([in] DWORD cblanguage, [in, size_is(cblanguage)] BYTE* wszLanguage); 70 | 71 | HRESULT SetUpdateSchedule([in] LONG64 dwUpdateSchedule); 72 | 73 | HRESULT SetIconSize([in] LONG64 cbx, [in] LONG64 cby); 74 | 75 | HRESULT GetIconSize([out] LONG64* cbx, [out] LONG64* cby); 76 | 77 | HRESULT SetDarkMode([in] LONG64 dwDarkMode, [in] LONG64 bRefresh); 78 | 79 | HRESULT SetGeolocationMode([in] LONG64 dwGeolocationMode); 80 | 81 | HRESULT SetWindowCornerPreference([in] LONG64 dwWindowCornerPreference); 82 | 83 | HRESULT SetDevMode([in] LONG64 dwDevMode, [in] LONG64 bRefresh); 84 | 85 | HRESULT SetIconPack([in] LONG64 dwIconPack, [in] LONG64 bRefresh); 86 | 87 | HRESULT SetZoomFactor([in] LONG64 dwZoomFactor); 88 | 89 | HRESULT GetLastUpdateTime([out] LPSYSTEMTIME lpLastUpdateTime); 90 | }; -------------------------------------------------------------------------------- /ep_weather_host_stub/ep_weather_host_stub.def: -------------------------------------------------------------------------------- 1 | LIBRARY ep_weather_host_stub.dll 2 | DESCRIPTION 'ExplorerPatcher Weather Stub DLL' 3 | EXPORTS DllGetClassObject @1 PRIVATE 4 | DllCanUnloadNow @2 PRIVATE 5 | DllRegisterServer @4 PRIVATE 6 | DllUnregisterServer @5 PRIVATE -------------------------------------------------------------------------------- /ep_weather_host_stub/ep_weather_host_stub.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 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | 34 | 35 | Header Files 36 | 37 | 38 | 39 | 40 | Source Files 41 | 42 | 43 | -------------------------------------------------------------------------------- /version.h: -------------------------------------------------------------------------------- 1 | #define VER_MAJOR 22621 2 | #define VER_MINOR 2428 3 | #define VER_BUILD_HI 59 4 | #define VER_BUILD_LO 1 5 | #define VER_FLAGS VS_FF_PRERELEASE 6 | 7 | 8 | // The Binary form of the version numbers 9 | #define VER_FILE VER_MAJOR, VER_MINOR, VER_BUILD_HI, VER_BUILD_LO 10 | #define VER_PRODUCT VER_MAJOR, VER_MINOR, VER_BUILD_HI, VER_BUILD_LO 11 | 12 | #define VER_STR(arg) #arg 13 | 14 | #define STRINGIFYVER2(X) #X 15 | #define STRINGIFYVER(X) STRINGIFYVER2(X) 16 | #define VER_WITH_DOTS STRINGIFYVER(VER_MAJOR) "." STRINGIFYVER(VER_MINOR) "." STRINGIFYVER(VER_BUILD_HI) "." STRINGIFYVER(VER_BUILD_LO) 17 | 18 | // The String form of the version numbers 19 | #define VER_FILE_STRING VALUE "FileVersion", VER_WITH_DOTS 20 | #define VER_PRODUCT_STRING VALUE "ProductVersion", VER_WITH_DOTS 21 | --------------------------------------------------------------------------------