mirror of
				https://github.com/pbatard/rufus.git
				synced 2024-08-14 23:57:05 +00:00 
			
		
		
		
	Compare commits
	
		
			1 commit
		
	
	
		
			e6bf982cad
			...
			4d5b763f5e
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 4d5b763f5e | 
					 11 changed files with 73 additions and 244 deletions
				
			
		|  | @ -19,7 +19,7 @@ TARGET        := $(word 1,$(subst -, ,$(TUPLE))) | ||||||
| DEF_SUFFIX    := $(if $(TARGET:x86_64=),.def,.def64) | DEF_SUFFIX    := $(if $(TARGET:x86_64=),.def,.def64) | ||||||
| 
 | 
 | ||||||
| .PHONY: all | .PHONY: all | ||||||
| all: dwmapi-delaylib.lib version-delaylib.lib wintrust-delaylib.lib uxtheme-delaylib.lib | all: dwmapi-delaylib.lib version-delaylib.lib wintrust-delaylib.lib | ||||||
| 
 | 
 | ||||||
| %.def64: %.def | %.def64: %.def | ||||||
| 	$(AM_V_SED) "s/@.*//" $< >$@ | 	$(AM_V_SED) "s/@.*//" $< >$@ | ||||||
|  |  | ||||||
|  | @ -367,7 +367,7 @@ uninstall-am: | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| .PHONY: all | .PHONY: all | ||||||
| all: dwmapi-delaylib.lib version-delaylib.lib wintrust-delaylib.lib uxtheme-delaylib.lib | all: dwmapi-delaylib.lib version-delaylib.lib wintrust-delaylib.lib | ||||||
| 
 | 
 | ||||||
| %.def64: %.def | %.def64: %.def | ||||||
| 	$(AM_V_SED) "s/@.*//" $< >$@ | 	$(AM_V_SED) "s/@.*//" $< >$@ | ||||||
|  |  | ||||||
|  | @ -1,3 +1,2 @@ | ||||||
| EXPORTS | EXPORTS | ||||||
|   DwmGetWindowAttribute@16 |   DwmGetWindowAttribute@16 | ||||||
|   DwmSetWindowAttribute@16 |  | ||||||
|  |  | ||||||
|  | @ -1,79 +0,0 @@ | ||||||
| ; |  | ||||||
| ; Definition file of UxTheme.dll |  | ||||||
| ; Automatic generated by gendef |  | ||||||
| ; written by Kai Tietz 2008 |  | ||||||
| ; |  | ||||||
| LIBRARY "UxTheme.dll" |  | ||||||
| EXPORTS |  | ||||||
| BeginPanningFeedback@4 |  | ||||||
| EndPanningFeedback@8 |  | ||||||
| UpdatePanningFeedback@16 |  | ||||||
| BeginBufferedAnimation@32 |  | ||||||
| BeginBufferedPaint@20 |  | ||||||
| BufferedPaintClear@8 |  | ||||||
| BufferedPaintInit@0 |  | ||||||
| BufferedPaintRenderAnimation@8 |  | ||||||
| BufferedPaintSetAlpha@12 |  | ||||||
| DrawThemeBackgroundEx@24 |  | ||||||
| BufferedPaintStopAllAnimations@4 |  | ||||||
| BufferedPaintUnInit@0 |  | ||||||
| CloseThemeData@4 |  | ||||||
| DrawThemeBackground@24 |  | ||||||
| DrawThemeEdge@32 |  | ||||||
| DrawThemeIcon@28 |  | ||||||
| DrawThemeParentBackground@12 |  | ||||||
| DrawThemeParentBackgroundEx@16 |  | ||||||
| DrawThemeText@36 |  | ||||||
| OpenThemeDataEx@12 |  | ||||||
| DrawThemeTextEx@36 |  | ||||||
| EnableThemeDialogTexture@8 |  | ||||||
| EnableTheming@4 |  | ||||||
| EndBufferedAnimation@8 |  | ||||||
| EndBufferedPaint@8 |  | ||||||
| GetBufferedPaintBits@12 |  | ||||||
| GetBufferedPaintDC@4 |  | ||||||
| GetBufferedPaintTargetDC@4 |  | ||||||
| GetBufferedPaintTargetRect@8 |  | ||||||
| GetCurrentThemeName@24 |  | ||||||
| GetThemeAppProperties@0 |  | ||||||
| GetThemeBackgroundContentRect@24 |  | ||||||
| GetThemeBackgroundExtent@24 |  | ||||||
| GetThemeBackgroundRegion@24 |  | ||||||
| GetThemeBitmap@24 |  | ||||||
| GetThemeBool@20 |  | ||||||
| GetThemeColor@20 |  | ||||||
| GetThemeDocumentationProperty@16 |  | ||||||
| GetThemeEnumValue@20 |  | ||||||
| GetThemeFilename@24 |  | ||||||
| GetThemeFont@24 |  | ||||||
| GetThemeInt@20 |  | ||||||
| GetThemeIntList@20 |  | ||||||
| GetThemeMargins@28 |  | ||||||
| GetThemeMetric@24 |  | ||||||
| GetThemePartSize@28 |  | ||||||
| GetThemePosition@20 |  | ||||||
| GetThemePropertyOrigin@20 |  | ||||||
| GetThemeRect@20 |  | ||||||
| GetThemeStream@28 |  | ||||||
| GetThemeString@24 |  | ||||||
| GetThemeSysBool@8 |  | ||||||
| GetThemeSysColor@8 |  | ||||||
| GetThemeSysColorBrush@8 |  | ||||||
| GetThemeSysFont@12 |  | ||||||
| GetThemeSysInt@12 |  | ||||||
| GetThemeSysSize@8 |  | ||||||
| GetThemeSysString@16 |  | ||||||
| GetThemeTextExtent@36 |  | ||||||
| GetThemeTextMetrics@20 |  | ||||||
| GetThemeTransitionDuration@24 |  | ||||||
| GetWindowTheme@4 |  | ||||||
| HitTestThemeBackground@40 |  | ||||||
| IsAppThemed@0 |  | ||||||
| IsCompositionActive@0 |  | ||||||
| IsThemeActive@0 |  | ||||||
| IsThemeBackgroundPartiallyTransparent@12 |  | ||||||
| IsThemeDialogTextureEnabled@4 |  | ||||||
| IsThemePartDefined@12 |  | ||||||
| OpenThemeData@8 |  | ||||||
| SetThemeAppProperties@4 |  | ||||||
| SetWindowTheme@12 |  | ||||||
|  | @ -133,12 +133,12 @@ | ||||||
|       <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> |       <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> | ||||||
|     </ClCompile> |     </ClCompile> | ||||||
|     <Link> |     <Link> | ||||||
|       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;uxtheme.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> |       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||||||
|       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> |       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> | ||||||
|       <GenerateDebugInformation>true</GenerateDebugInformation> |       <GenerateDebugInformation>true</GenerateDebugInformation> | ||||||
|       <SubSystem>Windows</SubSystem> |       <SubSystem>Windows</SubSystem> | ||||||
|       <TargetMachine>MachineX86</TargetMachine> |       <TargetMachine>MachineX86</TargetMachine> | ||||||
|       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;uxtheme.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> |       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> | ||||||
|     </Link> |     </Link> | ||||||
|     <ResourceCompile> |     <ResourceCompile> | ||||||
|       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||||
|  | @ -162,12 +162,12 @@ | ||||||
|       <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> |       <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> | ||||||
|     </ClCompile> |     </ClCompile> | ||||||
|     <Link> |     <Link> | ||||||
|       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;uxtheme.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> |       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||||||
|       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> |       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> | ||||||
|       <GenerateDebugInformation>true</GenerateDebugInformation> |       <GenerateDebugInformation>true</GenerateDebugInformation> | ||||||
|       <SubSystem>Windows</SubSystem> |       <SubSystem>Windows</SubSystem> | ||||||
|       <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\arm</AdditionalLibraryDirectories> |       <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\arm</AdditionalLibraryDirectories> | ||||||
|       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;uxtheme.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> |       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> | ||||||
|     </Link> |     </Link> | ||||||
|     <ResourceCompile> |     <ResourceCompile> | ||||||
|       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||||
|  | @ -193,12 +193,12 @@ | ||||||
|       <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> |       <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> | ||||||
|     </ClCompile> |     </ClCompile> | ||||||
|     <Link> |     <Link> | ||||||
|       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;uxtheme.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> |       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||||||
|       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> |       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> | ||||||
|       <GenerateDebugInformation>true</GenerateDebugInformation> |       <GenerateDebugInformation>true</GenerateDebugInformation> | ||||||
|       <SubSystem>Windows</SubSystem> |       <SubSystem>Windows</SubSystem> | ||||||
|       <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\arm64</AdditionalLibraryDirectories> |       <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\arm64</AdditionalLibraryDirectories> | ||||||
|       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;uxtheme.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> |       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> | ||||||
|     </Link> |     </Link> | ||||||
|     <ResourceCompile> |     <ResourceCompile> | ||||||
|       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||||
|  | @ -229,12 +229,12 @@ | ||||||
|       <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> |       <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> | ||||||
|     </ClCompile> |     </ClCompile> | ||||||
|     <Link> |     <Link> | ||||||
|       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;uxtheme.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> |       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||||||
|       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> |       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> | ||||||
|       <GenerateDebugInformation>true</GenerateDebugInformation> |       <GenerateDebugInformation>true</GenerateDebugInformation> | ||||||
|       <SubSystem>Windows</SubSystem> |       <SubSystem>Windows</SubSystem> | ||||||
|       <TargetMachine>MachineX64</TargetMachine> |       <TargetMachine>MachineX64</TargetMachine> | ||||||
|       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;uxtheme.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> |       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> | ||||||
|     </Link> |     </Link> | ||||||
|     <ResourceCompile> |     <ResourceCompile> | ||||||
|       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||||
|  | @ -260,13 +260,13 @@ | ||||||
|       <StringPooling>true</StringPooling> |       <StringPooling>true</StringPooling> | ||||||
|     </ClCompile> |     </ClCompile> | ||||||
|     <Link> |     <Link> | ||||||
|       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;uxtheme.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> |       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||||||
|       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> |       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> | ||||||
|       <GenerateDebugInformation>false</GenerateDebugInformation> |       <GenerateDebugInformation>false</GenerateDebugInformation> | ||||||
|       <SubSystem>Windows</SubSystem> |       <SubSystem>Windows</SubSystem> | ||||||
|       <TargetMachine>MachineX86</TargetMachine> |       <TargetMachine>MachineX86</TargetMachine> | ||||||
|       <AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions> |       <AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions> | ||||||
|       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;uxtheme.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> |       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> | ||||||
|     </Link> |     </Link> | ||||||
|     <ResourceCompile> |     <ResourceCompile> | ||||||
|       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||||
|  | @ -292,13 +292,13 @@ | ||||||
|       <StringPooling>true</StringPooling> |       <StringPooling>true</StringPooling> | ||||||
|     </ClCompile> |     </ClCompile> | ||||||
|     <Link> |     <Link> | ||||||
|       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;uxtheme.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> |       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||||||
|       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> |       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> | ||||||
|       <GenerateDebugInformation>false</GenerateDebugInformation> |       <GenerateDebugInformation>false</GenerateDebugInformation> | ||||||
|       <SubSystem>Windows</SubSystem> |       <SubSystem>Windows</SubSystem> | ||||||
|       <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\arm</AdditionalLibraryDirectories> |       <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\arm</AdditionalLibraryDirectories> | ||||||
|       <AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions> |       <AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions> | ||||||
|       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;uxtheme.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> |       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> | ||||||
|     </Link> |     </Link> | ||||||
|     <ResourceCompile> |     <ResourceCompile> | ||||||
|       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||||
|  | @ -326,13 +326,13 @@ | ||||||
|       <StringPooling>true</StringPooling> |       <StringPooling>true</StringPooling> | ||||||
|     </ClCompile> |     </ClCompile> | ||||||
|     <Link> |     <Link> | ||||||
|       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;uxtheme.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> |       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||||||
|       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> |       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> | ||||||
|       <GenerateDebugInformation>false</GenerateDebugInformation> |       <GenerateDebugInformation>false</GenerateDebugInformation> | ||||||
|       <SubSystem>Windows</SubSystem> |       <SubSystem>Windows</SubSystem> | ||||||
|       <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\arm64</AdditionalLibraryDirectories> |       <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\arm64</AdditionalLibraryDirectories> | ||||||
|       <AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions> |       <AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions> | ||||||
|       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;uxtheme.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> |       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> | ||||||
|     </Link> |     </Link> | ||||||
|     <ResourceCompile> |     <ResourceCompile> | ||||||
|       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||||
|  | @ -363,13 +363,13 @@ | ||||||
|       <StringPooling>true</StringPooling> |       <StringPooling>true</StringPooling> | ||||||
|     </ClCompile> |     </ClCompile> | ||||||
|     <Link> |     <Link> | ||||||
|       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;uxtheme.lib;uxtheme.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> |       <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||||||
|       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> |       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> | ||||||
|       <GenerateDebugInformation>false</GenerateDebugInformation> |       <GenerateDebugInformation>false</GenerateDebugInformation> | ||||||
|       <SubSystem>Windows</SubSystem> |       <SubSystem>Windows</SubSystem> | ||||||
|       <TargetMachine>MachineX64</TargetMachine> |       <TargetMachine>MachineX64</TargetMachine> | ||||||
|       <AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions> |       <AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions> | ||||||
|       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;uxtheme.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> |       <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> | ||||||
|     </Link> |     </Link> | ||||||
|     <ResourceCompile> |     <ResourceCompile> | ||||||
|       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |       <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||||
|  |  | ||||||
|  | @ -280,7 +280,7 @@ NONVULNERABLE_LIBS = -lsetupapi -lole32 -lgdi32 -lshlwapi -lcrypt32 -lcomctl32 - | ||||||
| # Ideally there would also be virtdisk and wininet as delaylib's below, but the MinGW folks haven't quite sorted out delay-loading
 | # Ideally there would also be virtdisk and wininet as delaylib's below, but the MinGW folks haven't quite sorted out delay-loading
 | ||||||
| # for x86_32 so as soon as you try to call APIs from these, the application will crash!
 | # for x86_32 so as soon as you try to call APIs from these, the application will crash!
 | ||||||
| # See https://github.com/pbatard/rufus/issues/1877#issuecomment-1109683039 as well as https://github.com/pbatard/rufus/issues/2272
 | # See https://github.com/pbatard/rufus/issues/1877#issuecomment-1109683039 as well as https://github.com/pbatard/rufus/issues/2272
 | ||||||
| VULNERABLE_LIBS = -ldwmapi-delaylib -lversion-delaylib -lwintrust-delaylib -luxtheme-delaylib | VULNERABLE_LIBS = -ldwmapi-delaylib -lversion-delaylib -lwintrust-delaylib | ||||||
| AM_V_WINDRES_0 = @echo "  RC     $@";$(WINDRES) | AM_V_WINDRES_0 = @echo "  RC     $@";$(WINDRES) | ||||||
| AM_V_WINDRES_1 = $(WINDRES) | AM_V_WINDRES_1 = $(WINDRES) | ||||||
| AM_V_WINDRES_ = $(AM_V_WINDRES_$(AM_DEFAULT_VERBOSITY)) | AM_V_WINDRES_ = $(AM_V_WINDRES_$(AM_DEFAULT_VERBOSITY)) | ||||||
|  |  | ||||||
|  | @ -27,16 +27,9 @@ | ||||||
| extern "C" { | extern "C" { | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| // disable all warnings until fix theme 
 |  | ||||||
| #ifdef __GNUC__ |  | ||||||
| #pragma GCC diagnostic ignored "-Wstrict-prototypes" |  | ||||||
| #pragma GCC diagnostic ignored "-Wunused-variable" |  | ||||||
| #endif  |  | ||||||
| 
 |  | ||||||
| #define REGKEY_HKCU                 HKEY_CURRENT_USER | #define REGKEY_HKCU                 HKEY_CURRENT_USER | ||||||
| #define REGKEY_HKLM                 HKEY_LOCAL_MACHINE | #define REGKEY_HKLM                 HKEY_LOCAL_MACHINE | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| /* Delete a registry key from <key_root>\Software and all its values
 | /* Delete a registry key from <key_root>\Software and all its values
 | ||||||
|    If the key has subkeys, this call will fail. */ |    If the key has subkeys, this call will fail. */ | ||||||
| static __inline BOOL DeleteRegistryKey(HKEY key_root, const char* key_name) | static __inline BOOL DeleteRegistryKey(HKEY key_root, const char* key_name) | ||||||
|  |  | ||||||
							
								
								
									
										58
									
								
								src/rufus.c
									
										
									
									
									
								
							
							
						
						
									
										58
									
								
								src/rufus.c
									
										
									
									
									
								
							|  | @ -59,9 +59,8 @@ | ||||||
| #include "../res/grub2/grub2_version.h" | #include "../res/grub2/grub2_version.h" | ||||||
| #include<dwmapi.h> | #include<dwmapi.h> | ||||||
| #include <Richedit.h> | #include <Richedit.h> | ||||||
| #include <uxtheme.h> | #pragma comment(lib,"UxTheme.lib") | ||||||
| 
 | #pragma comment(lib,"DwmApi.lib") | ||||||
| 
 |  | ||||||
| enum bootcheck_return { | enum bootcheck_return { | ||||||
| 	BOOTCHECK_PROCEED = 0, | 	BOOTCHECK_PROCEED = 0, | ||||||
| 	BOOTCHECK_CANCEL = -1, | 	BOOTCHECK_CANCEL = -1, | ||||||
|  | @ -107,7 +106,7 @@ extern const char* old_c32_name[NB_OLD_C32]; | ||||||
| extern const char* cert_name[3]; | extern const char* cert_name[3]; | ||||||
| extern const char* FileSystemLabel[FS_MAX]; | extern const char* FileSystemLabel[FS_MAX]; | ||||||
| extern const char *bootmgr_efi_name, *efi_dirname, *efi_bootname[ARCH_MAX]; | extern const char *bootmgr_efi_name, *efi_dirname, *efi_bootname[ARCH_MAX]; | ||||||
| static UINT_PTR uIdSubclass = 1; | 
 | ||||||
| /*
 | /*
 | ||||||
|  * Globals |  * Globals | ||||||
|  */ |  */ | ||||||
|  | @ -155,7 +154,8 @@ RUFUS_DRIVE rufus_drive[MAX_DRIVES] = { 0 }; | ||||||
| // This function sets the alpha channel to 255 without
 | // This function sets the alpha channel to 255 without
 | ||||||
| // affecting any of the color channels.
 | // affecting any of the color channels.
 | ||||||
| 
 | 
 | ||||||
| void MakeBitmapOpaque( HDC hdc, int x, int y, int cx, int cy) | void MakeBitmapOpaque( | ||||||
|  | 	HDC hdc, int x, int y, int cx, int cy) | ||||||
| { | { | ||||||
| 	BITMAPINFO bi = {0}; | 	BITMAPINFO bi = {0}; | ||||||
| 	bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); | 	bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); | ||||||
|  | @ -164,8 +164,12 @@ void MakeBitmapOpaque( HDC hdc, int x, int y, int cx, int cy) | ||||||
| 	bi.bmiHeader.biPlanes = 1; | 	bi.bmiHeader.biPlanes = 1; | ||||||
| 	bi.bmiHeader.biBitCount = 32; | 	bi.bmiHeader.biBitCount = 32; | ||||||
| 	bi.bmiHeader.biCompression = BI_RGB; | 	bi.bmiHeader.biCompression = BI_RGB; | ||||||
|  | 
 | ||||||
| 	RGBQUAD bitmapBits = { 0x00, 0x00, 0x00, 0xFF }; | 	RGBQUAD bitmapBits = { 0x00, 0x00, 0x00, 0xFF }; | ||||||
| 	StretchDIBits(hdc, x, y, cx, cy, 0, 0, 1, 1, &bitmapBits, &bi,DIB_RGB_COLORS, SRCPAINT); | 
 | ||||||
|  | 	StretchDIBits(hdc, x, y, cx, cy, | ||||||
|  | 		0, 0, 1, 1, &bitmapBits, &bi, | ||||||
|  | 		DIB_RGB_COLORS, SRCPAINT); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // TODO: Remember to update copyright year in stdlg's AboutCallback() WM_INITDIALOG,
 | // TODO: Remember to update copyright year in stdlg's AboutCallback() WM_INITDIALOG,
 | ||||||
|  | @ -959,9 +963,10 @@ out: | ||||||
|  * DarkMode CheckBox Subclass Proc |  * DarkMode CheckBox Subclass Proc | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| static LRESULT CALLBACK ButtonSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam,LPARAM lParam, UINT_PTR idSubclass, DWORD_PTR dwRefData) | static LRESULT CALLBACK ButtonSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, | ||||||
|  | 	LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) | ||||||
| { | { | ||||||
| 	if (!IsAppsUseDarkMode()) | 	if (!IsAppsUseDarkMode) | ||||||
| 	{ | 	{ | ||||||
| 		return DefSubclassProc(hWnd, uMsg, wParam, lParam); | 		return DefSubclassProc(hWnd, uMsg, wParam, lParam); | ||||||
| 	} | 	} | ||||||
|  | @ -988,15 +993,15 @@ static LRESULT CALLBACK ButtonSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam,L | ||||||
| 		rc1.left += siz.cx + 2; | 		rc1.left += siz.cx + 2; | ||||||
| 		FillRect(hDc, &rc1, CreateSolidBrush(ColorControlDark)); | 		FillRect(hDc, &rc1, CreateSolidBrush(ColorControlDark)); | ||||||
| 		rc1.top += GetSystemMetrics(SM_CXPADDEDBORDER); | 		rc1.top += GetSystemMetrics(SM_CXPADDEDBORDER); | ||||||
| 		WCHAR szCaption[60]; | 		LPCWSTR* staticText[99] = {0}; | ||||||
| 		GetWindowText(hWnd, szCaption, ARRAYSIZE(szCaption)); | 		GetWindowText(hWnd, staticText, ARRAYSIZE(staticText)); | ||||||
| 		DTTOPTS opts; | 		DTTOPTS opts; | ||||||
| 		opts.dwSize = sizeof(DTTOPTS); | 		opts.dwSize = sizeof(DTTOPTS); | ||||||
| 		opts.dwFlags = DTT_TEXTCOLOR; | 		opts.dwFlags = DTT_TEXTCOLOR; | ||||||
| 		opts.crText = RGB(255, 255, 255); | 		opts.crText = RGB(255, 255, 255); | ||||||
| 		HFONT font = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0); | 		HFONT font = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0); | ||||||
| 		SelectObject(hDc, font); | 		SelectObject(hDc, font); | ||||||
| 		DrawThemeTextEx(btnTheme, hDc, 3, 0, szCaption, -1, DT_SINGLELINE | DT_LEFT, &rc1, &opts); | 		DrawThemeTextEx(btnTheme, hDc, 3, 0, &staticText, -1, DT_SINGLELINE | DT_LEFT, &rc1, &opts); | ||||||
| 		ReleaseDC(hWnd, hDc); | 		ReleaseDC(hWnd, hDc); | ||||||
| 		return true; | 		return true; | ||||||
| 	} | 	} | ||||||
|  | @ -1008,10 +1013,10 @@ static LRESULT CALLBACK ButtonSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam,L | ||||||
|  */ |  */ | ||||||
| static BOOL CALLBACK ThemeCallback(HWND hWnd, LPARAM lParam) | static BOOL CALLBACK ThemeCallback(HWND hWnd, LPARAM lParam) | ||||||
| { | { | ||||||
| 	WCHAR str[20] = {0}; | 	const char* str[255] = {0}; | ||||||
| 	GetClassName(hWnd, str, 20); | 	GetClassName(hWnd, &str, 255); | ||||||
| 	bool isDarkmode = IsAppsUseDarkMode(); | 	bool isDarkmode = IsAppsUseDarkMode(); | ||||||
| 	if (_wcsicmp(str, L"Button") == 0) | 	if (strcmp(str, L"Button") == 0) | ||||||
| 	{ | 	{ | ||||||
| 		LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE); | 		LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE); | ||||||
| 		if ((style & BS_AUTOCHECKBOX) == BS_AUTOCHECKBOX) | 		if ((style & BS_AUTOCHECKBOX) == BS_AUTOCHECKBOX) | ||||||
|  | @ -1028,20 +1033,20 @@ static BOOL CALLBACK ThemeCallback(HWND hWnd, LPARAM lParam) | ||||||
| 		else | 		else | ||||||
| 			SetWindowTheme(hWnd, isDarkmode ? L"DarkMode_Explorer" : L"Explorer", NULL); | 			SetWindowTheme(hWnd, isDarkmode ? L"DarkMode_Explorer" : L"Explorer", NULL); | ||||||
| 	} | 	} | ||||||
| 	else if (_wcsicmp(str, L"ComboBox") == 0) | 	else if (strcmp(str, L"ComboBox") == 0) | ||||||
| 	{ | 	{ | ||||||
| 		SetWindowTheme(hWnd, isDarkmode ? L"DarkMode_CFD" : L"Explorer", NULL); | 		SetWindowTheme(hWnd, isDarkmode ? L"DarkMode_CFD" : L"Explorer", NULL); | ||||||
| 	} | 	} | ||||||
| 	else if (_wcsicmp(str, L"ToolbarWindow32") == 0) | 	else if (strcmp(str, L"ToolBar") == 0) | ||||||
| 	{ | 	{ | ||||||
| 		wchar_t toolbarText[50]; | 		wchar_t toolbarText[50]; | ||||||
| 		wchar_t multiToolbarText[50] ; | 		wchar_t multiToolbarText[50] ; | ||||||
| 		utf8_to_wchar_no_alloc(lmprintf(MSG_315), multiToolbarText, ARRAYSIZE(multiToolbarText)); | 		utf8_to_wchar_no_alloc(lmprintf(MSG_315), multiToolbarText, ARRAYSIZE(multiToolbarText)); | ||||||
| 		GetWindowText(hWnd, &toolbarText, 16); | 		GetWindowText(hWnd, &toolbarText, 16); | ||||||
| 		 if (_wcsicmp(toolbarText, multiToolbarText) != 0) | 		if (strcmp(toolbarText, multiToolbarText) != 0) | ||||||
| 			SetWindowTheme(hWnd, isDarkmode ? L"DarkMode" : L"Explorer", NULL); | 			SetWindowTheme(hWnd, isDarkmode ? L"DarkMode" : L"Explorer", NULL); | ||||||
| 	} | 	} | ||||||
| 	else if (_wcsicmp(str, L"EDIT") == 0) | 	else if (strcmp(str, L"EDIT") == 0) | ||||||
| 	{ | 	{ | ||||||
| 		LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE); | 		LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE); | ||||||
| 		if (((style & WS_VSCROLL) == WS_VSCROLL) || ((style & WS_HSCROLL) == WS_HSCROLL)) | 		if (((style & WS_VSCROLL) == WS_VSCROLL) || ((style & WS_HSCROLL) == WS_HSCROLL)) | ||||||
|  | @ -1060,9 +1065,11 @@ static BOOL CALLBACK ThemeCallback(HWND hWnd, LPARAM lParam) | ||||||
|  * DarkMod Dialog Subclass Proc |  * DarkMod Dialog Subclass Proc | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| static LRESULT CALLBACK DlgSubclassProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam, UINT_PTR idSubclass, DWORD_PTR dwRefData) | static LRESULT CALLBACK DlgSubclassProc(HWND hDlg, UINT message, WPARAM wParam, | ||||||
|  | 	LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) | ||||||
| { | { | ||||||
| 	 | 	RECT rcDlg; | ||||||
|  | 	GetClientRect(hDlg, &rcDlg); | ||||||
| 	HDC dc; | 	HDC dc; | ||||||
| 	switch (message) | 	switch (message) | ||||||
| 	{ | 	{ | ||||||
|  | @ -1081,17 +1088,16 @@ static LRESULT CALLBACK DlgSubclassProc(HWND hDlg, UINT message, WPARAM wParam, | ||||||
| 		int borderWidth = (rcWinWidth - rcrcClientWidth) / 2; | 		int borderWidth = (rcWinWidth - rcrcClientWidth) / 2; | ||||||
| 		int captionHight = rcWinHieght - rcrcClientHieght - borderWidth; | 		int captionHight = rcWinHieght - rcrcClientHieght - borderWidth; | ||||||
| 		OffsetRect(&rcWin, -rcWin.left, -rcWin.top); | 		OffsetRect(&rcWin, -rcWin.left, -rcWin.top); | ||||||
| 		OffsetRect(&rcClient, -rcWin.left, -rcWin.top); | 		OffsetRect(&rcClient, borderWidth, captionHight); | ||||||
| 		HRGN copy =CreateRectRgn(0, 0, 0, 0); | 		HRGN updateRgn = wParam != 1 ?(HRGN)wParam : CreateRectRgnIndirect(&rcWin); | ||||||
| 		HRGN updateRgn = wParam != 1 ? copy : CreateRectRgnIndirect(&rcWin); |  | ||||||
| 		HRGN clipRgn = CreateRectRgn(0, 0, 0, 0); | 		HRGN clipRgn = CreateRectRgn(0, 0, 0, 0); | ||||||
| 		HRGN ncRgn = CreateRectRgn(0, 0, 0, 0); | 		HRGN ncRgn = CreateRectRgn(0, 0, 0, 0); | ||||||
| 		CombineRgn(copy, copy, (HRGN)wParam, RGN_COPY); | 
 | ||||||
| 		if (wParam == 1) | 		if (wParam == 1) | ||||||
| 			clipRgn = CreateRectRgnIndirect(&rcClient); | 			clipRgn = CreateRectRgnIndirect(&rcClient); | ||||||
| 		else | 		else | ||||||
| 			GetClipRgn(windowDC, clipRgn); | 			GetClipRgn(windowDC, clipRgn); | ||||||
| 		CombineRgn(ncRgn, updateRgn, clipRgn, RGN_OR); | 		CombineRgn(ncRgn, updateRgn, clipRgn, RGN_DIFF); | ||||||
| 		SelectClipRgn(windowDC, ncRgn); | 		SelectClipRgn(windowDC, ncRgn); | ||||||
| 		FillRect(windowDC, &rcWin, CreateSolidBrush(RGB(63, 63, 63))); | 		FillRect(windowDC, &rcWin, CreateSolidBrush(RGB(63, 63, 63))); | ||||||
| 		HRGN hRgn= CreateRectRgnIndirect(&rcWin); | 		HRGN hRgn= CreateRectRgnIndirect(&rcWin); | ||||||
|  | @ -1171,6 +1177,8 @@ static LRESULT CALLBACK DlgSubclassProc(HWND hDlg, UINT message, WPARAM wParam, | ||||||
| 		return (INT_PTR)CreateSolidBrush(ColorControlDark); | 		return (INT_PTR)CreateSolidBrush(ColorControlDark); | ||||||
| 	case WM_CTLCOLORSTATIC: | 	case WM_CTLCOLORSTATIC: | ||||||
| 		 dc = GetDC((HWND)lParam); | 		 dc = GetDC((HWND)lParam); | ||||||
|  | 		RECT rcDlg; | ||||||
|  | 		GetClientRect((HWND)lParam, &rcDlg); | ||||||
| 		safe_release_dc((HWND)lParam, dc); | 		safe_release_dc((HWND)lParam, dc); | ||||||
| 		if ((HWND)lParam == GetDlgItem(hDlg, IDC_LABEL)) | 		if ((HWND)lParam == GetDlgItem(hDlg, IDC_LABEL)) | ||||||
| 		{ | 		{ | ||||||
|  |  | ||||||
							
								
								
									
										126
									
								
								src/stdlg.c
									
										
									
									
									
								
							
							
						
						
									
										126
									
								
								src/stdlg.c
									
										
									
									
									
								
							|  | @ -44,7 +44,6 @@ | ||||||
| #include "settings.h" | #include "settings.h" | ||||||
| #include "license.h" | #include "license.h" | ||||||
| #include <Uxtheme.h> | #include <Uxtheme.h> | ||||||
| #include <dwmapi.h> |  | ||||||
| 
 | 
 | ||||||
| /* Globals */ | /* Globals */ | ||||||
| extern BOOL is_x86_64, appstore_version; | extern BOOL is_x86_64, appstore_version; | ||||||
|  | @ -62,7 +61,6 @@ static const char* notification_dont_display_setting; | ||||||
| static WNDPROC update_original_proc = NULL; | static WNDPROC update_original_proc = NULL; | ||||||
| static HWINEVENTHOOK ap_weh = NULL; | static HWINEVENTHOOK ap_weh = NULL; | ||||||
| static char title_str[2][128], button_str[128]; | static char title_str[2][128], button_str[128]; | ||||||
| static UINT_PTR uIdSubclass = 1; |  | ||||||
| HWND hFidoDlg = NULL; | HWND hFidoDlg = NULL; | ||||||
| 
 | 
 | ||||||
| static int update_settings_reposition_ids[] = { | static int update_settings_reposition_ids[] = { | ||||||
|  | @ -78,8 +76,6 @@ static int update_settings_reposition_ids[] = { | ||||||
| 	IDCANCEL, | 	IDCANCEL, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| /*
 | /*
 | ||||||
|  * https://blogs.msdn.microsoft.com/oldnewthing/20040802-00/?p=38283/
 |  * https://blogs.msdn.microsoft.com/oldnewthing/20040802-00/?p=38283/
 | ||||||
|  */ |  */ | ||||||
|  | @ -92,9 +88,10 @@ void SetDialogFocus(HWND hDlg, HWND hCtrl) | ||||||
|  * DarkMode CheckBox Subclass Proc |  * DarkMode CheckBox Subclass Proc | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| static LRESULT CALLBACK ButtonSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR idSubclass, DWORD_PTR dwRefData) | static LRESULT CALLBACK ButtonSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, | ||||||
|  | 	LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) | ||||||
| { | { | ||||||
| 	if (!IsAppsUseDarkMode()) | 	if (!IsAppsUseDarkMode) | ||||||
| 	{ | 	{ | ||||||
| 		return DefSubclassProc(hWnd, uMsg, wParam, lParam); | 		return DefSubclassProc(hWnd, uMsg, wParam, lParam); | ||||||
| 	} | 	} | ||||||
|  | @ -121,15 +118,15 @@ static LRESULT CALLBACK ButtonSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, | ||||||
| 		rc1.left += siz.cx + 2; | 		rc1.left += siz.cx + 2; | ||||||
| 		FillRect(hDc, &rc1, CreateSolidBrush(ColorControlDark)); | 		FillRect(hDc, &rc1, CreateSolidBrush(ColorControlDark)); | ||||||
| 		rc1.top += GetSystemMetrics(SM_CXPADDEDBORDER); | 		rc1.top += GetSystemMetrics(SM_CXPADDEDBORDER); | ||||||
| 		WCHAR szCaption[60]; | 		LPCWSTR* staticText[99] = {0}; | ||||||
| 		GetWindowText(hWnd, szCaption, ARRAYSIZE(szCaption)); | 		GetWindowText(hWnd, staticText, ARRAYSIZE(staticText)); | ||||||
| 		DTTOPTS opts; | 		DTTOPTS opts; | ||||||
| 		opts.dwSize = sizeof(DTTOPTS); | 		opts.dwSize = sizeof(DTTOPTS); | ||||||
| 		opts.dwFlags = DTT_TEXTCOLOR; | 		opts.dwFlags = DTT_TEXTCOLOR; | ||||||
| 		opts.crText = RGB(255, 255, 255); | 		opts.crText = RGB(255, 255, 255); | ||||||
| 		HFONT font = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0); | 		HFONT font = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0); | ||||||
| 		SelectObject(hDc, font); | 		SelectObject(hDc, font); | ||||||
| 		DrawThemeTextEx(btnTheme, hDc, 3, 0, szCaption, -1, DT_SINGLELINE | DT_LEFT, &rc1, &opts); | 		DrawThemeTextEx(btnTheme, hDc, 3, 0, &staticText, -1, DT_SINGLELINE | DT_LEFT, &rc1, &opts); | ||||||
| 		ReleaseDC(hWnd, hDc); | 		ReleaseDC(hWnd, hDc); | ||||||
| 		return TRUE; | 		return TRUE; | ||||||
| 	} | 	} | ||||||
|  | @ -143,11 +140,11 @@ static LRESULT CALLBACK ButtonSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, | ||||||
| 
 | 
 | ||||||
| static BOOL CALLBACK ThemeCallback(HWND hWnd, LPARAM lParam) | static BOOL CALLBACK ThemeCallback(HWND hWnd, LPARAM lParam) | ||||||
| { | { | ||||||
| 	WCHAR str[30] = { 0 }; | 	char* str[255]; | ||||||
| 	GetClassName(hWnd, str, ARRAYSIZE(str)); | 	GetClassName(hWnd, &str, 255); | ||||||
| 	BOOL isDarkMode = IsAppsUseDarkMode(); | 	BOOL isDarkMode = IsAppsUseDarkMode(); | ||||||
| 
 | 
 | ||||||
| 	if (_wcsicmp(str, L"Button") == 0) | 	if (strcmp(str, L"Button") == 0) | ||||||
| 	{ | 	{ | ||||||
| 		LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE); | 		LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE); | ||||||
| 		if ((style & BS_AUTOCHECKBOX) == BS_AUTOCHECKBOX) | 		if ((style & BS_AUTOCHECKBOX) == BS_AUTOCHECKBOX) | ||||||
|  | @ -164,18 +161,18 @@ static BOOL CALLBACK ThemeCallback(HWND hWnd, LPARAM lParam) | ||||||
| 		else | 		else | ||||||
| 			SetWindowTheme(hWnd, isDarkMode ? L"DarkMode_Explorer" : L"Explorer", NULL); | 			SetWindowTheme(hWnd, isDarkMode ? L"DarkMode_Explorer" : L"Explorer", NULL); | ||||||
| 	} | 	} | ||||||
| 	else if (_wcsicmp(str, L"ComboBox") == 0) | 	else if (strcmp(str, L"ComboBox") == 0) | ||||||
| 	{ | 	{ | ||||||
| 		SetWindowTheme(hWnd, isDarkMode ? L"DarkMode_CFD" : L"Explorer", NULL); | 		SetWindowTheme(hWnd, isDarkMode ? L"DarkMode_CFD" : L"Explorer", NULL); | ||||||
| 	} | 	} | ||||||
| 	else if (_wcsicmp(str, L"ToolBar") == 0) | 	else if (strcmp(str, L"ToolBar") == 0) | ||||||
| 	{ | 	{ | ||||||
| 		WCHAR title[30] = {0}; | 		char* title[16]; | ||||||
| 		GetWindowText(hWnd, title, ARRAYSIZE(title)); | 		GetWindowText(hWnd, &title, 16); | ||||||
| 		if (_wcsicmp(title, L"Multiple buttons") != 0) | 		if (strcmp(title, L"Multiple buttons") != 0) | ||||||
| 			SetWindowTheme(hWnd, isDarkMode ? L"DarkMode" : L"Explorer", NULL); | 			SetWindowTheme(hWnd, isDarkMode ? L"DarkMode" : L"Explorer", NULL); | ||||||
| 	} | 	} | ||||||
| 	else if (_wcsicmp(str, L"EDIT") == 0) | 	else if (strcmp(str, L"EDIT") == 0) | ||||||
| 	{ | 	{ | ||||||
| 		LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE); | 		LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE); | ||||||
| 		if(((style & WS_VSCROLL) == WS_VSCROLL) || ((style & WS_HSCROLL) == WS_HSCROLL)) | 		if(((style & WS_VSCROLL) == WS_VSCROLL) || ((style & WS_HSCROLL) == WS_HSCROLL)) | ||||||
|  | @ -185,7 +182,7 @@ static BOOL CALLBACK ThemeCallback(HWND hWnd, LPARAM lParam) | ||||||
| 
 | 
 | ||||||
| 		 | 		 | ||||||
| 	} | 	} | ||||||
| 	else if (_wcsicmp(str, L"RichEdit20W") == 0) | 	else if (strcmp(str, L"RichEdit20W") == 0) | ||||||
| 	{ | 	{ | ||||||
| 		SendMessage(hWnd, EM_SETBKGNDCOLOR, 0, isDarkMode ? (LPARAM)ColorControlDark : (LPARAM)GetSysColor(COLOR_BTNFACE)); | 		SendMessage(hWnd, EM_SETBKGNDCOLOR, 0, isDarkMode ? (LPARAM)ColorControlDark : (LPARAM)GetSysColor(COLOR_BTNFACE)); | ||||||
| 		CHARFORMAT cf; | 		CHARFORMAT cf; | ||||||
|  | @ -207,7 +204,8 @@ static BOOL CALLBACK ThemeCallback(HWND hWnd, LPARAM lParam) | ||||||
|  * DarkMod Dialog Subclass Proc |  * DarkMod Dialog Subclass Proc | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| static LRESULT CALLBACK DlgSubclassProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam, UINT_PTR idSubclass, DWORD_PTR dwRefData) | static LRESULT CALLBACK DlgSubclassProc(HWND hDlg, UINT message, WPARAM wParam, | ||||||
|  | 	LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) | ||||||
| { | { | ||||||
| 	if (!IsAppsUseDarkMode()) | 	if (!IsAppsUseDarkMode()) | ||||||
| 	{ | 	{ | ||||||
|  | @ -215,94 +213,9 @@ static LRESULT CALLBACK DlgSubclassProc(HWND hDlg, UINT message, WPARAM wParam, | ||||||
| 	} | 	} | ||||||
| 	switch (message) | 	switch (message) | ||||||
| 	{ | 	{ | ||||||
| 	case WM_NCPAINT: |  | ||||||
| 	{ |  | ||||||
| 		LRESULT result = DefSubclassProc(hDlg, message, wParam, lParam); |  | ||||||
| 		HDC windowDC = GetWindowDC(hDlg); |  | ||||||
| 		RECT rcWin, rcClient; |  | ||||||
| 		GetWindowRect(hDlg, &rcWin); |  | ||||||
| 		GetClientRect(hDlg, &rcClient); |  | ||||||
| 		MapWindowPoints(hDlg, NULL, (LPPOINT)&rcWin, 2); |  | ||||||
| 		int rcWinWidth = rcWin.right - rcWin.left; |  | ||||||
| 		int rcWinHieght = rcWin.bottom - rcWin.top; |  | ||||||
| 		int rcrcClientWidth = rcClient.right - rcClient.left; |  | ||||||
| 		int rcrcClientHieght = rcClient.bottom - rcClient.top; |  | ||||||
| 		int borderWidth = (rcWinWidth - rcrcClientWidth) / 2; |  | ||||||
| 		int captionHight = rcWinHieght - rcrcClientHieght - borderWidth; |  | ||||||
| 		OffsetRect(&rcWin, -rcWin.left, -rcWin.top); |  | ||||||
| 		OffsetRect(&rcClient, -rcWin.left, -rcWin.top); |  | ||||||
| 		HRGN copy = CreateRectRgn(0, 0, 0, 0); |  | ||||||
| 		HRGN updateRgn = wParam != 1 ? copy : CreateRectRgnIndirect(&rcWin); |  | ||||||
| 		HRGN clipRgn = CreateRectRgn(0, 0, 0, 0); |  | ||||||
| 		HRGN ncRgn = CreateRectRgn(0, 0, 0, 0); |  | ||||||
| 		CombineRgn(copy, copy, (HRGN)wParam, RGN_COPY); |  | ||||||
| 		if (wParam == 1) |  | ||||||
| 			clipRgn = CreateRectRgnIndirect(&rcClient); |  | ||||||
| 		else |  | ||||||
| 			GetClipRgn(windowDC, clipRgn); |  | ||||||
| 		CombineRgn(ncRgn, updateRgn, clipRgn, RGN_OR); |  | ||||||
| 		SelectClipRgn(windowDC, ncRgn); |  | ||||||
| 		FillRect(windowDC, &rcWin, CreateSolidBrush(RGB(63, 63, 63))); |  | ||||||
| 		HRGN hRgn = CreateRectRgnIndirect(&rcWin); |  | ||||||
| 		SelectClipRgn(windowDC, hRgn); |  | ||||||
| 		MakeBitmapOpaque(windowDC, 0, 0, rcWinWidth, rcWinHieght); |  | ||||||
| 		safe_release_dc(hDlg, windowDC); |  | ||||||
| 		return result; |  | ||||||
| 	} |  | ||||||
| 	case WM_NCCALCSIZE: |  | ||||||
| 	{ |  | ||||||
| 		//TODO: get real caption Size
 |  | ||||||
| 
 |  | ||||||
| 		if (wParam) |  | ||||||
| 		{ |  | ||||||
| 			NCCALCSIZE_PARAMS* ncParma = (NCCALCSIZE_PARAMS*)(lParam); |  | ||||||
| 			ncParma->rgrc[0].left += 1;//pr++;
 |  | ||||||
| 			ncParma->rgrc[0].top += 31; |  | ||||||
| 			ncParma->rgrc[0].right -= 1; |  | ||||||
| 			ncParma->rgrc[0].bottom -= 1; |  | ||||||
| 			return 0; |  | ||||||
| 		} |  | ||||||
| 		else |  | ||||||
| 		{ |  | ||||||
| 			RECT* rect = (RECT*)lParam; |  | ||||||
| 			rect->top += 31; |  | ||||||
| 			rect->left += 1; |  | ||||||
| 			rect->right -= 1; |  | ||||||
| 			rect->bottom -= 1; |  | ||||||
| 			return 0; |  | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	case WM_SHOWWINDOW: | 	case WM_SHOWWINDOW: | ||||||
| 	{ |  | ||||||
| 		if (wParam) |  | ||||||
| 		{ |  | ||||||
| 		EnumChildWindows(hDlg, ThemeCallback, lParam); | 		EnumChildWindows(hDlg, ThemeCallback, lParam); | ||||||
| 			BOOL allowncpaint = TRUE; | 		return DefWindowProc(hDlg, message, wParam, lParam); | ||||||
| 			COLORREF caption = RGB(0x0, 0x0, 0x0); |  | ||||||
| 			DwmSetWindowAttribute(hDlg, DWMWA_CAPTION_COLOR, &caption, sizeof caption); |  | ||||||
| 			DwmSetWindowAttribute(hDlg, DWMWA_BORDER_COLOR, &caption, sizeof caption); |  | ||||||
| 			DwmSetWindowAttribute(hDlg, DWMWA_ALLOW_NCPAINT, &allowncpaint, sizeof(int)); |  | ||||||
| 			RECT rcDlg; |  | ||||||
| 			GetWindowRect(hDlg, &rcDlg); |  | ||||||
| 			SetWindowPos(hDlg, 0, 0, 0, rcDlg.right - rcDlg.left, rcDlg.bottom - rcDlg.top, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE); |  | ||||||
| 
 |  | ||||||
| 			if (hLog) |  | ||||||
| 			{ |  | ||||||
| 				RECT rcLog; |  | ||||||
| 				GetWindowRect(hLog, &rcLog); |  | ||||||
| 				GetClientRect(hDlg, &rcDlg); |  | ||||||
| 				rcLog.left = rcDlg.left + 1; |  | ||||||
| 				rcLog.right = rcDlg.right - 1; |  | ||||||
| 				SetWindowPos(hLog, NULL, 0, 0, rcLog.right - rcLog.left, rcLog.bottom - rcLog.top, SWP_NOMOVE | SWP_NOZORDER); |  | ||||||
| 			} |  | ||||||
| 			RedrawWindow(hDlg, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW | RDW_INVALIDATE | RDW_FRAME | RDW_ERASENOW); |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		return DefSubclassProc(hDlg, message, wParam, lParam); |  | ||||||
| 
 |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	case WM_CTLCOLORLISTBOX: | 	case WM_CTLCOLORLISTBOX: | ||||||
| 		SetBkColor((HDC)wParam, RGB(25, 25, 25)); | 		SetBkColor((HDC)wParam, RGB(25, 25, 25)); | ||||||
| 		SetTextColor((HDC)wParam, RGB(255, 255, 255)); | 		SetTextColor((HDC)wParam, RGB(255, 255, 255)); | ||||||
|  | @ -315,7 +228,6 @@ static LRESULT CALLBACK DlgSubclassProc(HWND hDlg, UINT message, WPARAM wParam, | ||||||
| 		return (INT_PTR)CreateSolidBrush(RGB(25, 25, 25)); | 		return (INT_PTR)CreateSolidBrush(RGB(25, 25, 25)); | ||||||
| 
 | 
 | ||||||
| 	} | 	} | ||||||
| 
 |  | ||||||
| 	case WM_CTLCOLORBTN: | 	case WM_CTLCOLORBTN: | ||||||
| 	case WM_CTLCOLORDLG: | 	case WM_CTLCOLORDLG: | ||||||
| 		return (INT_PTR)CreateSolidBrush(ColorControlDark); | 		return (INT_PTR)CreateSolidBrush(ColorControlDark); | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								src/ui.h
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								src/ui.h
									
										
									
									
									
								
							|  | @ -116,4 +116,4 @@ extern void ShowLanguageMenu(RECT rcExclude); | ||||||
| extern void SetPassesTooltip(void); | extern void SetPassesTooltip(void); | ||||||
| extern void SetBootTypeDropdownWidth(void); | extern void SetBootTypeDropdownWidth(void); | ||||||
| extern void OnPaint(HDC hdc); | extern void OnPaint(HDC hdc); | ||||||
| extern void MakeBitmapOpaque(HDC hdc, int x, int y, int cx, int cy); | static UINT_PTR uIdSubclass = 1; | ||||||
|  |  | ||||||
|  | @ -20,10 +20,6 @@ | ||||||
| #include <windows.h> | #include <windows.h> | ||||||
| #include "resource.h" | #include "resource.h" | ||||||
| 
 | 
 | ||||||
|  // disable all warnings about unused variable
 |  | ||||||
| #ifdef __GNUC__ |  | ||||||
| #pragma GCC diagnostic ignored "-Wunused-variable" |  | ||||||
| #endif  |  | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| // GUIDs needed to set a control's accessibility props
 | // GUIDs needed to set a control's accessibility props
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue