#include <user32/callback.h>
/* FUNCTIONS *****************************************************************/
+ULONG
+ WinHasThickFrameStyle(ULONG Style, ULONG ExStyle)
+{
+ return((Style & WS_THICKFRAME) &&
+ (!((Style & (WS_DLGFRAME | WS_BORDER)) == WS_DLGFRAME)));
+}
NTSTATUS STDCALL
User32SendNCCALCSIZEMessageForKernel(PVOID Arguments, ULONG ArgumentLength)
return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
}
+static void NC_AdjustRectOuter95 (LPRECT rect, DWORD style, BOOL menu, DWORD exStyle)
+{
+ int adjust;
+ if(style & WS_ICONIC) return;
+
+ if ((exStyle & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) ==
+ WS_EX_STATICEDGE)
+ {
+ adjust = 1; /* for the outer frame always present */
+ }
+ else
+ {
+ adjust = 0;
+ if ((exStyle & WS_EX_DLGMODALFRAME) ||
+ (style & (WS_THICKFRAME|WS_DLGFRAME))) adjust = 2; /* outer */
+ }
+ if (style & WS_THICKFRAME)
+ adjust += ( GetSystemMetrics (SM_CXFRAME)
+ - GetSystemMetrics (SM_CXDLGFRAME)); /* The resize border */
+ if ((style & (WS_BORDER|WS_DLGFRAME)) ||
+ (exStyle & WS_EX_DLGMODALFRAME))
+ adjust++; /* The other border */
+
+ InflateRect (rect, adjust, adjust);
+
+ if ((style & WS_CAPTION) == WS_CAPTION)
+ {
+ if (exStyle & WS_EX_TOOLWINDOW)
+ rect->top -= GetSystemMetrics(SM_CYSMCAPTION);
+ else
+ rect->top -= GetSystemMetrics(SM_CYCAPTION);
+ }
+ if (menu) rect->top -= GetSystemMetrics(SM_CYMENU);
+}
+
+static void
+NC_AdjustRectInner95 (LPRECT rect, DWORD style, DWORD exStyle)
+{
+ if(style & WS_ICONIC) return;
+
+ if (exStyle & WS_EX_CLIENTEDGE)
+ InflateRect(rect, GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE));
+
+ if (style & WS_VSCROLL)
+ {
+ if((exStyle & WS_EX_LEFTSCROLLBAR) != 0)
+ rect->left -= GetSystemMetrics(SM_CXVSCROLL);
+ else
+ rect->right += GetSystemMetrics(SM_CXVSCROLL);
+ }
+ if (style & WS_HSCROLL) rect->bottom += GetSystemMetrics(SM_CYHSCROLL);
+}
+
WINBOOL STDCALL
AdjustWindowRect(LPRECT lpRect,
DWORD dwStyle,
WINBOOL bMenu,
DWORD dwExStyle)
{
- return(FALSE);
+ dwStyle &= (WS_DLGFRAME | WS_BORDER | WS_THICKFRAME | WS_CHILD);
+ dwExStyle &= (WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE |
+ WS_EX_STATICEDGE | WS_EX_TOOLWINDOW);
+ if (dwExStyle & WS_EX_DLGMODALFRAME) dwStyle &= ~WS_THICKFRAME;
+
+ NC_AdjustRectOuter95( lpRect, dwStyle, bMenu, dwExStyle );
+ NC_AdjustRectInner95( lpRect, dwStyle, dwExStyle );
+ lpRect->right += 2;
+ lpRect->bottom += 2;
+ return TRUE;
}
WINBOOL STDCALL
WINBOOL STDCALL
CloseWindow(HWND hWnd)
{
- return FALSE;
+ SendMessageA(hWnd, WM_CLOSE, 0, 0);
+ SendMessageA(hWnd, WM_SYSCOMMAND, SC_CLOSE, 0);
+
+ return (WINBOOL)(hWnd);
}
HWND STDCALL
WINBOOL STDCALL
DestroyWindow(HWND hWnd)
{
- return FALSE;
+ SendMessageW(hWnd, WM_DESTROY, 0, 0);
+ SendMessageW(hWnd, WM_NCDESTROY, 0, 0);
+
+ return NtUserDestroyWindow(hWnd);
}
WINBOOL STDCALL
WINBOOL STDCALL
GetClientRect(HWND hWnd, LPRECT lpRect)
{
- return FALSE;
+ return(NtUserGetClientRect(hWnd, lpRect));
}
HWND STDCALL
HWND STDCALL
GetParent(HWND hWnd)
{
- return (HWND)0;
+ return NtUserGetAncestor(hWnd, GA_PARENT);
}
WINBOOL STDCALL
WINBOOL STDCALL
IsZoomed(HWND hWnd)
{
- return FALSE;
+ ULONG uStyle = GetWindowLong(hWnd, GWL_STYLE);
+
+ return (uStyle & WS_MAXIMIZE);
}
WINBOOL STDCALL
int nHeight,
WINBOOL bRepaint)
{
- return FALSE;
+ return NtUserMoveWindow(hWnd, X, Y, nWidth, nHeight, bRepaint);
}
WINBOOL STDCALL
NtUserGetClientOrigin(hWndFrom, &FromOffset);
NtUserGetClientOrigin(hWndTo, &ToOffset);
- XMove = ToOffset.x - FromOffset.x;
- YMove = ToOffset.y - FromOffset.y;
+ XMove = FromOffset.x - ToOffset.x;
+ YMove = FromOffset.y - ToOffset.y;
+
for (i = 0; i < cPoints; i++)
{
lpPoints[i].x += XMove;