Home > Software engineering >  Consult with what type of hook to intercept WM_CUT, WM_COPY
Consult with what type of hook to intercept WM_CUT, WM_COPY

Time:09-28

Consult with what type of hook to intercept WM_CUT, WM_COPY

CodePudding user response:

Try WH_CALLWNDPROC

CodePudding user response:

reference 1st floor zgl7903 response:
try WH_CALLWNDPROC

Tried wparam is essentially 0
With the wm_copy and cut the gap is quite big

CodePudding user response:

SPY++ under test to see if they can catch

CodePudding user response:

reference zgl7903 reply: 3/f
SPY++ under test, and see if I can capture the

The problem is that I use see wparam value is a single global hooks, changed a lot of kinds of hooks are, wm_ is judging by the wparam

CodePudding user response:

reference 1st floor zgl7903 response:
try WH_CALLWNDPROC


The static LRESULT CALLBACK InternalKeyboardHookCallback (int code, WPARAM WPARAM, LPARAM LPARAM)
{
Char chInput [512].
Sprintf (chInput, "int code=% d, WPARAM WPARAM=% d, LPARAM LPARAM=% d; Wparam \ n ", code, lparam);
OutputDebugString (chInput);

CodePudding user response:

Auspicious see CallWndProc ,

WParam [in]
Type: WPARAM
Specifies been the message was sent by the current thread. If the message was sent by the current thread, it is nonzero; Otherwise, it is zero.
LParam [in]
Type: LPARAM
A pointer to A CWPSTRUCT structure that contains the details about the message.

CodePudding user response:

refer to 6th floor zgl7903 response:
auspicious see CallWndProc ,

WParam [in]
Type: WPARAM
Specifies been the message was sent by the current thread. If the message was sent by the current thread, it is nonzero; Otherwise, it is zero.
LParam [in]
Type: LPARAM
A pointer to A CWPSTRUCT structure that contains the details about the message.


Originally this but with callproc message or can't get wm_copy reach the COMMAND and so on

CodePudding user response:

WM_COPY
An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format.

WM_COPY
WParam=0;//not 2; Must be zero
LParam=0;//not 2; Must be zero

CodePudding user response:

refer to the eighth floor schlafenhamster response:
WM_COPY
An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format.

WM_COPY
WParam=0;//not 2; Must be zero
LParam=0;//not 2; Must be zero

I am using ordinary textbox controls the WPF, and if I hang up global hook, why the notepad copy outside the program, to wm_copy without cut, winproc is the use

CodePudding user response:

"Why the program outside of the notepad" not Edit controls?

CodePudding user response:

The
references to the tenth floor schlafenhamster response:
"why this program outside of the notepad" not Edit controls?


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
My understanding is global hooks should be intercepted notepad wm_copy news such as

Notepad is not Edit?
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

That is one of the Edit basic textbox control is not intercepted captured only to the clipboard has altered information

Whether wm_copy extraction in shear plate structure?

CodePudding user response:

You send a textbox WM_COPY look? Such as

Char TXT [40].
PWndEdit1000 - & gt; The SendMessage (WM_COPY, 0, 0);//COPY data to the clipboard
GetCBtext (TXT);//the data on the clipboard to TXT [40], remove the input box value

CodePudding user response:

refer to 12 floor schlafenhamster reply:
then you send a textbox WM_COPY look? Such as

Char TXT [40].
PWndEdit1000 - & gt; The SendMessage (WM_COPY, 0, 0);//COPY data to the clipboard
GetCBtext (TXT);//the data on the clipboard to TXT [40], remove the input box value


Debug. WriteLine (the string. Format (" -- -- -- -- -- -- -- -- -- the send win32 copy -- -- -- -- -- -- -- -- -- - "));
IntPtr HWND=((HwndSource) PresentationSource FromVisual (txt_n1)). The Handle;
SendMessage (HWND WM_COPY, 0, 0);

I am going to send WM_COPY the control, monitoring, is this why

CodePudding user response:



refer to 12 floor schlafenhamster reply:
then you send a textbox WM_COPY look? Such as

Char TXT [40].
PWndEdit1000 - & gt; The SendMessage (WM_COPY, 0, 0);//COPY data to the clipboard
GetCBtext (TXT);//the data on the clipboard to TXT [40], remove the input box value


If the clipboard can capture news, I can't distinguish the copy from the cut, because both cause shear plate messaging

CodePudding user response:

"An application sends the WM_COPY message"

Is just what we want to send MSG program!

There is no hair, how to respond?

CodePudding user response:

Usually in a process, not hair WM_COPY, because do not need to the clipboard

CodePudding user response:

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull