sorry was not clear enough have to update visual studio first. afxcontrolbar.h is not there.
I downloaded your example, compiled it and it gave on error on afx...h not avail.
I'm using Microsoft Visual Studio 2008 Pro Edition
Version 9.0.30729.1 SP
Loaded your hover project, THANKS!, worked super!
Made a new project called TEST, same style as your hover, worked super also.
Went back to my project, replace the bitmap button with a normal control button
(bitmap set to false) and quess what it worked.
Turned bitmap on again and owner draw to false
the project is still working (but at this time the bitmap is not visible, only the caption text)
Now the killer,
if i turn on bitmap and owner draw, both true. bitmap is visible.
but now the hotitemchange routine is not called.
so the change from standard button to bitmap button is the problem, i think ....
Run the Spy++ tool and look at the styles for the button and compare them with the styles for the owner drawn button. There might be a style missing that you can add back (to get the hover message to fire).
Also, if you installed the MFC source code when you installed Visual C++, you can step into the MFC source code during button creation to try to figure out the issue.
just an idea not sure that it will work but if you where to encapsulate the button in another class such as a view class and use the OnMouseMove or Hover message handler
I was already afraid you guys would came up with that idea….
So can’t use HOTITEMCHANGE, will revert to mouse tracking
Did some field work;
Have to use: mouse-leave, mouse-move and mouse-hover
ON_WM_MOUSEMOVE()
ON_WM_MOUSELEAVE()
ON_WM_MOUSEHOVER()
Mouse-move will house the tracking event, correct?
Mouse-hover will change the bitmap to focus
And
Mouse-leave will change it to normal again.
So I need to create a new class, let’s call it HOT.
Which type/base should I use, when I start the add class wizard?
And
How do I clue the class to the button using this new HOT class,
(I think something like select control and right click, do the add option…)
Can I use the same class (Hot) on more than one button or do
I have to make a HOT1 and HOT2 and so on.
I would use CView since it is simple and handles mouse messages and I would use it for one button if you want the action to happen just for that button and to glue it to the CView you make CView the base class
In my opinion, you should just derive from CButton and make it owner draw and handle ALL the drawing yourself. Since CButton derives from CWnd, it has all the mouse handling capabilities without all the overhead of a CView.
Somewhere I have a whole CButton owner-draw class that I used in some project or other for toolbar buttons. It handles hover and all the other button stuff. I'll see if I can dig it up.
I haven't been following this thread too closely. What version of VS are you using?
yeah i know its alot of overhead but it was just an idea that i had along time ago to encapsilate the onmousemove action in an owner drawn button to change the bitmap,in which i had dropped the action for now and will work on it when I am doing clean up code on appearance so if you have something better I would like to know myself so please post to this thread what you were posting thanks hoxsiew
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.