fixed hittest code to return HTBORDER if it's not a sizable window frame

svn path=/trunk/; revision=6738
This commit is contained in:
Thomas Bluemel 2003-11-21 17:38:22 +00:00
parent 967fd54cdd
commit 0758139146

View file

@ -606,8 +606,13 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
YSize = GetSystemMetrics(SM_CYSIZE) * GetSystemMetrics(SM_CYBORDER); YSize = GetSystemMetrics(SM_CYSIZE) * GetSystemMetrics(SM_CYBORDER);
if (!PtInRect(&WindowRect, Point)) if (!PtInRect(&WindowRect, Point))
{ {
BOOL ThickFrame;
ThickFrame = (Style & WS_THICKFRAME);
if (Point.y < WindowRect.top) if (Point.y < WindowRect.top)
{ {
if(!ThickFrame)
return HTBORDER;
if (Point.x < (WindowRect.left + XSize)) if (Point.x < (WindowRect.left + XSize))
return HTTOPLEFT; return HTTOPLEFT;
if (Point.x >= (WindowRect.right - XSize)) if (Point.x >= (WindowRect.right - XSize))
@ -616,6 +621,8 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
} }
if (Point.y >= WindowRect.bottom) if (Point.y >= WindowRect.bottom)
{ {
if(!ThickFrame)
return HTBORDER;
if (Point.x < (WindowRect.left + XSize)) if (Point.x < (WindowRect.left + XSize))
return HTBOTTOMLEFT; return HTBOTTOMLEFT;
if (Point.x >= (WindowRect.right - XSize)) if (Point.x >= (WindowRect.right - XSize))
@ -624,6 +631,8 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
} }
if (Point.x < WindowRect.left) if (Point.x < WindowRect.left)
{ {
if(!ThickFrame)
return HTBORDER;
if (Point.y < (WindowRect.top + YSize)) if (Point.y < (WindowRect.top + YSize))
return HTTOPLEFT; return HTTOPLEFT;
if (Point.y >= (WindowRect.bottom - YSize)) if (Point.y >= (WindowRect.bottom - YSize))
@ -632,6 +641,8 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
} }
if (Point.x >= WindowRect.right) if (Point.x >= WindowRect.right)
{ {
if(!ThickFrame)
return HTBORDER;
if (Point.y < (WindowRect.top + YSize)) if (Point.y < (WindowRect.top + YSize))
return HTTOPRIGHT; return HTTOPRIGHT;
if (Point.y >= (WindowRect.bottom - YSize)) if (Point.y >= (WindowRect.bottom - YSize))