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 


[question] pressing an image (C++)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Fri Feb 27, 2009 10:35 am    Post subject: [question] pressing an image (C++) Reply with quote

how would i make an image on my form to become clickable?
i mean if i'll click it so some code will run...
Back to top
View user's profile Send private message  
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Fri Feb 27, 2009 10:47 am    Post subject: Reply with quote

You might be able to use ChildWindowFromPoint.. If your using a static control for your image. If so try filterting WM_LBUTTONDOWN/UP and check if it works.
_________________
Back to top
View user's profile Send private message  
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Fri Feb 27, 2009 11:49 am    Post subject: Reply with quote

yeah i tried filtering left button click but it failed
i first defined rectangle that contains the image coordinates
then checked if the cursor's position is somewhere at the rectangle's space
but what's the idea of using childwindowfrompoint ?
when will it be called ?
edit:
i think i got your idea
at the left button message i'll call this api with the current position of the cursor
and if it won't be null so it's at the image's space ?!
Back to top
View user's profile Send private message  
iNoobHacker
Advanced Cheater
Reputation: 0

Joined: 05 Nov 2006
Posts: 99

PostPosted: Fri Feb 27, 2009 12:27 pm    Post subject: Reply with quote

He meant that if you used a static control for your image you can use the ChildWindowFromPoint API.

You can simply do this when a WM_LBUTTONUP message arrives:
Code:
if (PtInRect(ImageRect, (POINT)lParam))
{
...
}
Back to top
View user's profile Send private message  
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Fri Feb 27, 2009 1:17 pm    Post subject: Reply with quote

awesome thx
didn't know about that api PtInRect
btw how would i change the icon of my executable file?
Back to top
View user's profile Send private message  
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Fri Feb 27, 2009 1:36 pm    Post subject: Reply with quote

I think you can also place an image on a normal button control (You could use Styles to make the button edge not show) but I'm not sure. (Maybe that's VB or whatever)

For the icon: just include an icon in your resource file and it will automatically become your application's icon.
Back to top
View user's profile Send private message  
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Fri Feb 27, 2009 2:11 pm    Post subject: Reply with quote

grate thx :]
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