Commit 31fab670 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

comctl32/edit: Call GetWindowTheme() only when necessary.

parent 79516685
...@@ -4597,7 +4597,6 @@ static LRESULT EDIT_WM_NCDestroy(EDITSTATE *es) ...@@ -4597,7 +4597,6 @@ static LRESULT EDIT_WM_NCDestroy(EDITSTATE *es)
static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
EDITSTATE *es = (EDITSTATE *)GetWindowLongPtrW(hwnd, 0); EDITSTATE *es = (EDITSTATE *)GetWindowLongPtrW(hwnd, 0);
HTHEME theme = GetWindowTheme(hwnd);
LRESULT result = 0; LRESULT result = 0;
RECT *rect; RECT *rect;
...@@ -4905,7 +4904,7 @@ static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR ...@@ -4905,7 +4904,7 @@ static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
case WM_ENABLE: case WM_ENABLE:
es->bEnableState = (BOOL) wParam; es->bEnableState = (BOOL) wParam;
EDIT_UpdateText(es, NULL, TRUE); EDIT_UpdateText(es, NULL, TRUE);
if (theme) if (GetWindowTheme(hwnd))
RedrawWindow(hwnd, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW); RedrawWindow(hwnd, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
break; break;
...@@ -4935,7 +4934,7 @@ static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR ...@@ -4935,7 +4934,7 @@ static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
break; break;
case WM_KILLFOCUS: case WM_KILLFOCUS:
result = EDIT_WM_KillFocus(theme, es); result = EDIT_WM_KillFocus(GetWindowTheme(hwnd), es);
break; break;
case WM_LBUTTONDBLCLK: case WM_LBUTTONDBLCLK:
...@@ -4972,7 +4971,7 @@ static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR ...@@ -4972,7 +4971,7 @@ static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
break; break;
case WM_SETFOCUS: case WM_SETFOCUS:
EDIT_WM_SetFocus(theme, es); EDIT_WM_SetFocus(GetWindowTheme(hwnd), es);
break; break;
case WM_SETFONT: case WM_SETFONT:
...@@ -5096,7 +5095,7 @@ static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR ...@@ -5096,7 +5095,7 @@ static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
break; break;
case WM_THEMECHANGED: case WM_THEMECHANGED:
CloseThemeData (theme); CloseThemeData(GetWindowTheme(hwnd));
OpenThemeData(hwnd, WC_EDITW); OpenThemeData(hwnd, WC_EDITW);
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment