Author: jimtabor
Date: Wed Mar 30 08:19:52 2011
New Revision: 51203
URL:
http://svn.reactos.org/svn/reactos?rev=51203&view=rev
Log:
[User32|Win32k]
- Move EnableWindow to Win32k.
- Fix sign in class function.
Modified:
trunk/reactos/dll/win32/user32/windows/class.c
trunk/reactos/dll/win32/user32/windows/input.c
trunk/reactos/subsystems/win32/win32k/include/window.h
trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/dll/win32/user32/windows/class.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/c…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/class.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/class.c [iso-8859-1] Wed Mar 30 08:19:52 2011
@@ -933,7 +933,7 @@
WCHAR tmpbuf[MAX_ATOM_LEN + 1];
UINT len;
- if (cchType <= 0) return 0;
+ if ((INT)cchType <= 0) return 0;
if (!RealGetWindowClassW( hwnd, tmpbuf, sizeof(tmpbuf)/sizeof(WCHAR) )) return 0;
RtlUnicodeToMultiByteN( pszType, cchType - 1, (PULONG)&len, tmpbuf,
strlenW(tmpbuf) * sizeof(WCHAR) );
pszType[len] = 0;
Modified: trunk/reactos/dll/win32/user32/windows/input.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/i…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/input.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/input.c [iso-8859-1] Wed Mar 30 08:19:52 2011
@@ -100,7 +100,6 @@
#endif
}
-
/*
* @implemented
*/
@@ -108,42 +107,8 @@
EnableWindow(HWND hWnd,
BOOL bEnable)
{
- // This will soon be moved to win32k.
- BOOL Update;
- LONG Style = GetWindowLongPtrW(hWnd, GWL_STYLE);
- /* check if updating is needed */
- UINT bIsDisabled = (Style & WS_DISABLED);
- Update = bIsDisabled;
-
- if (bEnable)
- {
- Style &= ~WS_DISABLED;
- }
- else
- {
- Update = !bIsDisabled;
-
- SendMessageW( hWnd, WM_CANCELMODE, 0, 0);
-
- /* Remove keyboard focus from that window if it had focus */
- if (hWnd == GetFocus())
- {
- SetFocus(NULL);
- }
- Style |= WS_DISABLED;
- }
-
- NtUserSetWindowLong(hWnd, GWL_STYLE, Style, FALSE);
-
- if (Update)
- {
- IntNotifyWinEvent(EVENT_OBJECT_STATECHANGE, hWnd, OBJID_WINDOW, CHILDID_SELF,
0);
- SendMessageW(hWnd, WM_ENABLE, (LPARAM)bEnable, 0);
- }
- // Return nonzero if it was disabled, or zero if it wasn't:
- return bIsDisabled;
-}
-
+ return NtUserCallTwoParam((DWORD_PTR)hWnd, (DWORD_PTR)bEnable,
TWOPARAM_ROUTINE_ENABLEWINDOW);
+}
/*
* @implemented
Modified: trunk/reactos/subsystems/win32/win32k/include/window.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/window.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/window.h [iso-8859-1] Wed Mar 30
08:19:52 2011
@@ -111,4 +111,6 @@
PWND FASTCALL co_UserCreateWindowEx(CREATESTRUCTW*, PUNICODE_STRING, PLARGE_STRING);
WNDPROC FASTCALL IntGetWindowProc(PWND,BOOL);
+BOOL FASTCALL IntEnableWindow(HWND,BOOL);
+
/* EOF */
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] Wed Mar 30
08:19:52 2011
@@ -436,8 +436,7 @@
}
case TWOPARAM_ROUTINE_ENABLEWINDOW:
- UNIMPLEMENTED
- RETURN( 0);
+ RETURN( IntEnableWindow((HWND)Param1, (BOOL)Param2));
case TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS:
{
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Wed Mar 30 08:19:52
2011
@@ -174,6 +174,50 @@
}
return NULL;
+}
+
+BOOL
+FASTCALL
+IntEnableWindow( HWND hWnd, BOOL bEnable )
+{
+ BOOL Update;
+ PWND pWnd;
+ UINT bIsDisabled;
+
+ if(!(pWnd = UserGetWindowObject(hWnd)))
+ {
+ return FALSE;
+ }
+
+ /* check if updating is needed */
+ bIsDisabled = (pWnd->style & WS_DISABLED);
+ Update = bIsDisabled;
+
+ if (bEnable)
+ {
+ pWnd->style &= ~WS_DISABLED;
+ }
+ else
+ {
+ Update = !bIsDisabled;
+
+ co_IntSendMessage( hWnd, WM_CANCELMODE, 0, 0);
+
+ /* Remove keyboard focus from that window if it had focus */
+ if (hWnd == IntGetThreadFocusWindow())
+ {
+ co_UserSetFocus(NULL);
+ }
+ pWnd->style |= WS_DISABLED;
+ }
+
+ if (Update)
+ {
+ IntNotifyWinEvent(EVENT_OBJECT_STATECHANGE, pWnd, OBJID_WINDOW, CHILDID_SELF,
0);
+ co_IntSendMessage(hWnd, WM_ENABLE, (LPARAM)bEnable, 0);
+ }
+ // Return nonzero if it was disabled, or zero if it wasn't:
+ return bIsDisabled;
}
/*