mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:23:05 +00:00
Correctly draw the titlebar as active or inactive during the processing of WM_NCACTIVATE message.
svn path=/trunk/; revision=14248
This commit is contained in:
parent
2315100314
commit
fd19aa00e6
3 changed files with 20 additions and 18 deletions
|
@ -31,7 +31,7 @@
|
||||||
#define WM_QUERYDROPOBJECT 0x022B
|
#define WM_QUERYDROPOBJECT 0x022B
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LRESULT DefWndNCPaint(HWND hWnd, HRGN hRgn);
|
LRESULT DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active);
|
||||||
LRESULT DefWndNCCalcSize(HWND hWnd, BOOL CalcSizeStruct, RECT *Rect);
|
LRESULT DefWndNCCalcSize(HWND hWnd, BOOL CalcSizeStruct, RECT *Rect);
|
||||||
LRESULT DefWndNCActivate(HWND hWnd, WPARAM wParam);
|
LRESULT DefWndNCActivate(HWND hWnd, WPARAM wParam);
|
||||||
LRESULT DefWndNCHitTest(HWND hWnd, POINT Point);
|
LRESULT DefWndNCHitTest(HWND hWnd, POINT Point);
|
||||||
|
@ -949,7 +949,7 @@ User32DefWindowProc(HWND hWnd,
|
||||||
{
|
{
|
||||||
case WM_NCPAINT:
|
case WM_NCPAINT:
|
||||||
{
|
{
|
||||||
return DefWndNCPaint(hWnd, (HRGN)wParam);
|
return DefWndNCPaint(hWnd, (HRGN)wParam, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_NCCALCSIZE:
|
case WM_NCCALCSIZE:
|
||||||
|
@ -1472,7 +1472,7 @@ DefWindowProcA(HWND hWnd,
|
||||||
|
|
||||||
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
|
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
|
||||||
{
|
{
|
||||||
DefWndNCPaint(hWnd, (HRGN)1);
|
DefWndNCPaint(hWnd, (HRGN)1, -1);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1532,7 +1532,7 @@ DefWindowProcW(HWND hWnd,
|
||||||
|
|
||||||
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
|
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
|
||||||
{
|
{
|
||||||
DefWndNCPaint(hWnd, (HRGN)1);
|
DefWndNCPaint(hWnd, (HRGN)1, -1);
|
||||||
}
|
}
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -288,10 +288,9 @@ UserDrawCaptionButtonWnd(HWND hWnd, HDC hDC, BOOL bDown, ULONG Type)
|
||||||
* - Correct drawing of size-box
|
* - Correct drawing of size-box
|
||||||
*/
|
*/
|
||||||
LRESULT
|
LRESULT
|
||||||
DefWndNCPaint(HWND hWnd, HRGN hRgn)
|
DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active)
|
||||||
{
|
{
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
BOOL Active;
|
|
||||||
DWORD Style, ExStyle;
|
DWORD Style, ExStyle;
|
||||||
HWND Parent;
|
HWND Parent;
|
||||||
RECT ClientRect, WindowRect, CurrentRect, TempRect;
|
RECT ClientRect, WindowRect, CurrentRect, TempRect;
|
||||||
|
@ -309,15 +308,18 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn)
|
||||||
|
|
||||||
Parent = GetParent(hWnd);
|
Parent = GetParent(hWnd);
|
||||||
ExStyle = GetWindowLongW(hWnd, GWL_EXSTYLE);
|
ExStyle = GetWindowLongW(hWnd, GWL_EXSTYLE);
|
||||||
if (ExStyle & WS_EX_MDICHILD)
|
if (Active == -1)
|
||||||
{
|
{
|
||||||
Active = IsChild(GetForegroundWindow(), hWnd);
|
if (ExStyle & WS_EX_MDICHILD)
|
||||||
if (Active)
|
{
|
||||||
Active = (hWnd == (HWND)SendMessageW(Parent, WM_MDIGETACTIVE, 0, 0));
|
Active = IsChild(GetForegroundWindow(), hWnd);
|
||||||
}
|
if (Active)
|
||||||
else
|
Active = (hWnd == (HWND)SendMessageW(Parent, WM_MDIGETACTIVE, 0, 0));
|
||||||
{
|
}
|
||||||
Active = (GetForegroundWindow() == hWnd);
|
else
|
||||||
|
{
|
||||||
|
Active = (GetForegroundWindow() == hWnd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
GetWindowRect(hWnd, &WindowRect);
|
GetWindowRect(hWnd, &WindowRect);
|
||||||
GetClientRect(hWnd, &ClientRect);
|
GetClientRect(hWnd, &ClientRect);
|
||||||
|
@ -660,7 +662,7 @@ DefWndNCCalcSize(HWND hWnd, BOOL CalcSizeStruct, RECT *Rect)
|
||||||
LRESULT
|
LRESULT
|
||||||
DefWndNCActivate(HWND hWnd, WPARAM wParam)
|
DefWndNCActivate(HWND hWnd, WPARAM wParam)
|
||||||
{
|
{
|
||||||
DefWndNCPaint(hWnd, (HRGN)1);
|
DefWndNCPaint(hWnd, (HRGN)1, wParam);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
BOOL ControlsInitialized = FALSE;
|
BOOL ControlsInitialized = FALSE;
|
||||||
|
|
||||||
LRESULT DefWndNCPaint(HWND hWnd, HRGN hRgn);
|
LRESULT DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active);
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
@ -1236,7 +1236,7 @@ SetWindowTextA(HWND hWnd,
|
||||||
|
|
||||||
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
|
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
|
||||||
{
|
{
|
||||||
DefWndNCPaint(hWnd, (HRGN)1);
|
DefWndNCPaint(hWnd, (HRGN)1, -1);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1270,7 +1270,7 @@ SetWindowTextW(HWND hWnd,
|
||||||
|
|
||||||
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
|
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
|
||||||
{
|
{
|
||||||
DefWndNCPaint(hWnd, (HRGN)1);
|
DefWndNCPaint(hWnd, (HRGN)1, -1);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue