mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 18:01:07 +00:00
[User32|Win32k]
- Move EnableWindow to Win32k. - Fix sign in class function. svn path=/trunk/; revision=51203
This commit is contained in:
parent
815eb466ba
commit
88339aa831
|
@ -933,7 +933,7 @@ RealGetWindowClassA(
|
|||
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;
|
||||
|
|
|
@ -100,7 +100,6 @@ DragDetect(
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
@ -108,43 +107,9 @@ BOOL WINAPI
|
|||
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
|
||||
*/
|
||||
|
|
|
@ -111,4 +111,6 @@ VOID FASTCALL IntNotifyWinEvent(DWORD, PWND, LONG, LONG, DWORD);
|
|||
PWND FASTCALL co_UserCreateWindowEx(CREATESTRUCTW*, PUNICODE_STRING, PLARGE_STRING);
|
||||
WNDPROC FASTCALL IntGetWindowProc(PWND,BOOL);
|
||||
|
||||
BOOL FASTCALL IntEnableWindow(HWND,BOOL);
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -436,8 +436,7 @@ NtUserCallTwoParam(
|
|||
}
|
||||
|
||||
case TWOPARAM_ROUTINE_ENABLEWINDOW:
|
||||
UNIMPLEMENTED
|
||||
RETURN( 0);
|
||||
RETURN( IntEnableWindow((HWND)Param1, (BOOL)Param2));
|
||||
|
||||
case TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS:
|
||||
{
|
||||
|
|
|
@ -176,6 +176,50 @@ IntGetParent(PWND Wnd)
|
|||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
* IntWinListChildren
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue