From c89da9713978ca858b1c564e469fa04af07b282d Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Mon, 5 Apr 2004 19:54:11 +0000 Subject: [PATCH] - Get the WS_EX_STATICEDGE style working. - Remove a WS_EX_STATICEDGE hack from Explorer. svn path=/trunk/; revision=8977 --- reactos/lib/user32/windows/nonclient.c | 24 +++++++++++++++++-- .../system/explorer/taskbar/traynotify.cpp | 14 ----------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/reactos/lib/user32/windows/nonclient.c b/reactos/lib/user32/windows/nonclient.c index 6ee6d0de02b..0cfdbeb0d63 100644 --- a/reactos/lib/user32/windows/nonclient.c +++ b/reactos/lib/user32/windows/nonclient.c @@ -314,7 +314,19 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn) } else if (ExStyle & WS_EX_STATICEDGE) { +#if 0 DrawEdge(hDC, &CurrentRect, BDR_SUNKENINNER, BF_RECT | BF_ADJUST | BF_FLAT); +#else + SelectObject(hDC, GetSysColorBrush(COLOR_BTNSHADOW)); + PatBlt(hDC, CurrentRect.left, CurrentRect.top, CurrentRect.right - CurrentRect.left, 1, PATCOPY); + PatBlt(hDC, CurrentRect.left, CurrentRect.top, 1, CurrentRect.bottom - CurrentRect.top, PATCOPY); + + SelectObject(hDC, GetSysColorBrush(COLOR_BTNHIGHLIGHT)); + PatBlt(hDC, CurrentRect.left, CurrentRect.bottom - 1, CurrentRect.right - CurrentRect.left, 1, PATCOPY); + PatBlt(hDC, CurrentRect.right - 1, CurrentRect.top, 1, CurrentRect.bottom - CurrentRect.top, PATCOPY); + + InflateRect(&CurrentRect, -1, -1); +#endif } /* Firstly the "thick" frame */ @@ -508,8 +520,16 @@ DefWndNCCalcSize(HWND hWnd, BOOL CalcSizeStruct, RECT *Rect) { HMENU menu = GetMenu(hWnd); - UserGetWindowBorders(Style, ExStyle, &WindowBorders, FALSE); - InflateRect(Rect, -WindowBorders.cx, -WindowBorders.cy); + if (UserHasWindowEdge(Style, ExStyle)) + { + UserGetWindowBorders(Style, ExStyle, &WindowBorders, FALSE); + InflateRect(Rect, -WindowBorders.cx, -WindowBorders.cy); + } else + if (ExStyle & WS_EX_STATICEDGE) + { + InflateRect(Rect, -1, -1); + } + if ((Style & WS_CAPTION) == WS_CAPTION) { if (ExStyle & WS_EX_TOOLWINDOW) diff --git a/reactos/subsys/system/explorer/taskbar/traynotify.cpp b/reactos/subsys/system/explorer/taskbar/traynotify.cpp index d19a1fcec94..a97ddcd2ccd 100644 --- a/reactos/subsys/system/explorer/taskbar/traynotify.cpp +++ b/reactos/subsys/system/explorer/taskbar/traynotify.cpp @@ -328,15 +328,9 @@ HWND NotifyArea::Create(HWND hwndParent) ClientRect clnt(hwndParent); -#ifndef _ROS_ return Window::Create(WINDOW_CREATOR(NotifyArea), WS_EX_STATICEDGE, wcTrayNotify, TITLE_TRAYNOTIFY, WS_CHILD|WS_VISIBLE, clnt.right-(NOTIFYAREA_WIDTH_DEF+1), 1, NOTIFYAREA_WIDTH_DEF, clnt.bottom-2, hwndParent); -#else - return Window::Create(WINDOW_CREATOR(NotifyArea), 0, - wcTrayNotify, TITLE_TRAYNOTIFY, WS_CHILD|WS_VISIBLE, - clnt.right-(NOTIFYAREA_WIDTH_DEF+1), 1, NOTIFYAREA_WIDTH_DEF, clnt.bottom-2, hwndParent); -#endif } LRESULT NotifyArea::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) @@ -604,10 +598,6 @@ void NotifyArea::Paint() // first fill with the background color FillRect(canvas, &canvas.rcPaint, GetSysColorBrush(COLOR_BTNFACE)); -#ifdef _ROS_ - DrawEdge(canvas, ClientRect(_hwnd), BDR_SUNKENOUTER, BF_RECT); -#endif - // draw icons int x = 2; int y = 3; @@ -1210,10 +1200,6 @@ void ClockWindow::Paint() { PaintCanvas canvas(_hwnd); -#ifdef _ROS_ - DrawEdge(canvas, ClientRect(_hwnd), BDR_SUNKENOUTER, BF_TOP|BF_RIGHT); -#endif - BkMode bkmode(canvas, TRANSPARENT); FontSelection font(canvas, GetStockFont(ANSI_VAR_FONT));