* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id$
- *
+/*
* PROJECT: ReactOS user32.dll
- * FILE: lib/user32/windows/input.c
+ * FILE: dll/win32/user32/windows/input.c
* PURPOSE: Input
* PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
* UPDATE HISTORY:
HWND hWnd,
POINT pt)
{
-#if 0
return NtUserDragDetect(hWnd, pt);
-#else
+#if 0
MSG msg;
RECT rect;
POINT tmp;
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);
- if ( (bIsDisabled && bEnable) || (!bIsDisabled && !bEnable) )
+ Update = bIsDisabled;
+
+ if (bEnable)
{
- if (bEnable)
- {
- Style &= ~WS_DISABLED;
- }
- else
- {
- Style |= WS_DISABLED;
- /* Remove keyboard focus from that window if it had focus */
- if (hWnd == GetFocus())
- {
- SetFocus(NULL);
- }
- }
- NtUserSetWindowLong(hWnd, GWL_STYLE, Style, FALSE);
+ Style &= ~WS_DISABLED;
+ }
+ else
+ {
+ Update = !bIsDisabled;
- SendMessageA(hWnd, WM_ENABLE, (LPARAM) IsWindowEnabled(hWnd), 0);
+ 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 IsWindowEnabled(hWnd);
+ return bIsDisabled;
}
int WINAPI
ToAscii(UINT uVirtKey,
UINT uScanCode,
- CONST PBYTE lpKeyState,
+ CONST BYTE *lpKeyState,
LPWORD lpChar,
UINT uFlags)
{
int WINAPI
ToAsciiEx(UINT uVirtKey,
UINT uScanCode,
- CONST PBYTE lpKeyState,
+ CONST BYTE *lpKeyState,
LPWORD lpChar,
UINT uFlags,
HKL dwhkl)
int WINAPI
ToUnicode(UINT wVirtKey,
UINT wScanCode,
- CONST PBYTE lpKeyState,
+ CONST BYTE *lpKeyState,
LPWSTR pwszBuff,
int cchBuff,
UINT wFlags)
int WINAPI
ToUnicodeEx(UINT wVirtKey,
UINT wScanCode,
- CONST PBYTE lpKeyState,
+ CONST BYTE *lpKeyState,
LPWSTR pwszBuff,
int cchBuff,
UINT wFlags,
HKL dwhkl)
{
- return NtUserToUnicodeEx( wVirtKey, wScanCode, lpKeyState, pwszBuff, cchBuff,
+ return NtUserToUnicodeEx( wVirtKey, wScanCode, (PBYTE)lpKeyState, pwszBuff, cchBuff,
wFlags, dwhkl );
}