{
if(nIndex >= 0 && nIndex < NUM_SYSCOLORS)
{
- return g_psi->SysColors[nIndex];
+ return g_psi->argbSystem[nIndex];
}
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
-/*
- * @implemented
- */
-HPEN WINAPI
-GetSysColorPen(int nIndex)
-{
- if(nIndex >= 0 && nIndex < NUM_SYSCOLORS)
- {
- return g_psi->SysColorPens[nIndex];
- }
-
- SetLastError(ERROR_INVALID_PARAMETER);
- return NULL;
-}
-
/*
* @implemented
*/
{
if(nIndex >= 0 && nIndex < NUM_SYSCOLORS)
{
- return g_psi->SysColorBrushes[nIndex];
+ return g_psi->ahbrSystem[nIndex];
}
SetLastError(ERROR_INVALID_PARAMETER);
}
void
-UserGetInsideRectNC(PWINDOW Wnd, RECT *rect)
+UserGetInsideRectNC(PWND Wnd, RECT *rect)
{
ULONG Style;
ULONG ExStyle;
- Style = Wnd->Style;
+ Style = Wnd->style;
ExStyle = Wnd->ExStyle;
rect->top = rect->left = 0;
- rect->right = Wnd->WindowRect.right - Wnd->WindowRect.left;
- rect->bottom = Wnd->WindowRect.bottom - Wnd->WindowRect.top;
+ rect->right = Wnd->rcWindow.right - Wnd->rcWindow.left;
+ rect->bottom = Wnd->rcWindow.bottom - Wnd->rcWindow.top;
if (Style & WS_ICONIC)
{
VOID
DefWndSetRedraw(HWND hWnd, WPARAM wParam)
{
- LONG Style = GetWindowLong(hWnd, GWL_STYLE);
+ LONG Style = GetWindowLongPtr(hWnd, GWL_STYLE);
/* Content can be redrawn after a change. */
if (wParam)
{
if (!(Style & WS_VISIBLE)) /* Not Visible */
{
- SetWindowLong(hWnd, GWL_STYLE, WS_VISIBLE);
+ SetWindowLongPtr(hWnd, GWL_STYLE, WS_VISIBLE);
}
}
else /* Content cannot be redrawn after a change. */
{
RedrawWindow( hWnd, NULL, 0, RDW_ALLCHILDREN | RDW_VALIDATE );
Style &= ~WS_VISIBLE;
- SetWindowLong(hWnd, GWL_STYLE, Style); /* clear bits */
+ SetWindowLongPtr(hWnd, GWL_STYLE, Style); /* clear bits */
}
}
return;
case HTCLIENT:
{
- HICON hCursor = (HICON)GetClassLongW(hWnd, GCL_HCURSOR);
+ HICON hCursor = (HICON)GetClassLongPtrW(hWnd, GCL_HCURSOR);
if (hCursor)
{
SetCursor(hCursor);
case HTBOTTOMLEFT:
case HTTOPRIGHT:
{
- if (GetWindowLongW(hWnd, GWL_STYLE) & WS_MAXIMIZE)
+ if (GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_MAXIMIZE)
{
break;
}
}
static LONG
-DefWndStartSizeMove(HWND hWnd, PWINDOW Wnd, WPARAM wParam, POINT *capturePoint)
+DefWndStartSizeMove(HWND hWnd, PWND Wnd, WPARAM wParam, POINT *capturePoint)
{
LONG hittest = 0;
POINT pt;
MSG msg;
RECT rectWindow;
- ULONG Style = Wnd->Style;
+ ULONG Style = Wnd->style;
- rectWindow = Wnd->WindowRect;
+ rectWindow = Wnd->rcWindow;
if ((wParam & 0xfff0) == SC_MOVE)
{
DWORD dwPoint = GetMessagePos();
BOOL DragFullWindows = FALSE;
HWND hWndParent = NULL;
- PWINDOW Wnd;
+ PWND Wnd;
Wnd = ValidateHwnd(hwnd);
if (!Wnd)
return;
- Style = Wnd->Style;
+ Style = Wnd->style;
ExStyle = Wnd->ExStyle;
iconic = (Style & WS_MINIMIZE) != 0;
/* Get min/max info */
WinPosGetMinMaxInfo(hwnd, NULL, NULL, &minTrack, &maxTrack);
- sizingRect = Wnd->WindowRect;
+ sizingRect = Wnd->rcWindow;
if (Style & WS_CHILD)
{
hWndParent = GetParent(hwnd);
if( iconic ) /* create a cursor for dragging */
{
- HICON hIcon = (HICON)GetClassLongW(hwnd, GCL_HICON);
+ HICON hIcon = (HICON)GetClassLongPtrW(hwnd, GCL_HICON);
if(!hIcon) hIcon = (HICON)SendMessageW( hwnd, WM_QUERYDRAGICON, 0, 0L);
if( hIcon ) hDragCursor = CursorIconToCursor( hIcon, TRUE );
if( !hDragCursor ) iconic = FALSE;
DeleteObject(DesktopRgn);
}
}
-#if 0
- if (ISITHOOKED(WH_CBT))
+//#if 0
+// if (ISITHOOKED(WH_CBT))
{
- if (NtUserMessageCall( hWnd, WM_SYSCOMMAND, wParam, (LPARAM)&sizingRect, 0, FNID_DEFWINDOWPROC, FALSE))
- moved = FALSE;
+ LRESULT lResult;
+ NtUserMessageCall( hwnd, WM_CBT, HCBT_MOVESIZE, (LPARAM)&sizingRect, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, FALSE);
+ if (lResult) moved = FALSE;
}
-#endif
+//#endif
(void)NtUserSetGUIThreadHandle(MSQ_STATE_MOVESIZE, NULL);
SendMessageA( hwnd, WM_EXITSIZEMOVE, 0, 0 );
SendMessageA( hwnd, WM_SETVISIBLE, !IsIconic(hwnd), 0L);
WINDOWPLACEMENT wp;
POINT Pt;
-#if 0
- if (ISITHOOKED(WH_CBT))
+ if (!IsWindowEnabled( hWnd )) return 0;
+
+//#if 0
+// if (ISITHOOKED(WH_CBT))
{
- if (NtUserMessageCall( hWnd, WM_SYSCOMMAND, wParam, lParam, 0, FNID_DEFWINDOWPROC, FALSE))
- return 0;
+ LRESULT lResult;
+ NtUserMessageCall( hWnd, WM_SYSCOMMAND, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, FALSE);
+ if (lResult) return 0;
}
-#endif
+//#endif
switch (wParam & 0xfff0)
{
case SC_MOVE:
}
break;
case SC_CLOSE:
- SendMessageA(hWnd, WM_CLOSE, 0, 0);
- break;
+ return SendMessageW(hWnd, WM_CLOSE, 0, 0);
+
case SC_MOUSEMENU:
{
Pt.x = (short)LOWORD(lParam);
DefWndHandleWindowPosChanging(HWND hWnd, WINDOWPOS* Pos)
{
POINT maxTrack, minTrack;
- LONG style = GetWindowLongA(hWnd, GWL_STYLE);
+ LONG style = GetWindowLongPtrA(hWnd, GWL_STYLE);
if (Pos->flags & SWP_NOSIZE) return 0;
if ((style & WS_THICKFRAME) || ((style & (WS_POPUP | WS_CHILD)) == 0))
RECT Rect;
GetClientRect(hWnd, &Rect);
- MapWindowPoints(hWnd, (GetWindowLongW(hWnd, GWL_STYLE) & WS_CHILD ?
+ MapWindowPoints(hWnd, (GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CHILD ?
GetParent(hWnd) : NULL), (LPPOINT) &Rect, 2);
if (! (Pos->flags & SWP_NOCLIENTMOVE))
* Client area
*/
if ( uFlags & PRF_CLIENT)
- SendMessageW(hwnd, WM_PRINTCLIENT, (WPARAM)hdc, PRF_CLIENT);
+ SendMessageW(hwnd, WM_PRINTCLIENT, (WPARAM)hdc, uFlags);
}
static BOOL CALLBACK
case WM_CONTEXTMENU:
{
- if (GetWindowLongW(hWnd, GWL_STYLE) & WS_CHILD)
+ if (GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CHILD)
{
if (bUnicode)
{
else
{
POINT Pt;
- DWORD Style;
+ LONG_PTR Style;
LONG HitCode;
- Style = GetWindowLongW(hWnd, GWL_STYLE);
+ Style = GetWindowLongPtrW(hWnd, GWL_STYLE);
Pt.x = GET_X_LPARAM(lParam);
Pt.y = GET_Y_LPARAM(lParam);
if((SystemMenu = GetSystemMenu(hWnd, FALSE)))
{
- MenuInitSysMenuPopup(SystemMenu, GetWindowLongW(hWnd, GWL_STYLE),
- GetClassLongW(hWnd, GCL_STYLE), HitCode);
+ MenuInitSysMenuPopup(SystemMenu, GetWindowLongPtrW(hWnd, GWL_STYLE),
+ GetClassLongPtrW(hWnd, GCL_STYLE), HitCode);
if(HitCode == HTCAPTION)
Flags = TPM_LEFTBUTTON | TPM_RIGHTBUTTON;
{
HICON hIcon;
- if (GetWindowLongW(hWnd, GWL_STYLE) & WS_MINIMIZE &&
- (hIcon = (HICON)GetClassLongW(hWnd, GCL_HICON)) != NULL)
+ if (GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_MINIMIZE &&
+ (hIcon = (HICON)GetClassLongPtrW(hWnd, GCL_HICON)) != NULL)
{
RECT ClientRect;
INT x, y;
case WM_SETREDRAW:
{
- DefWndSetRedraw(hWnd, wParam);
+ LONG_PTR Style = GetWindowLongPtrW(hWnd, GWL_STYLE);
+ if (wParam) SetWindowLongPtr(hWnd, GWL_STYLE, Style | WS_VISIBLE);
+ else
+ {
+ RedrawWindow(hWnd, NULL, 0, RDW_ALLCHILDREN | RDW_VALIDATE);
+ Style &= ~WS_VISIBLE;
+ SetWindowLongPtr(hWnd, GWL_STYLE, Style);
+ }
return (0);
}
case WM_MOUSEACTIVATE:
{
- if (GetWindowLongW(hWnd, GWL_STYLE) & WS_CHILD)
+ if (GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CHILD)
{
LONG Ret;
if (bUnicode)
{
/* Check if the window is minimized. */
if (LOWORD(wParam) != WA_INACTIVE &&
- !(GetWindowLongW(hWnd, GWL_STYLE) & WS_MINIMIZE))
+ !(GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_MINIMIZE))
{
SetFocus(hWnd);
}
case WM_MOUSEWHEEL:
{
- if (GetWindowLongW(hWnd, GWL_STYLE) & WS_CHILD)
+ if (GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CHILD)
{
if (bUnicode)
{
case WM_ICONERASEBKGND:
{
RECT Rect;
- HBRUSH hBrush = (HBRUSH)GetClassLongW(hWnd, GCL_HBRBACKGROUND);
+ HBRUSH hBrush = (HBRUSH)GetClassLongPtrW(hWnd, GCL_HBRBACKGROUND);
if (NULL == hBrush)
{
return 0;
}
- if (GetClassLongW(hWnd, GCL_STYLE) & CS_PARENTDC)
+ if (GetClassLongPtrW(hWnd, GCL_STYLE) & CS_PARENTDC)
{
/* can't use GetClipBox with a parent DC or we fill the whole parent */
GetClientRect(hWnd, &Rect);
case WM_SETCURSOR:
{
- ULONG Style = GetWindowLongW(hWnd, GWL_STYLE);
+ LONG_PTR Style = GetWindowLongPtrW(hWnd, GWL_STYLE);
if (Style & WS_CHILD)
{
if (wParam == VK_F4) /* Try to close the window */
{
- if (!(GetClassLongW(top, GCL_STYLE) & CS_NOCLOSE))
+ if (!(GetClassLongPtrW(top, GCL_STYLE) & CS_NOCLOSE))
{
if (bUnicode)
PostMessageW(top, WM_SYSCOMMAND, SC_CLOSE, 0);
if ((HIWORD(lParam) & KEYDATA_ALT) && wParam)
{
if (wParam == '\t' || wParam == '\x1b') break;
- if (wParam == ' ' && (GetWindowLongW( hWnd, GWL_STYLE ) & WS_CHILD))
+ if (wParam == ' ' && (GetWindowLongPtrW( hWnd, GWL_STYLE ) & WS_CHILD))
SendMessageW( GetParent(hWnd), Msg, wParam, lParam );
else
SendMessageW( hWnd, WM_SYSCOMMAND, SC_KEYMENU, wParam );
break;
}
+ case WM_CLIENTSHUTDOWN:
+ {
+ LRESULT lResult;
+ NtUserMessageCall( hWnd, Msg, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, FALSE);
+ return lResult;
+ }
+
case WM_CANCELMODE:
{
iMenuSysKey = 0;
/* FIXME: Check for a desktop. */
- if (!(GetWindowLongW( hWnd, GWL_STYLE ) & WS_CHILD)) EndMenu();
+ if (!(GetWindowLongPtrW( hWnd, GWL_STYLE ) & WS_CHILD)) EndMenu();
if (GetCapture() == hWnd)
{
ReleaseCapture();
*/
case WM_QUERYDROPOBJECT:
{
- if (GetWindowLongW(hWnd, GWL_EXSTYLE) & WS_EX_ACCEPTFILES)
+ if (GetWindowLongPtrW(hWnd, GWL_EXSTYLE) & WS_EX_ACCEPTFILES)
{
return(1);
}
UINT Len;
HICON hIcon;
- hIcon = (HICON)GetClassLongW(hWnd, GCL_HICON);
+ hIcon = (HICON)GetClassLongPtrW(hWnd, GCL_HICON);
if (hIcon)
{
return ((LRESULT)hIcon);
case WM_SETICON:
{
INT Index = (wParam != 0) ? GCL_HICON : GCL_HICONSM;
- HICON hOldIcon = (HICON)GetClassLongW(hWnd, Index);
- SetClassLongW(hWnd, Index, lParam);
+ HICON hOldIcon = (HICON)GetClassLongPtrW(hWnd, Index);
+ SetClassLongPtrW(hWnd, Index, lParam);
SetWindowPos(hWnd, 0, 0, 0, 0, 0,
SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER);
case WM_GETICON:
{
INT Index = (wParam == ICON_BIG) ? GCL_HICON : GCL_HICONSM;
- return (GetClassLongW(hWnd, Index));
+ return (GetClassLongPtrW(hWnd, Index));
}
case WM_HELP:
case WM_QUERYUISTATE:
{
LRESULT Ret = 0;
- PWINDOW Wnd = ValidateHwnd(hWnd);
+ PWND Wnd = ValidateHwnd(hWnd);
if (Wnd != NULL)
{
if (Wnd->HideFocus)
BOOL AlwaysShowCues = FALSE;
WORD Action = LOWORD(wParam);
WORD Flags = HIWORD(wParam);
- PWINDOW Wnd;
+ PWND Wnd;
SystemParametersInfoW(SPI_GETKEYBOARDCUES, 0, &AlwaysShowCues, 0);
if (AlwaysShowCues)
break;
}
- if ((Wnd->Style & WS_CHILD) && Wnd->Parent != NULL)
+ if ((Wnd->style & WS_CHILD) && Wnd->spwndParent != NULL)
{
/* We're a child window and we need to pass this message down until
we reach the root */
- hWnd = UserHMGetHandle((PWINDOW)DesktopPtrToUser(Wnd->Parent));
+ hWnd = UserHMGetHandle((PWND)DesktopPtrToUser(Wnd->spwndParent));
}
else
{
BOOL AlwaysShowCues = FALSE;
WORD Action = LOWORD(wParam);
WORD Flags = HIWORD(wParam);
- PWINDOW Wnd;
+ PWND Wnd;
SystemParametersInfoW(SPI_GETKEYBOARDCUES, 0, &AlwaysShowCues, 0);
if (AlwaysShowCues)
LPARAM lParam)
{
LRESULT Result = 0;
- PWINDOW Wnd;
+ PWND Wnd;
SPY_EnterMessage(SPY_DEFWNDPROC, hWnd, Msg, wParam, lParam);
switch (Msg)
{
case WM_NCCREATE:
{
- LPCREATESTRUCTA cs = (LPCREATESTRUCTA)lParam;
- /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
- * may have child window IDs instead of window name */
-
- DefSetText(hWnd, (PCWSTR)cs->lpszName, TRUE);
-
- Result = 1;
+ if (lParam)
+ {
+ LPCREATESTRUCTA cs = (LPCREATESTRUCTA)lParam;
+ /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
+ * may have child window IDs instead of window name */
+ if (HIWORD(cs->lpszName))
+ {
+ DefSetText(hWnd, (PCWSTR)cs->lpszName, TRUE);
+ }
+ Result = 1;
+ }
break;
}
ULONG len;
Wnd = ValidateHwnd(hWnd);
- if (Wnd != NULL && Wnd->WindowName.Length != 0)
+ if (Wnd != NULL && Wnd->strName.Length != 0)
{
- buf = DesktopPtrToUser(Wnd->WindowName.Buffer);
+ buf = DesktopPtrToUser(Wnd->strName.Buffer);
if (buf != NULL &&
NT_SUCCESS(RtlUnicodeToMultiByteSize(&len,
buf,
- Wnd->WindowName.Length)))
+ Wnd->strName.Length)))
{
Result = (LRESULT) len;
}
Wnd = ValidateHwnd(hWnd);
if (Wnd != NULL && wParam != 0)
{
- if (Wnd->WindowName.Buffer != NULL)
- buf = DesktopPtrToUser(Wnd->WindowName.Buffer);
+ if (Wnd->strName.Buffer != NULL)
+ buf = DesktopPtrToUser(Wnd->strName.Buffer);
else
outbuf[0] = L'\0';
if (buf != NULL)
{
- if (Wnd->WindowName.Length != 0)
+ if (Wnd->strName.Length != 0)
{
- copy = min(Wnd->WindowName.Length / sizeof(WCHAR), wParam - 1);
+ copy = min(Wnd->strName.Length / sizeof(WCHAR), wParam - 1);
Result = WideCharToMultiByte(CP_ACP,
0,
buf,
{
DefSetText(hWnd, (PCWSTR)lParam, TRUE);
- if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
+ if ((GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
{
DefWndNCPaint(hWnd, (HRGN)1, -1);
}
LPARAM lParam)
{
LRESULT Result = 0;
- PWINDOW Wnd;
+ PWND Wnd;
SPY_EnterMessage(SPY_DEFWNDPROC, hWnd, Msg, wParam, lParam);
switch (Msg)
{
case WM_NCCREATE:
{
- LPCREATESTRUCTW cs = (LPCREATESTRUCTW)lParam;
- /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
- * may have child window IDs instead of window name */
+ if (lParam)
+ {
+ LPCREATESTRUCTW cs = (LPCREATESTRUCTW)lParam;
+ /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
+ * may have child window IDs instead of window name */
- DefSetText(hWnd, cs->lpszName, FALSE);
- Result = 1;
+ if (HIWORD(cs->lpszName))
+ {
+ DefSetText(hWnd, cs->lpszName, FALSE);
+ }
+ Result = 1;
+ }
break;
}
ULONG len;
Wnd = ValidateHwnd(hWnd);
- if (Wnd != NULL && Wnd->WindowName.Length != 0)
+ if (Wnd != NULL && Wnd->strName.Length != 0)
{
- buf = DesktopPtrToUser(Wnd->WindowName.Buffer);
+ buf = DesktopPtrToUser(Wnd->strName.Buffer);
if (buf != NULL &&
NT_SUCCESS(RtlUnicodeToMultiByteSize(&len,
buf,
- Wnd->WindowName.Length)))
+ Wnd->strName.Length)))
{
- Result = (LRESULT) (Wnd->WindowName.Length / sizeof(WCHAR));
+ Result = (LRESULT) (Wnd->strName.Length / sizeof(WCHAR));
}
}
else Result = 0L;
Wnd = ValidateHwnd(hWnd);
if (Wnd != NULL && wParam != 0)
{
- if (Wnd->WindowName.Buffer != NULL)
- buf = DesktopPtrToUser(Wnd->WindowName.Buffer);
+ if (Wnd->strName.Buffer != NULL)
+ buf = DesktopPtrToUser(Wnd->strName.Buffer);
else
outbuf[0] = L'\0';
if (buf != NULL)
{
- if (Wnd->WindowName.Length != 0)
+ if (Wnd->strName.Length != 0)
{
- Result = min(Wnd->WindowName.Length / sizeof(WCHAR), wParam - 1);
+ Result = min(Wnd->strName.Length / sizeof(WCHAR), wParam - 1);
RtlCopyMemory(outbuf,
buf,
Result * sizeof(WCHAR));
{
DefSetText(hWnd, (PCWSTR)lParam, FALSE);
- if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
+ if ((GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
{
DefWndNCPaint(hWnd, (HRGN)1, -1);
}