aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-10-31 14:22:40 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-11-01 16:34:09 -0500
commit956c6bc4011618a05d4cff3992df687530a26e67 (patch)
tree6ff5051b80b1375949b78bbbb5797b6d8a05c608 /src
parent7e60078d4a7fe748a39c135def9e84a2421ab474 (diff)
downloadwix-956c6bc4011618a05d4cff3992df687530a26e67.tar.gz
wix-956c6bc4011618a05d4cff3992df687530a26e67.tar.bz2
wix-956c6bc4011618a05d4cff3992df687530a26e67.zip
Use DefDlgProc in thmutil.
#5927
Diffstat (limited to 'src')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/thmutil.cpp34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp
index 9adc2ddd..74c1a8b0 100644
--- a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp
+++ b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp
@@ -502,7 +502,8 @@ static LRESULT CALLBACK ControlGroupDefWindowProc(
502 __in HWND hWnd, 502 __in HWND hWnd,
503 __in UINT uMsg, 503 __in UINT uMsg,
504 __in WPARAM wParam, 504 __in WPARAM wParam,
505 __in LPARAM lParam 505 __in LPARAM lParam,
506 __in BOOL fDialog
506 ); 507 );
507static LRESULT CALLBACK PanelWndProc( 508static LRESULT CALLBACK PanelWndProc(
508 __in HWND hWnd, 509 __in HWND hWnd,
@@ -837,6 +838,7 @@ DAPI_(void) ThemeInitializeWindowClass(
837 ) 838 )
838{ 839{
839 pWndClass->style = CS_HREDRAW | CS_VREDRAW; 840 pWndClass->style = CS_HREDRAW | CS_VREDRAW;
841 pWndClass->cbWndExtra = DLGWINDOWEXTRA;
840 pWndClass->hCursor = ::LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); 842 pWndClass->hCursor = ::LoadCursorW(NULL, (LPCWSTR)IDC_ARROW);
841 843
842 pWndClass->lpfnWndProc = pfnWndProc; 844 pWndClass->lpfnWndProc = pfnWndProc;
@@ -1120,7 +1122,7 @@ extern "C" LRESULT CALLBACK ThemeDefWindowProc(
1120 } 1122 }
1121 } 1123 }
1122 1124
1123 return ControlGroupDefWindowProc(pTheme, hWnd, uMsg, wParam, lParam); 1125 return ControlGroupDefWindowProc(pTheme, hWnd, uMsg, wParam, lParam, TRUE);
1124} 1126}
1125 1127
1126 1128
@@ -1703,7 +1705,7 @@ DAPI_(void) ThemeSetFocus(
1703 1705
1704 if (hwndFocus) 1706 if (hwndFocus)
1705 { 1707 {
1706 ::SetFocus(hwndFocus); 1708 ::SendMessage(pThemeControl->pTheme->hwndParent, WM_NEXTDLGCTL, (WPARAM)hwndFocus, TRUE);
1707 } 1709 }
1708 } 1710 }
1709} 1711}
@@ -5304,7 +5306,7 @@ static BOOL OnNotifyEnMsgFilter(
5304 { 5306 {
5305 BOOL fShift = 0x8000 & ::GetKeyState(VK_SHIFT); 5307 BOOL fShift = 0x8000 & ::GetKeyState(VK_SHIFT);
5306 HWND hwndFocus = ::GetNextDlgTabItem(pTheme->hwndParent, pThemeControl->hWnd, fShift); 5308 HWND hwndFocus = ::GetNextDlgTabItem(pTheme->hwndParent, pThemeControl->hWnd, fShift);
5307 ::SetFocus(hwndFocus); 5309 ::SendMessage(pTheme->hwndParent, WM_NEXTDLGCTL, (WPARAM)hwndFocus, TRUE);
5308 5310
5309 fProcessed = TRUE; 5311 fProcessed = TRUE;
5310 } 5312 }
@@ -5493,6 +5495,11 @@ static HRESULT SizeListViewColumns(
5493 int iExtraAvailableSize; 5495 int iExtraAvailableSize;
5494 THEME_COLUMN* pColumn = NULL; 5496 THEME_COLUMN* pColumn = NULL;
5495 5497
5498 if (!pControl->hWnd)
5499 {
5500 ExitFunction();
5501 }
5502
5496 if (!::GetWindowRect(pControl->hWnd, &rcParent)) 5503 if (!::GetWindowRect(pControl->hWnd, &rcParent))
5497 { 5504 {
5498 ThmExitWithLastError(hr, "Failed to get window rect of listview control."); 5505 ThmExitWithLastError(hr, "Failed to get window rect of listview control.");
@@ -5548,7 +5555,7 @@ static HRESULT ShowControl(
5548{ 5555{
5549 HRESULT hr = S_OK; 5556 HRESULT hr = S_OK;
5550 DWORD iPageControl = 0; 5557 DWORD iPageControl = 0;
5551 HWND hwndFocus = NULL; 5558 HWND hwndFocus = phwndFocus ? *phwndFocus : NULL;
5552 LPWSTR sczFormatString = NULL; 5559 LPWSTR sczFormatString = NULL;
5553 LPWSTR sczText = NULL; 5560 LPWSTR sczText = NULL;
5554 THEME_SAVEDVARIABLE* pSavedVariable = NULL; 5561 THEME_SAVEDVARIABLE* pSavedVariable = NULL;
@@ -5851,7 +5858,7 @@ static HRESULT ShowControls(
5851 5858
5852 if (hwndFocus) 5859 if (hwndFocus)
5853 { 5860 {
5854 ::SetFocus(hwndFocus); 5861 ::SendMessage(pTheme->hwndParent, WM_NEXTDLGCTL, (WPARAM)hwndFocus, TRUE);
5855 } 5862 }
5856 5863
5857LExit: 5864LExit:
@@ -5864,7 +5871,8 @@ static LRESULT CALLBACK ControlGroupDefWindowProc(
5864 __in HWND hWnd, 5871 __in HWND hWnd,
5865 __in UINT uMsg, 5872 __in UINT uMsg,
5866 __in WPARAM wParam, 5873 __in WPARAM wParam,
5867 __in LPARAM lParam 5874 __in LPARAM lParam,
5875 __in BOOL fDialog
5868 ) 5876 )
5869{ 5877{
5870 LRESULT lres = 0; 5878 LRESULT lres = 0;
@@ -5879,6 +5887,9 @@ static LRESULT CALLBACK ControlGroupDefWindowProc(
5879 return TRUE; 5887 return TRUE;
5880 5888
5881 case WM_CTLCOLORBTN: __fallthrough; 5889 case WM_CTLCOLORBTN: __fallthrough;
5890 case WM_CTLCOLOREDIT: __fallthrough;
5891 case WM_CTLCOLORLISTBOX: __fallthrough;
5892 case WM_CTLCOLORSCROLLBAR: __fallthrough;
5882 case WM_CTLCOLORSTATIC: 5893 case WM_CTLCOLORSTATIC:
5883 { 5894 {
5884 HBRUSH hBrush = NULL; 5895 HBRUSH hBrush = NULL;
@@ -5935,10 +5946,15 @@ static LRESULT CALLBACK ControlGroupDefWindowProc(
5935 } 5946 }
5936 } 5947 }
5937 break; 5948 break;
5949
5950 case WM_CLOSE: __fallthrough;
5951 case WM_ERASEBKGND:
5952 fDialog = FALSE;
5953 break;
5938 } 5954 }
5939 } 5955 }
5940 5956
5941 return ::DefWindowProcW(hWnd, uMsg, wParam, lParam); 5957 return fDialog ? ::DefDlgProcW(hWnd, uMsg, wParam, lParam) : ::DefWindowProcW(hWnd, uMsg, wParam, lParam);
5942} 5958}
5943 5959
5944 5960
@@ -5979,7 +5995,7 @@ static LRESULT CALLBACK PanelWndProc(
5979 break; 5995 break;
5980 } 5996 }
5981 5997
5982 return ControlGroupDefWindowProc(pControl ? pControl->pTheme : NULL, hWnd, uMsg, wParam, lParam); 5998 return ControlGroupDefWindowProc(pControl ? pControl->pTheme : NULL, hWnd, uMsg, wParam, lParam, FALSE);
5983} 5999}
5984 6000
5985static LRESULT CALLBACK StaticOwnerDrawWndProc( 6001static LRESULT CALLBACK StaticOwnerDrawWndProc(