diff options
| -rw-r--r-- | src/thmviewer/display.cpp | 13 | ||||
| -rw-r--r-- | src/thmviewer/packages.config | 2 | ||||
| -rw-r--r-- | src/thmviewer/thmviewer.cpp | 14 | ||||
| -rw-r--r-- | src/thmviewer/thmviewer.manifest | 8 | ||||
| -rw-r--r-- | src/thmviewer/thmviewer.vcxproj | 4 |
5 files changed, 25 insertions, 16 deletions
diff --git a/src/thmviewer/display.cpp b/src/thmviewer/display.cpp index cfd1c6b7..52fa3cf8 100644 --- a/src/thmviewer/display.cpp +++ b/src/thmviewer/display.cpp | |||
| @@ -110,8 +110,8 @@ static DWORD WINAPI DisplayThreadProc( | |||
| 110 | y = rc.bottom + 20; | 110 | y = rc.bottom + 20; |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | hWnd = ::CreateWindowExW(0, wc.lpszClassName, pTheme->sczCaption, pTheme->dwStyle, x, y, pTheme->nWidth, pTheme->nHeight, hwndParent, NULL, hInstance, pCurrentHandle); | 113 | hr = ThemeCreateParentWindow(pTheme, 0, wc.lpszClassName, pTheme->sczCaption, pTheme->dwStyle, x, y, hwndParent, hInstance, pCurrentHandle, THEME_WINDOW_INITIAL_POSITION_DEFAULT, &hWnd); |
| 114 | ExitOnNullWithLastError(hWnd, hr, "Failed to create display window."); | 114 | ExitOnFailure(hr, "Failed to create display window."); |
| 115 | 115 | ||
| 116 | fCreateIfNecessary = FALSE; | 116 | fCreateIfNecessary = FALSE; |
| 117 | } | 117 | } |
| @@ -263,9 +263,10 @@ static LRESULT CALLBACK DisplayWndProc( | |||
| 263 | { | 263 | { |
| 264 | case WM_NCCREATE: | 264 | case WM_NCCREATE: |
| 265 | { | 265 | { |
| 266 | LPCREATESTRUCT lpcs = reinterpret_cast<LPCREATESTRUCT>(lParam); | 266 | LPCREATESTRUCT lpcs = reinterpret_cast<LPCREATESTRUCT>(lParam); |
| 267 | IncrementHandleTheme(reinterpret_cast<HANDLE_THEME*>(lpcs->lpCreateParams)); | 267 | pHandleTheme = reinterpret_cast<HANDLE_THEME*>(lpcs->lpCreateParams); |
| 268 | ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(lpcs->lpCreateParams)); | 268 | IncrementHandleTheme(pHandleTheme); |
| 269 | ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(pHandleTheme)); | ||
| 269 | } | 270 | } |
| 270 | break; | 271 | break; |
| 271 | 272 | ||
| @@ -328,7 +329,7 @@ static BOOL DisplayOnCreate( | |||
| 328 | { | 329 | { |
| 329 | HRESULT hr = S_OK; | 330 | HRESULT hr = S_OK; |
| 330 | 331 | ||
| 331 | hr = ThemeLoadControls(pTheme, hWnd, NULL, 0); | 332 | hr = ThemeLoadControls(pTheme, NULL, 0); |
| 332 | ExitOnFailure(hr, "Failed to load theme controls"); | 333 | ExitOnFailure(hr, "Failed to load theme controls"); |
| 333 | 334 | ||
| 334 | // Pre-populate some control types with data. | 335 | // Pre-populate some control types with data. |
diff --git a/src/thmviewer/packages.config b/src/thmviewer/packages.config index f3abcd35..49f06de8 100644 --- a/src/thmviewer/packages.config +++ b/src/thmviewer/packages.config | |||
| @@ -4,5 +4,5 @@ | |||
| 4 | <package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="native" developmentDependency="true" /> | 4 | <package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="native" developmentDependency="true" /> |
| 5 | <package id="Microsoft.SourceLink.GitHub" version="1.0.0" targetFramework="native" developmentDependency="true" /> | 5 | <package id="Microsoft.SourceLink.GitHub" version="1.0.0" targetFramework="native" developmentDependency="true" /> |
| 6 | <package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" /> | 6 | <package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" /> |
| 7 | <package id="WixToolset.DUtil" version="4.0.30" targetFramework="native" /> | 7 | <package id="WixToolset.DUtil" version="4.0.40" targetFramework="native" /> |
| 8 | </packages> \ No newline at end of file | 8 | </packages> \ No newline at end of file |
diff --git a/src/thmviewer/thmviewer.cpp b/src/thmviewer/thmviewer.cpp index adad3f50..f83182d3 100644 --- a/src/thmviewer/thmviewer.cpp +++ b/src/thmviewer/thmviewer.cpp | |||
| @@ -100,8 +100,8 @@ int WINAPI wWinMain( | |||
| 100 | hr = CreateMainWindowClass(hInstance, vpTheme, &atom); | 100 | hr = CreateMainWindowClass(hInstance, vpTheme, &atom); |
| 101 | ExitOnFailure(hr, "Failed to create main window."); | 101 | ExitOnFailure(hr, "Failed to create main window."); |
| 102 | 102 | ||
| 103 | hWnd = ::CreateWindowExW(0, reinterpret_cast<LPCWSTR>(atom), vpTheme->sczCaption, vpTheme->dwStyle, CW_USEDEFAULT, CW_USEDEFAULT, vpTheme->nWidth, vpTheme->nHeight, HWND_DESKTOP, NULL, hInstance, NULL); | 103 | hr = ThemeCreateParentWindow(vpTheme, 0, reinterpret_cast<LPCWSTR>(atom), vpTheme->sczCaption, vpTheme->dwStyle, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, hInstance, NULL, THEME_WINDOW_INITIAL_POSITION_DEFAULT, &hWnd); |
| 104 | ExitOnNullWithLastError(hWnd, hr, "Failed to create window."); | 104 | ExitOnFailure(hr, "Failed to create window."); |
| 105 | 105 | ||
| 106 | if (!sczThemeFile) | 106 | if (!sczThemeFile) |
| 107 | { | 107 | { |
| @@ -353,11 +353,11 @@ static LRESULT CALLBACK MainWndProc( | |||
| 353 | 353 | ||
| 354 | case WM_CREATE: | 354 | case WM_CREATE: |
| 355 | { | 355 | { |
| 356 | HRESULT hr = ThemeLoadControls(vpTheme, hWnd, vrgInitControls, countof(vrgInitControls)); | 356 | HRESULT hr = ThemeLoadControls(vpTheme, vrgInitControls, countof(vrgInitControls)); |
| 357 | if (FAILED(hr)) | 357 | if (FAILED(hr)) |
| 358 | { | 358 | { |
| 359 | return -1; | 359 | return -1; |
| 360 | } | 360 | } |
| 361 | } | 361 | } |
| 362 | break; | 362 | break; |
| 363 | 363 | ||
diff --git a/src/thmviewer/thmviewer.manifest b/src/thmviewer/thmviewer.manifest index 6bd63a5e..4663b61c 100644 --- a/src/thmviewer/thmviewer.manifest +++ b/src/thmviewer/thmviewer.manifest | |||
| @@ -7,5 +7,13 @@ | |||
| 7 | <description>WiX Toolset Theme Viewer</description> | 7 | <description>WiX Toolset Theme Viewer</description> |
| 8 | <dependency><dependentAssembly><assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /></dependentAssembly></dependency> | 8 | <dependency><dependentAssembly><assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /></dependentAssembly></dependency> |
| 9 | <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"><application><supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/><supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/></application></compatibility> | 9 | <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"><application><supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/><supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/></application></compatibility> |
| 10 | <application xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
| 11 | <windowsSettings xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
| 12 | <!-- pre-Win10 1607 --> | ||
| 13 | <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware> | ||
| 14 | <!-- Win10 picks the first one it recognizes --> | ||
| 15 | <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor, System</dpiAwareness> | ||
| 16 | </windowsSettings> | ||
| 17 | </application> | ||
| 10 | <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"><security><requestedPrivileges><requestedExecutionLevel level="asInvoker" uiAccess="false"/></requestedPrivileges></security></trustInfo> | 18 | <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"><security><requestedPrivileges><requestedExecutionLevel level="asInvoker" uiAccess="false"/></requestedPrivileges></security></trustInfo> |
| 11 | </assembly> | 19 | </assembly> |
diff --git a/src/thmviewer/thmviewer.vcxproj b/src/thmviewer/thmviewer.vcxproj index fb9908e6..a56a0bd4 100644 --- a/src/thmviewer/thmviewer.vcxproj +++ b/src/thmviewer/thmviewer.vcxproj | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | <Import Project="..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" /> | 5 | <Import Project="..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" /> |
| 6 | <Import Project="..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" /> | 6 | <Import Project="..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" /> |
| 7 | <Import Project="..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props" Condition="Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" /> | 7 | <Import Project="..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props" Condition="Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" /> |
| 8 | <Import Project="..\..\packages\WixToolset.DUtil.4.0.30\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.30\build\WixToolset.DUtil.props')" /> | 8 | <Import Project="..\..\packages\WixToolset.DUtil.4.0.40\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.40\build\WixToolset.DUtil.props')" /> |
| 9 | 9 | ||
| 10 | <ItemGroup Label="ProjectConfigurations"> | 10 | <ItemGroup Label="ProjectConfigurations"> |
| 11 | <ProjectConfiguration Include="Debug|Win32"> | 11 | <ProjectConfiguration Include="Debug|Win32"> |
| @@ -83,6 +83,6 @@ | |||
| 83 | <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props'))" /> | 83 | <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props'))" /> |
| 84 | <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets'))" /> | 84 | <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets'))" /> |
| 85 | <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" /> | 85 | <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" /> |
| 86 | <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.30\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.30\build\WixToolset.DUtil.props'))" /> | 86 | <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.40\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.40\build\WixToolset.DUtil.props'))" /> |
| 87 | </Target> | 87 | </Target> |
| 88 | </Project> \ No newline at end of file | 88 | </Project> \ No newline at end of file |
