Tikitiki Posted July 31, 2005 Share Posted July 31, 2005 I wanted to know if there is a function in C++, that is called on if your mouse hovers over something, and how to use it? Link to comment Share on other sites More sharing options...
0 AndreasV Posted July 31, 2005 Share Posted July 31, 2005 C++ doesn't include the notion of a mouse. It would be easier if you told us the platform you are working on. For Windows, it would look something like this: BOOL bIsFirstMouseMove = FALSE; WndProc(......) switch(msg) { case WM_MOUSEMOVE: if(bIsFirstMouseMove) { TRACKMOUSEVENT tme = {......}; TrackMouseEvent(&tme); OnMouseEnter(); // your handler bIsFirstMouseMove = FALSE; } break; case WM_MOUSELEAVE: OnMouseLeave(); // your handler bIsFirstMouseMove = TRUE; break; } Link to comment Share on other sites More sharing options...
0 +virtorio MVC Posted July 31, 2005 MVC Share Posted July 31, 2005 C++ what? Borland VCL, MFC, WinAPI or an API on some other platform? There are Windows Messages WM_MOUSEMOVE (you should also be able to use WM_MOUSEHOVER) and WM_MOUSELEAVE you can respond to to detect when the mouse enters and leaves the client area of a Window (control). edit: yea, just like the post above Link to comment Share on other sites More sharing options...
0 Tikitiki Posted July 31, 2005 Author Share Posted July 31, 2005 uhm Windows Form Application? (.net) edit: yea, windows. Thx! Link to comment Share on other sites More sharing options...
Question
Tikitiki
I wanted to know if there is a function in C++, that is called on if your mouse hovers over something, and how to use it?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts