Hey leute,
Ich have folgendes problem:
Ich hab das hier, was bis jetzt immer in einem timer stand:
Delphi-Quellcode:
procedure TForm1.Timer1Timer(Sender: TObject);
var
DCanvas: TCanvas;
DHandle: HDC;
begin
DHandle:=GetDC(0);
if DHandle<>0
then
begin
try
DCanvas:=TCanvas.Create;
try
DCanvas.Handle:=DHandle;
if DCanvas.Pixels[293, 335] =
RGB(239, 239, 239 )
then
begin
Timer1.Enabled := false;
Timer2.Enabled := false;
Label4.Caption := inicurrent;
Label4.Visible := true;
Label5.Visible := true;
Ini := TIniFile.Create(ExtractFilePath(ParamStr(0))+'
LastPin_CorrectPin.txt');
Ini.WriteString('
rCracker', '
Correct Pin', inicurrent);
if Checkbox1.Checked = true
then
PlaySound(PChar('
logged.wav'),0,SND_ASYNC
or SND_LOOP);
ShowMessage ('
yupp');
PlaySound(
nil,0,0);
end
finally
DCanvas.Free;
end;
finally
if ReleaseDc(0, DHandle)<>1
then
RaiseLastOSError;
end;
end
else
RaiseLastOSError;
end;
Doch ich will das jetzt anders machen und zwar so:
Den timer löschen und ne eigene procedure draus machen, also:
Delphi-Quellcode:
procedure logcheck();
var
DCanvas: TCanvas;
DHandle: HDC;
begin
DHandle:=GetDC(0);
if DHandle<>0
then
begin
try
DCanvas:=TCanvas.Create;
try
DCanvas.Handle:=DHandle;
if DCanvas.Pixels[293, 335] =
RGB(239, 239, 239 )
then
begin
Timer2.Enabled := false;
Label4.Caption := inicurrent;
Label4.Visible := true;
Label5.Visible := true;
Ini := TIniFile.Create(ExtractFilePath(ParamStr(0))+'
LastPin_CorrectPin.txt');
Ini.WriteString('
rCracker', '
Correct Pin', inicurrent);
if Checkbox1.Checked = true
then
PlaySound(PChar('
logged.wav'),0,SND_ASYNC
or SND_LOOP);
ShowMessage ('
Eingeloggt, Pin ist: '+inicurrent);
PlaySound(
nil,0,0);
end
finally
DCanvas.Free;
end;
finally
if ReleaseDc(0, DHandle)<>1
then
RaiseLastOSError;
end;
end
else
RaiseLastOSError;
end;
Also damit ich das dann per button einfach mit LogCheck() durchführen kann. Doch aufeinamal sagt delphi:
Code:
[Error] Main.pas(138): Undeclared identifier: 'Timer2'
Obwohl diese timer immernoch da ist, woran kann das liegen?
[edit=SirThornberry]code-Tags durch delphi-Tags ersetzt - Mfg, SirThornberry[/edit]