Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi WM_PASTE system-wide hook (https://www.delphipraxis.net/167687-wm_paste-system-wide-hook.html)

randy_dom 12. Apr 2012 16:47

WM_PASTE system-wide hook
 
Hi , Is there any way i can hook the Clipboard WM_PASTE operation , i know i must refer to WH_GetMessage hook procedure But really i don't how to implement it .

for WM_COPY i use this in a Hook Dll :

Delphi-Quellcode:
function SysMsgProc(Code:integer; wParam: Word; lParam: Longint) : longint; stdcall;
begin
CallNextHookEx(SysHook, Code, wParam, lParam);
if code = HC_ACTION then
begin
if TMsg(Pointer(lParam)^).message = WM_COPY then
MessageBox(0, 'Copy Operation Detected', 'my DLL', 0);
end;
end;
I need to hook the WM_PASTE for all Processes .


many thanks

Assarbad 14. Apr 2012 16:00

AW: WM_PASTE system-wide hook
 
System-wide? Simply put: nope there isn't. Each hook is limited to the window station in which it was installed.

But quite frankly it would make more sense had you also commented on what you are trying to achieve.

Installing a clipboard viewer, for example, is more than enough to achieve what you are trying with the WM_COPY hook you gave as sample code.

Aside from that each global hook (with few exceptions such as low-level keyboard hooks) causes the DLL with the hook function to be injected into the target process. This will only work if the bitness of process and DLL agree. If not, this will simply fail.


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:58 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz