Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C++/WinAPI equivalent to PixelGetColor

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Varreon
Advanced Cheater
Reputation: 0

Joined: 13 Jun 2007
Posts: 80

PostPosted: Sun Jul 08, 2007 4:54 pm    Post subject: C++/WinAPI equivalent to PixelGetColor Reply with quote

Ive decided to make a macro which finds a color and clicks it. I have previously been very sucessfull at autoclickers, but I am having troubling finding a Windows API equivalent to the autohotkey function:

PixelGetColor():
Retrieves the color of the pixel at the specified x,y screen coordinates.

Any Help appreciated!

_________________
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Sun Jul 08, 2007 4:55 pm    Post subject: Reply with quote

GetPixel
Back to top
View user's profile Send private message
Varreon
Advanced Cheater
Reputation: 0

Joined: 13 Jun 2007
Posts: 80

PostPosted: Sun Jul 08, 2007 5:15 pm    Post subject: Reply with quote

Wow... I can see the resemblance. How do i get a handle to the device? or can i just ignore that argument?
_________________
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Sun Jul 08, 2007 5:21 pm    Post subject: Reply with quote

GetDC
Back to top
View user's profile Send private message
UnLmtD
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 894
Location: Canada

PostPosted: Sun Jul 08, 2007 5:22 pm    Post subject: Reply with quote

Edited... -_-" beated me to it
_________________
Back to top
View user's profile Send private message
Varreon
Advanced Cheater
Reputation: 0

Joined: 13 Jun 2007
Posts: 80

PostPosted: Sun Jul 08, 2007 5:31 pm    Post subject: Reply with quote

Thanks guys!

Edit:
Ok, Ive got another issue. While trying to get the window handle, i get failures. Heres my code snippet:

void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
process = FindWindow(NULL,Edit1->Text.c_str());
if (process ==NULL){
ShowMessage("Error");
}
else{
ShowMessage("Success");
}
}
Edit1->Text is the exe name (for example, firefox.exe), but i always get "Erro

_________________
Back to top
View user's profile Send private message
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Sun Jul 08, 2007 7:15 pm    Post subject: Reply with quote

The documentation of FindWindow clearly states that the second parameter is the title of the window, not the name of the exe. So instead of "firefox.exe", type in the name of the window that you see in your task bar.
_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
Varreon
Advanced Cheater
Reputation: 0

Joined: 13 Jun 2007
Posts: 80

PostPosted: Sun Jul 08, 2007 7:48 pm    Post subject: Reply with quote

Thanks! I'll try that.
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites