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 


message for mouse hovering over a control

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed Jul 16, 2008 6:22 pm    Post subject: message for mouse hovering over a control Reply with quote

I'm trying to find a message that's sent, or any API that alerts me when the mouse is hovered over a control. The main reason for this is so that when I make custom GUI applications that don't have a title bar, and I have to add the buttons for that. I want it to be able to change the color of them when they hover over and click on them. But I can't figure out the hover. I found the messages WM_MOUSEHOVER and WM_NCMOUSEHOVER but neither of those were specifically for a control.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
WafflesFTW
Expert Cheater
Reputation: 0

Joined: 21 Mar 2008
Posts: 131

PostPosted: Wed Jul 16, 2008 7:42 pm    Post subject: Reply with quote

look at the lparam of WM_MOUSEHOVER
Back to top
View user's profile Send private message AIM Address
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed Jul 16, 2008 9:08 pm    Post subject: Reply with quote

What am I supposed to do, make an if statement for each pixel? There has to be another way...
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Wed Jul 16, 2008 9:18 pm    Post subject: Reply with quote

No, he told you to check the lParam (Hadle to the control) of WM_MOUSEHOVER message.

You could also call ChildWindowFromPoint(Ex) on WM_MOUSEMOVE message.
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed Jul 16, 2008 9:33 pm    Post subject: Reply with quote

So either...

Code:

case WM_MOUSEHOVER:
   if(lParam == hExitButton) {
      //make brighter to represent hover
   }
   break;


or

Code:

case WM_MOUSEHOVER:
   POINT point;
   point.x = GET_X_LPARAM(lParam);
   point.y = GET_Y_LPARAM(lParam);
   HWND hwndControl = ChildWindowFromPoint(hWnd, &point);
   if(hWndControl == hExitButton) {
      //make brighter to represent hover
   }
   break;
}

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
WafflesFTW
Expert Cheater
Reputation: 0

Joined: 21 Mar 2008
Posts: 131

PostPosted: Thu Jul 17, 2008 8:01 am    Post subject: Reply with quote

This is exactly what you need I believe.
TrackMouseEvent();


http://www.megaupload.com/?d=U6CFYPQ9
Back to top
View user's profile Send private message AIM Address
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Thu Jul 17, 2008 8:47 am    Post subject: Reply with quote

Yea, TrackMouseEvent is used to generate the WM_MOUSEHOVER notification. So I guess it would really be like.

Code:

TRACKMOUSEEVENT tme;
tme.cbSize = sizeof(TRACKMOUSEEVENT);
tme.dwFlags = TME_HOVER;
tme.hwndTrack = hWnd;
tme.dwHoverTime = 10;
TrackMouseEvent(&tme);

case WM_HOVER:
   if(lParam == hExitButton) {
      //brighten to represent hover
   }
   break;

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
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