Home > Software engineering >  HOOK message processing
HOOK message processing

Time:10-03

WH_GETMESSAGE
How to get the current news message types, as well as the message contained in the parameter,

If I want to put the WM_LBUTTONDOWN intercepted and modified into VK_A do,

CodePudding user response:

In the reference MSDN98 own SPY++ source code fragment?
MSDN98_1. ISO http://pan.baidu.com/s/1dDF41ix, MSDN98_2. ISO http://pan.baidu.com/s/1bnGo0Vl

CodePudding user response:

 
LRESULT a CALLBACK GetMsgProc (int nCode, WPARAM WPARAM, LPARAM LPARAM)
{
.
If (WM_LBUTTONDOWN==(lParam) (MSG *) - & gt; Message)
{
(lParam) (MSG *) - & gt; Message=WM_KEYDOWN;
(lParam) (MSG *) - & gt; WParam=0 x41//A key
}
.
Return CallNextHookEx (... );
}

CodePudding user response:

refer to the second floor klinymao response:
 
LRESULT a CALLBACK GetMsgProc (int nCode, WPARAM WPARAM, LPARAM LPARAM)
{
.
If (WM_LBUTTONDOWN==(lParam) (MSG *) - & gt; Message)
{
(lParam) (MSG *) - & gt; Message=WM_KEYDOWN;
(lParam) (MSG *) - & gt; WParam=0 x41//A key
}
.
Return CallNextHookEx (... );
}
thank you! But I have a problem


The first is spy++ shows the form of news, the first one is I manually by pressing A button displays the message, the following two one is sendmessage messages sent, one is to modify the coma the news of the past, if it is three in the input box can be effective, but only if the program shortcut button manually press will take effect, the other two no reaction,

Would you please tell me why this is, SPY++ cRepeat scanfcode where and what's the meaning of behind the several parameters change?

CodePudding user response:

VS the IDE in don't understand the symbol on the right mouse button, choose to define or find all references,

CodePudding user response:

Use the hook to intercept mouse messages, after receiving the mouse messages, the current message interception, sends a VK_A message,

Are you intercept the global or intercept within the program,
  • Related