06-09-2010, 09:50 PM
و عليكم السلام و رحمة الله و بركاته
1- راجع الدالة SetWindowsHookEx , التي تتيح لنا إظافة Hook الى الـ Hook queue
2- البارامتر الأخير DwThreadId ا:
3- مثال بسيط :
بالتوفيق,,
1- راجع الدالة SetWindowsHookEx , التي تتيح لنا إظافة Hook الى الـ Hook queue
2- البارامتر الأخير DwThreadId ا:
PHP كود :
The identifier of the thread with which the hook procedure is to be associated. If this parameter is zero, the hook procedure is associated with all existing threads running in the same desktop as the calling thread.
PHP كود :
function SetHookUp: Boolean; stdcall;
begin
CurrentHook := SetWindowsHookEx(WH_KEYBOARD //Hook Type .
, @HookProc // Hook Proc Address .
, Hinstance //dll Handle .
, GetTrgProcessId('Explorer.exe') //if 0 then it is a Global Hook ; No specified Thread !
);
if CurrentHook <> 0 then
Result := True else
Result := False;
end;
I'M Fly Like A G6

