I'm having a bit of trouble getting the tooltip text to appear. I'm building an ActiveX control that utilizes "hover" and "tooltips". The hover aspect works fine, but, the tooltip text does not appear. If anyone is interested in helping me, I'll send some code.
Try creating a Bitmap Button were the Disabled state is when most is not over the button and the Enabled state is when it is over the button. After creating the button, position it where you wish and disable it. When the button is disabled all OnMouseMove messages go to the parent window instead of the button. You can then test the position of the mouse in the window to see if it is over the button. Then enable the button to be clicked. When the mouse moves out of the area it will receive the OnMouseMove message and you can disable the button. It is easier to test for rectangler regions but with a little math any region can be tested for. Use the SetWindowRgn fuction in vc++ to shape the button. The only bug is that if you move into another window without sending a OnMouseMove message, the button stays enabled until the mouse is moved back.
Your class has a main error whose senario is as
At a time there is only one button is on and all other buttons are off. Take mouse over any off state button with left button Down and then leave the left button.It will calls left button up. In this way the two radio buttons become on. Which is wrong.
I like your radio Hoverbutton class.
It works fine !
I only noticed that setting the background color of the bitmaps
to (192,192,192) works fine in W98 but not in W2000.
The 'COLOR_BTNFACE' is diferent !
W2000 -> (212,208,200)
The difference is not much, but you can still see it on your dialog.
I replaced your 'BitBlt' with the code below for 'transparent bit blitting'.
'TransparentBlt' however, only works for W98 and W2000.
You can use any transparent color for your bitmap background, but i suggest
you use (200,200,200) so that the code will also work for W95/NT4.0 (?).
(I only have W98/W2000, so I could not test it for W95/NT4.0).
The code below uses pixel(0,0) to get the transparent color.
The transparent color must not exist in your button image !
For example, if you use 'magenta' for your background, magenta must not exist
in the button image. Otherwise the (lightgray) underground will shine through.
// TransparentBlt only for Win2000 and Win98
if(!pDC->BitBlt(0, 0, rc.Width(), rc.Height(), &memDC,
0, 0, SRCCOPY))
note: use msimg32.dll/msimg32.lib
Thanks again !
Hope this helps...
the statement '!TransparentBlt' (note the .not.) will probably not work
in W95/NT4.0. This was done to give 'BitBlt' a chance to do the work.
But there must be a way to figure out if the function is available in W95/NT4.0.
I have seen such a piece of code somewhere, but i cannot remember...
what if i have to add a tip to my button on the head of the mouse pointer ??
uptill now i hav seen only tooltips but not a button tip help anywhere ??
should i add a ? button on the sys menu bar and then create a .hlp file for it ??
any other way of doin the same thing ??
I managed to change a few things to get the code changned
for a regular Button (not radio). However, it doesn't
want respond to the first CLICK of the button for some reason? Here's the main area I changed: