Click here to Skip to main content
15,920,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: NTLM Authentication Pin
Hamid_RT23-Apr-06 18:35
Hamid_RT23-Apr-06 18:35 
GeneralRe: NTLM Authentication Pin
JimmyRopes23-Apr-06 22:16
professionalJimmyRopes23-Apr-06 22:16 
GeneralRe: NTLM Authentication Pin
JimmyRopes26-Apr-06 16:13
professionalJimmyRopes26-Apr-06 16:13 
GeneralRe: NTLM Authentication Pin
Ryan Binns26-Apr-06 18:04
Ryan Binns26-Apr-06 18:04 
GeneralRe: NTLM Authentication Pin
JimmyRopes26-Apr-06 19:07
professionalJimmyRopes26-Apr-06 19:07 
QuestionHow`to erase white line I have drawn? Pin
chybin21-Apr-06 16:36
chybin21-Apr-06 16:36 
AnswerRe: How`to erase white line I have drawn? Pin
Christian Graus21-Apr-06 19:57
protectorChristian Graus21-Apr-06 19:57 
AnswerRe: How`to erase white line I have drawn? Pin
Nishad S21-Apr-06 21:41
Nishad S21-Apr-06 21:41 
It is better you go for ownerdrawn button...

You can track mouse enter like this...
bool m_bMouseInside = false;

void MyButton::OnMouseMove( UINT nFlags, CPoint point ) 
{
    if( !m_bMouseInside )
    {
        m_bMouseInside = true;
        TRACKMOUSEEVENT stTME = { 0 };
        stTME.cbSize    = sizeof( stTME );
        stTME.dwFlags   = TME_LEAVE;
        stTME.hwndTrack = m_hWnd;
        _TrackMouseEvent( &stTME );
        Invalidate( FALSE );
    }

    CButton::OnMouseMove( nFlags, point );
}
<pre>

Then you will get a mouse leave message. You have to map it like...
<pre>
BEGIN_MESSAGE_MAP(LinkButton, CButton)
    ON_MESSAGE( WM_MOUSELEAVE, OnMouseLeave )
END_MESSAGE_MAP()

LRESULT LinkButton::OnMouseLeave( WPARAM, LPARAM )
{
    m_bMouseInside = false;
    Invalidate( FALSE );
    return 0;
}


So your DrawItem will be called when the mouse enters and leaves the button. You should check the m_bMouseInside flag to draw the border.

Good Luck!

- NS -
AnswerRe: How`to erase white line I have drawn? Pin
John R. Shaw22-Apr-06 23:32
John R. Shaw22-Apr-06 23:32 
AnswerRe: How`to erase white line I have drawn? Pin
Hamid_RT23-Apr-06 18:55
Hamid_RT23-Apr-06 18:55 
QuestionHow`to get message i have posted? Pin
chybin21-Apr-06 16:32
chybin21-Apr-06 16:32 
AnswerRe: How`to get message i have posted? Pin
Aqueel21-Apr-06 17:47
Aqueel21-Apr-06 17:47 
QuestionWhat is a top-level/popup/overlapped window? Pin
XXKKFF21-Apr-06 15:32
XXKKFF21-Apr-06 15:32 
QuestionI want nude windows! (no titlebar, no border, nothing) Pin
chasetoys21-Apr-06 13:31
chasetoys21-Apr-06 13:31 
AnswerRe: I want nude windows! (no titlebar, no border, nothing) Pin
XXKKFF21-Apr-06 15:17
XXKKFF21-Apr-06 15:17 
QuestionPower Management Pin
Slohnda21-Apr-06 10:21
Slohnda21-Apr-06 10:21 
QuestionRe: Power Management Pin
David Crow21-Apr-06 10:54
David Crow21-Apr-06 10:54 
Question'delete' operator Pin
Ali Tavakol21-Apr-06 7:42
Ali Tavakol21-Apr-06 7:42 
AnswerRe: 'delete' operator Pin
Maxwell Chen21-Apr-06 7:50
Maxwell Chen21-Apr-06 7:50 
AnswerRe: 'delete' operator Pin
David Crow21-Apr-06 9:12
David Crow21-Apr-06 9:12 
QuestionProblem with CSocket Listen function Pin
jpyp21-Apr-06 7:28
jpyp21-Apr-06 7:28 
AnswerRe: Problem with CSocket Listen function Pin
basementman21-Apr-06 8:35
basementman21-Apr-06 8:35 
GeneralRe: Problem with CSocket Listen function Pin
jpyp21-Apr-06 9:39
jpyp21-Apr-06 9:39 
QuestionHow to use Spy++? Pin
XXKKFF21-Apr-06 6:46
XXKKFF21-Apr-06 6:46 
AnswerRe: How to use Spy++? Pin
Eric Dahlvang21-Apr-06 6:52
Eric Dahlvang21-Apr-06 6:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.