mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 02:15:47 +00:00
post focus messages to different threads
svn path=/trunk/; revision=9121
This commit is contained in:
parent
b9a55f9ce0
commit
83af3eae1d
4 changed files with 69 additions and 23 deletions
|
@ -144,12 +144,17 @@ VOID FASTCALL
|
||||||
MsqIncPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
|
MsqIncPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
MsqDecPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
|
MsqDecPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
|
||||||
LRESULT STDCALL
|
LRESULT FASTCALL
|
||||||
IntSendMessage(HWND hWnd,
|
IntSendMessage(HWND hWnd,
|
||||||
UINT Msg,
|
UINT Msg,
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
LPARAM lParam);
|
LPARAM lParam);
|
||||||
LRESULT STDCALL
|
LRESULT FASTCALL
|
||||||
|
IntPostOrSendMessage(HWND hWnd,
|
||||||
|
UINT Msg,
|
||||||
|
WPARAM wParam,
|
||||||
|
LPARAM lParam);
|
||||||
|
LRESULT FASTCALL
|
||||||
IntSendMessageTimeout(HWND hWnd,
|
IntSendMessageTimeout(HWND hWnd,
|
||||||
UINT Msg,
|
UINT Msg,
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
|
@ -162,9 +167,9 @@ IntDispatchMessage(MSG* Msg);
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
IntTranslateKbdMessage(LPMSG lpMsg, HKL dwhkl);
|
IntTranslateKbdMessage(LPMSG lpMsg, HKL dwhkl);
|
||||||
|
|
||||||
VOID STDCALL
|
VOID FASTCALL
|
||||||
MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
VOID STDCALL
|
VOID FASTCALL
|
||||||
MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam);
|
MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam);
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
MsqInsertSystemMessage(MSG* Msg, BOOL RemMouseMoveMsg);
|
MsqInsertSystemMessage(MSG* Msg, BOOL RemMouseMoveMsg);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Id: focus.c,v 1.19 2004/02/24 13:27:03 weiden Exp $
|
* $Id: focus.c,v 1.20 2004/04/13 13:50:31 weiden Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <win32k/win32k.h>
|
#include <win32k/win32k.h>
|
||||||
|
@ -58,8 +58,8 @@ IntSendDeactivateMessages(HWND hWndPrev, HWND hWnd)
|
||||||
{
|
{
|
||||||
if (hWndPrev)
|
if (hWndPrev)
|
||||||
{
|
{
|
||||||
IntSendMessage(hWndPrev, WM_NCACTIVATE, FALSE, 0);
|
IntPostOrSendMessage(hWndPrev, WM_NCACTIVATE, FALSE, 0);
|
||||||
IntSendMessage(hWndPrev, WM_ACTIVATE,
|
IntPostOrSendMessage(hWndPrev, WM_ACTIVATE,
|
||||||
MAKEWPARAM(WA_INACTIVE, NtUserGetWindowLong(hWndPrev, GWL_STYLE, FALSE) & WS_MINIMIZE),
|
MAKEWPARAM(WA_INACTIVE, NtUserGetWindowLong(hWndPrev, GWL_STYLE, FALSE) & WS_MINIMIZE),
|
||||||
(LPARAM)hWnd);
|
(LPARAM)hWnd);
|
||||||
}
|
}
|
||||||
|
@ -71,9 +71,9 @@ IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
|
||||||
if (hWnd)
|
if (hWnd)
|
||||||
{
|
{
|
||||||
/* Send palette messages */
|
/* Send palette messages */
|
||||||
if (IntSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0))
|
if (IntPostOrSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0))
|
||||||
{
|
{
|
||||||
IntSendMessage(HWND_BROADCAST, WM_PALETTEISCHANGING,
|
IntPostOrSendMessage(HWND_BROADCAST, WM_PALETTEISCHANGING,
|
||||||
(WPARAM)hWnd, 0);
|
(WPARAM)hWnd, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,9 +83,9 @@ IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
|
||||||
|
|
||||||
/* FIXME: IntIsWindow */
|
/* FIXME: IntIsWindow */
|
||||||
|
|
||||||
IntSendMessage(hWnd, WM_NCACTIVATE, (WPARAM)(hWnd == NtUserGetForegroundWindow()), 0);
|
IntPostOrSendMessage(hWnd, WM_NCACTIVATE, (WPARAM)(hWnd == NtUserGetForegroundWindow()), 0);
|
||||||
/* FIXME: WA_CLICKACTIVE */
|
/* FIXME: WA_CLICKACTIVE */
|
||||||
IntSendMessage(hWnd, WM_ACTIVATE,
|
IntPostOrSendMessage(hWnd, WM_ACTIVATE,
|
||||||
MAKEWPARAM(MouseActivate ? WA_CLICKACTIVE : WA_ACTIVE,
|
MAKEWPARAM(MouseActivate ? WA_CLICKACTIVE : WA_ACTIVE,
|
||||||
NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_MINIMIZE),
|
NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_MINIMIZE),
|
||||||
(LPARAM)hWndPrev);
|
(LPARAM)hWndPrev);
|
||||||
|
@ -97,7 +97,7 @@ IntSendKillFocusMessages(HWND hWndPrev, HWND hWnd)
|
||||||
{
|
{
|
||||||
if (hWndPrev)
|
if (hWndPrev)
|
||||||
{
|
{
|
||||||
IntSendMessage(hWndPrev, WM_KILLFOCUS, (WPARAM)hWnd, 0);
|
IntPostOrSendMessage(hWndPrev, WM_KILLFOCUS, (WPARAM)hWnd, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ IntSendSetFocusMessages(HWND hWndPrev, HWND hWnd)
|
||||||
{
|
{
|
||||||
if (hWnd)
|
if (hWnd)
|
||||||
{
|
{
|
||||||
IntSendMessage(hWnd, WM_SETFOCUS, (WPARAM)hWndPrev, 0);
|
IntPostOrSendMessage(hWnd, WM_SETFOCUS, (WPARAM)hWndPrev, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -411,7 +411,7 @@ NtUserSetCapture(HWND hWnd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hWndPrev = ThreadQueue->CaptureWindow;
|
hWndPrev = ThreadQueue->CaptureWindow;
|
||||||
IntSendMessage(hWndPrev, WM_CAPTURECHANGED, 0, (LPARAM)hWnd);
|
IntPostOrSendMessage(hWndPrev, WM_CAPTURECHANGED, 0, (LPARAM)hWnd);
|
||||||
IntLockMessageQueue(ThreadQueue);
|
IntLockMessageQueue(ThreadQueue);
|
||||||
ThreadQueue->CaptureWindow = hWnd;
|
ThreadQueue->CaptureWindow = hWnd;
|
||||||
IntUnLockMessageQueue(ThreadQueue);
|
IntUnLockMessageQueue(ThreadQueue);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: message.c,v 1.56 2004/04/07 21:12:40 gvg Exp $
|
/* $Id: message.c,v 1.57 2004/04/13 13:50:31 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -373,7 +373,7 @@ NtUserPeekMessage(LPMSG UnsafeMsg,
|
||||||
return Present;
|
return Present;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL STDCALL
|
static BOOL FASTCALL
|
||||||
IntWaitMessage(HWND Wnd,
|
IntWaitMessage(HWND Wnd,
|
||||||
UINT MsgFilterMin,
|
UINT MsgFilterMin,
|
||||||
UINT MsgFilterMax)
|
UINT MsgFilterMax)
|
||||||
|
@ -651,7 +651,7 @@ MsgMemorySize(PMSGMEMORY MsgMemoryEntry, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static FASTCALL NTSTATUS
|
static NTSTATUS FASTCALL
|
||||||
PackParam(LPARAM *lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam)
|
PackParam(LPARAM *lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
NCCALCSIZE_PARAMS *UnpackedParams;
|
NCCALCSIZE_PARAMS *UnpackedParams;
|
||||||
|
@ -711,7 +711,7 @@ UnpackParam(LPARAM lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT STDCALL
|
LRESULT FASTCALL
|
||||||
IntSendMessage(HWND hWnd,
|
IntSendMessage(HWND hWnd,
|
||||||
UINT Msg,
|
UINT Msg,
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
|
@ -725,7 +725,7 @@ IntSendMessage(HWND hWnd,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LRESULT STDCALL
|
static LRESULT FASTCALL
|
||||||
IntSendMessageTimeoutSingle(HWND hWnd,
|
IntSendMessageTimeoutSingle(HWND hWnd,
|
||||||
UINT Msg,
|
UINT Msg,
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
|
@ -826,7 +826,7 @@ IntSendMessageTimeoutSingle(HWND hWnd,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT STDCALL
|
LRESULT FASTCALL
|
||||||
IntSendMessageTimeout(HWND hWnd,
|
IntSendMessageTimeout(HWND hWnd,
|
||||||
UINT Msg,
|
UINT Msg,
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
|
@ -924,6 +924,47 @@ CopyMsgToKernelMem(MSG *KernelModeMsg, MSG *UserModeMsg)
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This function posts a message if the destination's message queue belongs to
|
||||||
|
another thread, otherwise it sends the message. It does not support broadcast
|
||||||
|
messages! */
|
||||||
|
LRESULT FASTCALL
|
||||||
|
IntPostOrSendMessage(HWND hWnd,
|
||||||
|
UINT Msg,
|
||||||
|
WPARAM wParam,
|
||||||
|
LPARAM lParam)
|
||||||
|
{
|
||||||
|
LRESULT Result;
|
||||||
|
PWINDOW_OBJECT Window;
|
||||||
|
|
||||||
|
if(hWnd == HWND_BROADCAST)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Window = IntGetWindowObject(hWnd);
|
||||||
|
if(!Window)
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Window->MessageQueue != PsGetWin32Thread()->MessageQueue)
|
||||||
|
{
|
||||||
|
Result = NtUserPostMessage(hWnd, Msg, wParam, lParam);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(!IntSendMessageTimeoutSingle(hWnd, Msg, wParam, lParam, SMTO_NORMAL, 0, &Result))
|
||||||
|
{
|
||||||
|
Result = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IntReleaseWindowObject(Window);
|
||||||
|
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
static NTSTATUS FASTCALL
|
static NTSTATUS FASTCALL
|
||||||
CopyMsgToUserMem(MSG *UserModeMsg, MSG *KernelModeMsg)
|
CopyMsgToUserMem(MSG *UserModeMsg, MSG *KernelModeMsg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: msgqueue.c,v 1.82 2004/04/09 20:03:19 navaraf Exp $
|
/* $Id: msgqueue.c,v 1.83 2004/04/13 13:50:31 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -682,7 +682,7 @@ MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd,
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STDCALL
|
VOID FASTCALL
|
||||||
MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
PUSER_MESSAGE_QUEUE FocusMessageQueue;
|
PUSER_MESSAGE_QUEUE FocusMessageQueue;
|
||||||
|
@ -722,7 +722,7 @@ MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STDCALL
|
VOID FASTCALL
|
||||||
MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam)
|
MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
PWINDOW_OBJECT Window;
|
PWINDOW_OBJECT Window;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue