 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Sat Oct 20, 2007 1:17 pm Post subject: [Delphi] GetDC problem |
|
|
hello guYsSssS,
I got a problem with GetDC, I wanna check some colors, here's an example:
| Code: | 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;
if Checkbox1.Checked = true then
PlaySound(PChar('sound_001.wav'),0,SND_ASYNC or SND_LOOP);
ShowMessage (inicurrent);
PlaySound(nil,0,0);
end
finally
DCanvas.Free;
end;
finally
if ReleaseDc(0, DHandle)<>1 then
RaiseLastOSError;
end;
end
else
RaiseLastOSError;
end; |
[For those who don't understand what this does: it can check colors on the entire screen.]
Well it does it on the entire screen cuz I seted GetDc's value to NULL/0.
But for example I wanna do that it's just checking in MapleStory. So:
| Code: | procedure TForm1.Timer1Timer(Sender: TObject);
var
DCanvas: TCanvas;
DHandle: HDC;
damn: HWND;
begin
damn := FindWindow(NIL, 'MapleStory');
DHandle:=GetDC(damn);
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;
if Checkbox1.Checked = true then
PlaySound(PChar('sound_001.wav'),0,SND_ASYNC or SND_LOOP);
ShowMessage (inicurrent);
PlaySound(nil,0,0);
end
finally
DCanvas.Free;
end;
finally
if ReleaseDc(0, DHandle)<>1 then
RaiseLastOSError;
end;
end
else
RaiseLastOSError;
end; |
But why does it still dedect (the color) on my DESKTOP ? |
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Sat Oct 20, 2007 1:39 pm Post subject: |
|
|
| gameguard block you |
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Sat Oct 20, 2007 1:41 pm Post subject: |
|
|
| no, thats not the problem, if I use GetDc with maplestorys window so it should't check the colors on the desktop, but it does still. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|