This is really great, thankyou.
I am having a minor problem.
I have integrated your class into my program. But when I left-click on one of my buttons, I cannot hold the button down... as soon as I left-click the button, it performs the BN_CLICKED for the button.
This should be happening when I release the left-click, what am I doing wrong?
There is a flaw in the way you are unhightlighting buttons (via trapping WM_MOUSEMOVE messages). For example, if you place the buttons together such that there is little or no gap between them, or if you place a button near the edge of the dialog.
In such cases, the dialog may not receive a WM_MOUSEMOVE message and one or more buttons can remain highlighted.
A solution I found is to use mouse capturing instead of trapping WM_MOUSEMOVE.
*Added June 03, 2002*
I found a small bug with using mouse capturing (which I could not fix). Hence, I found a cleaner solution, which is to use TrackMouseEvent and trapping WM_MOUSELEAVE. This works great so far!
It's a very good sample!
I want to ask what's the use of function shown below
void CBmpButsDlg::OnLButtonDown(UINT nFlags, CPoint point)
// TODO: Add your message handler code here and/or call default
PostMessage( WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM( point.x, point.y));
If I put "//" before "PostMessage(......)", I got the same
result after I run it. why?
What is the function of Message of WM_NCLBUTTONDOWN?