mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 07:33:20 +00:00
fixes in DefWndNCCalcSize() and other small fixes
svn path=/trunk/; revision=6224
This commit is contained in:
parent
193d845613
commit
c102b23e07
3 changed files with 88 additions and 90 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: defwnd.c,v 1.92 2003/10/03 11:44:44 gvg Exp $
|
/* $Id: defwnd.c,v 1.93 2003/10/04 16:04:01 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
|
@ -81,32 +81,9 @@ static ATOM AtomInternalPos;
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
BOOL
|
|
||||||
IsMaxBoxActive(HWND hWnd)
|
|
||||||
{
|
|
||||||
ULONG uStyle = GetWindowLongW(hWnd, GWL_STYLE);
|
|
||||||
return (uStyle & WS_MAXIMIZEBOX);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL
|
|
||||||
IsCloseBoxActive(HWND hWnd)
|
|
||||||
{
|
|
||||||
ULONG uStyle = GetWindowLongW(hWnd, GWL_STYLE);
|
|
||||||
return (uStyle & WS_SYSMENU);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL
|
|
||||||
IsMinBoxActive(HWND hWnd)
|
|
||||||
{
|
|
||||||
ULONG uStyle = GetWindowLongW(hWnd, GWL_STYLE);
|
|
||||||
return (uStyle & WS_MINIMIZEBOX);
|
|
||||||
}
|
|
||||||
|
|
||||||
INT
|
INT
|
||||||
UIGetFrameSizeX(HWND hWnd)
|
UIGetFrameSizeX(ULONG uStyle)
|
||||||
{
|
{
|
||||||
ULONG uStyle = GetWindowLongW(hWnd, GWL_STYLE);
|
|
||||||
|
|
||||||
if ( uStyle & WS_THICKFRAME )
|
if ( uStyle & WS_THICKFRAME )
|
||||||
return GetSystemMetrics(SM_CXSIZEFRAME);
|
return GetSystemMetrics(SM_CXSIZEFRAME);
|
||||||
else
|
else
|
||||||
|
@ -114,10 +91,8 @@ UIGetFrameSizeX(HWND hWnd)
|
||||||
}
|
}
|
||||||
|
|
||||||
INT
|
INT
|
||||||
UIGetFrameSizeY(HWND hWnd)
|
UIGetFrameSizeY(ULONG uStyle)
|
||||||
{
|
{
|
||||||
ULONG uStyle = GetWindowLongW(hWnd, GWL_STYLE);
|
|
||||||
|
|
||||||
if (uStyle & WS_THICKFRAME)
|
if (uStyle & WS_THICKFRAME)
|
||||||
return GetSystemMetrics(SM_CYSIZEFRAME);
|
return GetSystemMetrics(SM_CYSIZEFRAME);
|
||||||
else
|
else
|
||||||
|
@ -368,16 +343,20 @@ static void
|
||||||
UserDrawCaptionButton(HWND hWnd, HDC hDC, BOOL bDown, ULONG Type)
|
UserDrawCaptionButton(HWND hWnd, HDC hDC, BOOL bDown, ULONG Type)
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
|
ULONG ExStyle;
|
||||||
|
ULONG Style = GetWindowLongW(hWnd, GWL_STYLE);
|
||||||
INT iBmpWidth = GetSystemMetrics(SM_CXSIZE) - 2;
|
INT iBmpWidth = GetSystemMetrics(SM_CXSIZE) - 2;
|
||||||
INT iBmpHeight = GetSystemMetrics(SM_CYSIZE) - 4;
|
INT iBmpHeight = GetSystemMetrics(SM_CYSIZE) - 4;
|
||||||
INT OffsetX = UIGetFrameSizeX(hWnd);
|
INT OffsetX = UIGetFrameSizeX(Style);
|
||||||
INT OffsetY = UIGetFrameSizeY(hWnd);
|
INT OffsetY = UIGetFrameSizeY(Style);
|
||||||
|
|
||||||
if (!(GetWindowLongW(hWnd, GWL_STYLE) & WS_SYSMENU))
|
if (!(Style & WS_SYSMENU))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ExStyle = GetWindowLongW(hWnd, GWL_EXSTYLE);
|
||||||
|
|
||||||
GetWindowRect(hWnd, &rect);
|
GetWindowRect(hWnd, &rect);
|
||||||
|
|
||||||
rect.right = rect.right - rect.left;
|
rect.right = rect.right - rect.left;
|
||||||
|
@ -388,39 +367,39 @@ UserDrawCaptionButton(HWND hWnd, HDC hDC, BOOL bDown, ULONG Type)
|
||||||
{
|
{
|
||||||
case DFCS_CAPTIONMIN:
|
case DFCS_CAPTIONMIN:
|
||||||
{
|
{
|
||||||
if ((GetWindowLongW(hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) == TRUE)
|
if ((ExStyle & WS_EX_TOOLWINDOW) == TRUE)
|
||||||
return; /* ToolWindows don't have min/max buttons */
|
return; /* ToolWindows don't have min/max buttons */
|
||||||
|
|
||||||
SetRect(&rect, rect.right - OffsetX - (iBmpWidth * 3) - 5,
|
SetRect(&rect, rect.right - OffsetX - (iBmpWidth * 3) - 4,
|
||||||
OffsetY + 2, rect.right - (iBmpWidth * 2) - OffsetX - 5,
|
OffsetY + 2, rect.right - (iBmpWidth * 2) - OffsetX - 4,
|
||||||
rect.top + iBmpHeight + OffsetY + 2);
|
rect.top + iBmpHeight + OffsetY + 2);
|
||||||
DrawFrameControl(hDC, &rect, DFC_CAPTION,
|
DrawFrameControl(hDC, &rect, DFC_CAPTION,
|
||||||
DFCS_CAPTIONMIN | (bDown ? DFCS_PUSHED : 0) |
|
DFCS_CAPTIONMIN | (bDown ? DFCS_PUSHED : 0) |
|
||||||
(IsMinBoxActive(hWnd) ? 0 : DFCS_INACTIVE));
|
((Style & WS_MINIMIZEBOX) ? 0 : DFCS_INACTIVE));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DFCS_CAPTIONMAX:
|
case DFCS_CAPTIONMAX:
|
||||||
{
|
{
|
||||||
if ((GetWindowLongW(hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) == TRUE)
|
if ((ExStyle & WS_EX_TOOLWINDOW) == TRUE)
|
||||||
return; /* ToolWindows don't have min/max buttons */
|
return; /* ToolWindows don't have min/max buttons */
|
||||||
|
|
||||||
SetRect(&rect, rect.right - OffsetX - (iBmpWidth * 2) - 5,
|
SetRect(&rect, rect.right - OffsetX - (iBmpWidth * 2) - 4,
|
||||||
OffsetY + 2, rect.right - iBmpWidth - OffsetX - 5,
|
OffsetY + 2, rect.right - iBmpWidth - OffsetX - 4,
|
||||||
rect.top + iBmpHeight + OffsetY + 2);
|
rect.top + iBmpHeight + OffsetY + 2);
|
||||||
DrawFrameControl(hDC, &rect, DFC_CAPTION,
|
DrawFrameControl(hDC, &rect, DFC_CAPTION,
|
||||||
(IsZoomed(hWnd) ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMAX) |
|
(IsZoomed(hWnd) ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMAX) |
|
||||||
(bDown ? DFCS_PUSHED : 0) |
|
(bDown ? DFCS_PUSHED : 0) |
|
||||||
(IsMaxBoxActive(hWnd) ? 0 : DFCS_INACTIVE));
|
((Style & WS_MAXIMIZEBOX) ? 0 : DFCS_INACTIVE));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DFCS_CAPTIONCLOSE:
|
case DFCS_CAPTIONCLOSE:
|
||||||
{
|
{
|
||||||
SetRect(&rect, rect.right - OffsetX - iBmpWidth - 3,
|
SetRect(&rect, rect.right - OffsetX - iBmpWidth - 2,
|
||||||
OffsetY + 2, rect.right - OffsetX - 3,
|
OffsetY + 2, rect.right - OffsetX - 2,
|
||||||
rect.top + iBmpHeight + OffsetY + 2 );
|
rect.top + iBmpHeight + OffsetY + 2 );
|
||||||
DrawFrameControl(hDC, &rect, DFC_CAPTION,
|
DrawFrameControl(hDC, &rect, DFC_CAPTION,
|
||||||
(DFCS_CAPTIONCLOSE | (bDown ? DFCS_PUSHED : 0) |
|
(DFCS_CAPTIONCLOSE | (bDown ? DFCS_PUSHED : 0) |
|
||||||
(IsCloseBoxActive(hWnd) ? 0 : DFCS_INACTIVE)));
|
((Style & WS_SYSMENU) ? 0 : DFCS_INACTIVE)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -601,12 +580,14 @@ UserDrawCaptionNC (
|
||||||
POINT OldPos;
|
POINT OldPos;
|
||||||
HPEN lPen, oPen;
|
HPEN lPen, oPen;
|
||||||
RECT r = *rect;
|
RECT r = *rect;
|
||||||
UINT capflags = 0;
|
UINT Style, capflags = 0;
|
||||||
|
|
||||||
|
Style = GetWindowLongW(hWnd, GWL_STYLE);
|
||||||
|
|
||||||
capflags = DC_ICON | DC_TEXT;
|
capflags = DC_ICON | DC_TEXT;
|
||||||
capflags |= (active & DC_ACTIVE);
|
capflags |= (active & DC_ACTIVE);
|
||||||
|
|
||||||
if (GetWindowLongW(hWnd, GWL_STYLE) & WS_EX_TOOLWINDOW)
|
if (Style & WS_EX_TOOLWINDOW)
|
||||||
capflags |= DC_SMALLCAP;
|
capflags |= DC_SMALLCAP;
|
||||||
|
|
||||||
// Old code:
|
// Old code:
|
||||||
|
@ -637,10 +618,13 @@ UserDrawCaptionNC (
|
||||||
r.left += GetSystemMetrics(SM_CXSIZE) + 1;
|
r.left += GetSystemMetrics(SM_CXSIZE) + 1;
|
||||||
UserDrawCaptionButton( hWnd, hDC, FALSE, DFCS_CAPTIONCLOSE);
|
UserDrawCaptionButton( hWnd, hDC, FALSE, DFCS_CAPTIONCLOSE);
|
||||||
r.right -= GetSystemMetrics(SM_CXSMSIZE) + 1;
|
r.right -= GetSystemMetrics(SM_CXSMSIZE) + 1;
|
||||||
|
if(Style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
|
||||||
|
{
|
||||||
UserDrawCaptionButton( hWnd, hDC, FALSE, DFCS_CAPTIONMIN);
|
UserDrawCaptionButton( hWnd, hDC, FALSE, DFCS_CAPTIONMIN);
|
||||||
UserDrawCaptionButton( hWnd, hDC, FALSE, DFCS_CAPTIONMAX);
|
UserDrawCaptionButton( hWnd, hDC, FALSE, DFCS_CAPTIONMAX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
|
@ -929,25 +913,26 @@ DefWndDoButton(HWND hWnd, WPARAM wParam)
|
||||||
{
|
{
|
||||||
MSG Msg;
|
MSG Msg;
|
||||||
BOOL InBtn = TRUE, HasBtn = FALSE;
|
BOOL InBtn = TRUE, HasBtn = FALSE;
|
||||||
ULONG Btn;
|
ULONG Btn, Style;
|
||||||
WPARAM SCMsg, CurBtn = wParam, OrigBtn = wParam;
|
WPARAM SCMsg, CurBtn = wParam, OrigBtn = wParam;
|
||||||
|
|
||||||
|
Style = GetWindowLongW(hWnd, GWL_STYLE);
|
||||||
switch(wParam)
|
switch(wParam)
|
||||||
{
|
{
|
||||||
case HTCLOSE:
|
case HTCLOSE:
|
||||||
Btn = DFCS_CAPTIONCLOSE;
|
Btn = DFCS_CAPTIONCLOSE;
|
||||||
SCMsg = SC_CLOSE;
|
SCMsg = SC_CLOSE;
|
||||||
HasBtn = IsCloseBoxActive(hWnd);
|
HasBtn = (Style & WS_SYSMENU);
|
||||||
break;
|
break;
|
||||||
case HTMINBUTTON:
|
case HTMINBUTTON:
|
||||||
Btn = DFCS_CAPTIONMIN;
|
Btn = DFCS_CAPTIONMIN;
|
||||||
SCMsg = SC_MINIMIZE;
|
SCMsg = SC_MINIMIZE;
|
||||||
HasBtn = IsMinBoxActive(hWnd);
|
HasBtn = (Style & WS_MINIMIZEBOX);
|
||||||
break;
|
break;
|
||||||
case HTMAXBUTTON:
|
case HTMAXBUTTON:
|
||||||
Btn = DFCS_CAPTIONMAX;
|
Btn = DFCS_CAPTIONMAX;
|
||||||
SCMsg = SC_MAXIMIZE;
|
SCMsg = SC_MAXIMIZE;
|
||||||
HasBtn = IsMaxBoxActive(hWnd);
|
HasBtn = (Style & WS_MAXIMIZEBOX);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
|
@ -1599,7 +1584,7 @@ DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, POINT Pt)
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
DefWndAdjustRect(RECT* Rect, ULONG Style, BOOL Menu, ULONG ExStyle)
|
DefWndAdjustRect(HWND hWnd, RECT* Rect, ULONG Style, BOOL Menu, ULONG ExStyle)
|
||||||
{
|
{
|
||||||
if (Style & WS_ICONIC)
|
if (Style & WS_ICONIC)
|
||||||
{
|
{
|
||||||
|
@ -1627,16 +1612,19 @@ DefWndAdjustRect(RECT* Rect, ULONG Style, BOOL Menu, ULONG ExStyle)
|
||||||
}
|
}
|
||||||
if (Menu)
|
if (Menu)
|
||||||
{
|
{
|
||||||
Rect->top -= GetSystemMetrics(SM_CYMENU);
|
//Rect->top -= GetSystemMetrics(SM_CYMENU);
|
||||||
|
Rect->top -= MenuGetMenuBarHeight(hWnd, Rect->right - Rect->left, -Rect->left, -Rect->top);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT STDCALL
|
LRESULT STDCALL
|
||||||
DefWndNCCalcSize(HWND hWnd, RECT* Rect)
|
DefWndNCCalcSize(HWND hWnd, BOOL CalcSizeStruct, RECT* Rect)
|
||||||
{
|
{
|
||||||
LRESULT Result = 0;
|
LRESULT Result = 0;
|
||||||
LONG ScrollXY;
|
LONG ScrollXY;
|
||||||
RECT TmpRect = {0, 0, 0, 0};
|
NCCALCSIZE_PARAMS *SizeStruct = (NCCALCSIZE_PARAMS *)Rect;
|
||||||
|
RECT NewRect, TmpRect = {0, 0, 0, 0};
|
||||||
ULONG ExStyle = GetWindowLongW(hWnd, GWL_EXSTYLE);
|
ULONG ExStyle = GetWindowLongW(hWnd, GWL_EXSTYLE);
|
||||||
LONG Style = GetClassLongW(hWnd, GCL_STYLE);
|
LONG Style = GetClassLongW(hWnd, GCL_STYLE);
|
||||||
|
|
||||||
|
@ -1653,48 +1641,58 @@ DefWndNCCalcSize(HWND hWnd, RECT* Rect)
|
||||||
|
|
||||||
if (!(Style & WS_MINIMIZE))
|
if (!(Style & WS_MINIMIZE))
|
||||||
{
|
{
|
||||||
DefWndAdjustRect(&TmpRect, Style, FALSE, ExStyle);
|
DefWndAdjustRect(hWnd, &TmpRect, Style, UserHasMenu(hWnd, Style), ExStyle);
|
||||||
|
|
||||||
|
if(CalcSizeStruct)
|
||||||
|
{
|
||||||
|
Rect = &(SizeStruct->rgrc[0]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Result = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
NewRect.left = Rect->left - TmpRect.left;
|
||||||
|
NewRect.top = Rect->top - TmpRect.top;
|
||||||
|
NewRect.right = Rect->right - TmpRect.right;
|
||||||
|
NewRect.bottom = Rect->bottom - TmpRect.bottom;
|
||||||
|
if(NewRect.top > NewRect.bottom)
|
||||||
|
NewRect.bottom = NewRect.top;
|
||||||
|
if(NewRect.left > NewRect.right)
|
||||||
|
NewRect.right = NewRect.left;
|
||||||
|
|
||||||
if (Style & WS_VSCROLL)
|
if (Style & WS_VSCROLL)
|
||||||
{
|
{
|
||||||
ScrollXY = GetSystemMetrics(SM_CXVSCROLL);
|
ScrollXY = GetSystemMetrics(SM_CXVSCROLL);
|
||||||
DPRINT("@! %d > %d (%d, %d, %d ,%d)\n", Rect->right - Rect->left, ScrollXY, Rect->left, Rect->top, Rect->right, Rect->bottom);
|
if(NewRect.right - NewRect.left > ScrollXY)
|
||||||
if(Rect->right - Rect->left > ScrollXY)
|
|
||||||
{
|
{
|
||||||
TmpRect.right += ScrollXY - 1;
|
NewRect.right -= ScrollXY + 1;
|
||||||
if (UserHasAnyFrameStyle(Style, ExStyle))
|
if (UserHasAnyFrameStyle(Style, ExStyle))
|
||||||
{
|
{
|
||||||
TmpRect.right++;
|
NewRect.right++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Style & WS_HSCROLL)
|
if (Style & WS_HSCROLL)
|
||||||
{
|
{
|
||||||
ScrollXY = GetSystemMetrics(SM_CYHSCROLL);
|
ScrollXY = GetSystemMetrics(SM_CYHSCROLL);
|
||||||
if(Rect->bottom - Rect->top > ScrollXY)
|
if(NewRect.bottom - NewRect.top > ScrollXY)
|
||||||
{
|
{
|
||||||
TmpRect.bottom += ScrollXY - 1;
|
NewRect.bottom -= ScrollXY + 1;
|
||||||
if (UserHasAnyFrameStyle(Style, ExStyle))
|
if (UserHasAnyFrameStyle(Style, ExStyle))
|
||||||
{
|
{
|
||||||
TmpRect.bottom++;
|
NewRect.bottom++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rect->left -= TmpRect.left;
|
|
||||||
Rect->top -= TmpRect.top;
|
|
||||||
Rect->right -= TmpRect.right;
|
|
||||||
Rect->bottom -= TmpRect.bottom;
|
|
||||||
if (UserHasMenu(hWnd, Style))
|
|
||||||
{
|
|
||||||
Rect->top += MenuGetMenuBarHeight(hWnd, Rect->right - Rect->left,
|
|
||||||
-TmpRect.left, -TmpRect.top);
|
|
||||||
}
|
|
||||||
if (Rect->top > Rect->bottom)
|
|
||||||
Rect->bottom = Rect->top;
|
|
||||||
if (Rect->left > Rect->right)
|
|
||||||
Rect->right = Rect->left;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (Result);
|
Rect->left = NewRect.left;
|
||||||
|
Rect->top = NewRect.top;
|
||||||
|
Rect->right = NewRect.right;
|
||||||
|
Rect->bottom = NewRect.bottom;
|
||||||
|
|
||||||
|
}
|
||||||
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT
|
LRESULT
|
||||||
|
@ -1817,7 +1815,7 @@ User32DefWindowProc(HWND hWnd,
|
||||||
|
|
||||||
case WM_NCCALCSIZE:
|
case WM_NCCALCSIZE:
|
||||||
{
|
{
|
||||||
return (DefWndNCCalcSize(hWnd, (RECT*)lParam));
|
return (DefWndNCCalcSize(hWnd, (BOOL)wParam, (RECT*)lParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_WINDOWPOSCHANGING:
|
case WM_WINDOWPOSCHANGING:
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: menu.c,v 1.30 2003/09/13 13:58:38 weiden Exp $
|
/* $Id: menu.c,v 1.31 2003/10/04 16:04:01 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -690,7 +690,7 @@ IntInsertMenuItem(PMENU_OBJECT MenuObject, UINT uItem, WINBOOL fByPosition,
|
||||||
if(MenuObject->MenuItemCount >= MAX_MENU_ITEMS)
|
if(MenuObject->MenuItemCount >= MAX_MENU_ITEMS)
|
||||||
{
|
{
|
||||||
/* FIXME Set last error code? */
|
/* FIXME Set last error code? */
|
||||||
SetLastWin32Error(STATUS_NO_MEMORY);
|
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -710,7 +710,7 @@ IntInsertMenuItem(PMENU_OBJECT MenuObject, UINT uItem, WINBOOL fByPosition,
|
||||||
if(!MenuItem)
|
if(!MenuItem)
|
||||||
{
|
{
|
||||||
/* FIXME Set last error code? */
|
/* FIXME Set last error code? */
|
||||||
SetLastWin32Error(STATUS_NO_MEMORY);
|
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1125,7 +1125,7 @@ NtUserCreateMenu(VOID)
|
||||||
{
|
{
|
||||||
DPRINT("Validation of window station handle (0x%X) failed\n",
|
DPRINT("Validation of window station handle (0x%X) failed\n",
|
||||||
PROCESS_WINDOW_STATION());
|
PROCESS_WINDOW_STATION());
|
||||||
SetLastWin32Error(Status);
|
SetLastNtError(Status);
|
||||||
return (HMENU)0;
|
return (HMENU)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: window.c,v 1.109 2003/09/21 06:44:51 gvg Exp $
|
/* $Id: window.c,v 1.110 2003/10/04 16:04:01 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -2585,6 +2585,7 @@ NtUserSetMenu(
|
||||||
{
|
{
|
||||||
PWINDOW_OBJECT WindowObject;
|
PWINDOW_OBJECT WindowObject;
|
||||||
PMENU_OBJECT MenuObject;
|
PMENU_OBJECT MenuObject;
|
||||||
|
BOOL Changed = FALSE;
|
||||||
WindowObject = IntGetWindowObject((HWND)hWnd);
|
WindowObject = IntGetWindowObject((HWND)hWnd);
|
||||||
if(!WindowObject)
|
if(!WindowObject)
|
||||||
{
|
{
|
||||||
|
@ -2603,6 +2604,7 @@ NtUserSetMenu(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Changed = (WindowObject->IDMenu != (UINT)hMenu);
|
||||||
WindowObject->IDMenu = (UINT)hMenu;
|
WindowObject->IDMenu = (UINT)hMenu;
|
||||||
|
|
||||||
IntReleaseMenuObject(MenuObject);
|
IntReleaseMenuObject(MenuObject);
|
||||||
|
@ -2610,19 +2612,17 @@ NtUserSetMenu(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* remove the menu handle */
|
/* remove the menu handle */
|
||||||
|
Changed = (WindowObject->IDMenu != 0);
|
||||||
WindowObject->IDMenu = 0;
|
WindowObject->IDMenu = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
IntReleaseWindowObject(WindowObject);
|
IntReleaseWindowObject(WindowObject);
|
||||||
|
|
||||||
/* FIXME (from wine)
|
if(Changed && bRepaint && IntIsWindowVisible(hWnd))
|
||||||
if(bRepaint)
|
|
||||||
{
|
{
|
||||||
if (IsWindowVisible(hWnd))
|
WinPosSetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
|
||||||
SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
|
|
||||||
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue