Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/user32/mdi.c | 5 +---- dlls/user32/uitools.c | 11 +++-------- 2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/dlls/user32/mdi.c b/dlls/user32/mdi.c index 10a38824ad..ada89bc0c6 100644 --- a/dlls/user32/mdi.c +++ b/dlls/user32/mdi.c @@ -865,7 +865,6 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild ) { HDC hMemDC; HBITMAP hBitmap, hOldBitmap; - HBRUSH hBrush; HDC hdc = GetDC(hChild);
if (hdc) @@ -877,10 +876,8 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild ) hBitmap = CreateCompatibleBitmap(hdc, cx, cy); hOldBitmap = SelectObject(hMemDC, hBitmap); SetMapMode(hMemDC, MM_TEXT); - hBrush = CreateSolidBrush(GetSysColor(COLOR_MENU)); - DrawIconEx(hMemDC, 0, 0, hIcon, cx, cy, 0, hBrush, DI_NORMAL); + DrawIconEx(hMemDC, 0, 0, hIcon, cx, cy, 0, GetSysColorBrush(COLOR_MENU), DI_NORMAL); SelectObject (hMemDC, hOldBitmap); - DeleteObject(hBrush); DeleteDC(hMemDC); ReleaseDC(hChild, hdc); hSysMenuBitmap = hBitmap; diff --git a/dlls/user32/uitools.c b/dlls/user32/uitools.c index 73ec34bff1..8657f27869 100644 --- a/dlls/user32/uitools.c +++ b/dlls/user32/uitools.c @@ -1693,26 +1693,22 @@ static BOOL UITOOLS_DrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC func, LPARAM lp }
if (flags & DSS_DISABLED) - hbrtmp = CreateSolidBrush(GetSysColor(COLOR_3DHILIGHT)); + hbrtmp = GetSysColorBrush(COLOR_3DHILIGHT); else if (flags & DSS_DEFAULT) - hbrtmp = CreateSolidBrush(GetSysColor(COLOR_3DSHADOW)); + hbrtmp = GetSysColorBrush(COLOR_3DSHADOW);
/* Draw light or dark shadow */ if (flags & (DSS_DISABLED|DSS_DEFAULT)) { - if(!hbrtmp) goto cleanup; hbsave = SelectObject(hdc, hbrtmp); if(!hbsave) goto cleanup; if(!BitBlt(hdc, x+1, y+1, cx, cy, memdc, 0, 0, 0x00B8074A)) goto cleanup; SelectObject(hdc, hbsave); - DeleteObject(hbrtmp); - hbrtmp = 0; }
if (flags & DSS_DISABLED) { - hbr = hbrtmp = CreateSolidBrush(GetSysColor(COLOR_3DSHADOW)); - if(!hbrtmp) goto cleanup; + hbr = GetSysColorBrush(COLOR_3DSHADOW); } else if (!hbr) { @@ -1731,7 +1727,6 @@ cleanup:
if(hbsave) SelectObject(hdc, hbsave); if(hbmsave) SelectObject(memdc, hbmsave); - if(hbrtmp) DeleteObject(hbrtmp); if(hbm) DeleteObject(hbm); if(memdc) DeleteDC(memdc);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- programs/wordpad/print.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/programs/wordpad/print.c b/programs/wordpad/print.c index d34fd66edc..acc583eefc 100644 --- a/programs/wordpad/print.c +++ b/programs/wordpad/print.c @@ -376,10 +376,9 @@ static void paint_ruler(HWND hWnd, LONG EditLeftmost, BOOL NewMetrics) HDC hdcPrint = make_dc(); RECT printRect = get_print_rect(hdcPrint); RECT drawRect; - HBRUSH hBrush = CreateSolidBrush(GetSysColor(COLOR_MENU));
GetClientRect(hWnd, &drawRect); - FillRect(hdc, &drawRect, hBrush); + FillRect(hdc, &drawRect, GetSysColorBrush(COLOR_MENU));
InflateRect(&drawRect, 0, -3); drawRect.left = EditLeftmost; @@ -399,7 +398,6 @@ static void paint_ruler(HWND hWnd, LONG EditLeftmost, BOOL NewMetrics) add_ruler_units(hdc, &drawRect, NewMetrics, EditLeftmost);
SelectObject(hdc, GetStockObject(BLACK_BRUSH)); - DeleteObject(hBrush); DeleteDC(hdcPrint); EndPaint(hWnd, &ps); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=51131
Your paranoid android.
=== debian9 (32 bit report) ===
user32: msg.c:8713: Test failed: WaitForSingleObject failed 102 msg.c:8719: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8719: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8719: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
=== debian9 (64 bit WoW report) ===
user32: win.c:10127: Test failed: Expected foreground window 0, got 0000000000D20050 win.c:10133: Test failed: Expected foreground window 00000000000E0120, got 0000000000D20050 win.c:10169: Test failed: Expected foreground window 00000000000E0120, got 0000000000D20050 win.c:10171: Test failed: GetActiveWindow() = 0000000000000000 win.c:10171: Test failed: GetFocus() = 0000000000000000 win.c:10172: Test failed: Received WM_ACTIVATEAPP(1), did not expect it.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- programs/regedit/hexedit.c | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-)
diff --git a/programs/regedit/hexedit.c b/programs/regedit/hexedit.c index db48c80099..951779bf24 100644 --- a/programs/regedit/hexedit.c +++ b/programs/regedit/hexedit.c @@ -340,34 +340,6 @@ HexEdit_Destroy (HEXEDIT_INFO *infoPtr) return 0; }
- -static inline LRESULT -HexEdit_EraseBackground (HEXEDIT_INFO *infoPtr, HDC hdc) -{ - HBRUSH hBrush, hSolidBrush = NULL; - RECT rc; - - if (GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & WS_DISABLED) - hBrush = hSolidBrush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE)); - else - { - hBrush = (HBRUSH)SendMessageW(GetParent(infoPtr->hwndSelf), WM_CTLCOLOREDIT, - (WPARAM)hdc, (LPARAM)infoPtr->hwndSelf); - if (!hBrush) - hBrush = hSolidBrush = CreateSolidBrush(GetSysColor(COLOR_WINDOW)); - } - - GetClientRect (infoPtr->hwndSelf, &rc); - - FillRect (hdc, &rc, hBrush); - - if (hSolidBrush) - DeleteObject(hSolidBrush); - - return -1; -} - - static inline LRESULT HexEdit_GetFont (HEXEDIT_INFO *infoPtr) { @@ -625,9 +597,6 @@ HexEdit_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_DESTROY: return HexEdit_Destroy (infoPtr);
- case WM_ERASEBKGND: - return HexEdit_EraseBackground (infoPtr, (HDC)wParam); - case WM_GETDLGCODE: return DLGC_WANTCHARS | DLGC_WANTARROWS;
@@ -675,7 +644,7 @@ void HexEdit_Register(void) wndClass.cbClsExtra = 0; wndClass.cbWndExtra = sizeof(HEXEDIT_INFO *); wndClass.hCursor = NULL; - wndClass.hbrBackground = NULL; + wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wndClass.lpszClassName = szHexEditClass;
RegisterClassW(&wndClass);