Click here to Skip to main content
15,909,591 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: "urgent""""how to read a file ?? Pin
Jörgen Sigvardsson28-Jun-04 10:12
Jörgen Sigvardsson28-Jun-04 10:12 
GeneralRe: "urgent""""how to read a file ?? Pin
Nick Parker28-Jun-04 10:59
protectorNick Parker28-Jun-04 10:59 
Generallinking problem with <complex> Pin
PDHB28-Jun-04 7:36
PDHB28-Jun-04 7:36 
GeneralRe: linking problem with &lt;complex&gt; Pin
Anthony_Yio28-Jun-04 17:06
Anthony_Yio28-Jun-04 17:06 
GeneralRe: linking problem with &lt;complex&gt; Pin
PDHB29-Jun-04 5:26
PDHB29-Jun-04 5:26 
Question[MFC] OnToolHitTest not working well? Pin
Maarten Kools28-Jun-04 7:04
professionalMaarten Kools28-Jun-04 7:04 
Generalperform action on close [X] button Pin
elephantstar28-Jun-04 6:58
elephantstar28-Jun-04 6:58 
GeneralRe: perform action on close [X] button Pin
Neville Franks28-Jun-04 10:07
Neville Franks28-Jun-04 10:07 
GeneralRe: perform action on close [X] button Pin
elephantstar28-Jun-04 11:16
elephantstar28-Jun-04 11:16 
GeneralRe: perform action on close [X] button Pin
Neville Franks28-Jun-04 11:28
Neville Franks28-Jun-04 11:28 
GeneralRe: perform action on close [X] button Pin
elephantstar28-Jun-04 12:25
elephantstar28-Jun-04 12:25 
GeneralRe: perform action on close [X] button Pin
Neville Franks28-Jun-04 12:31
Neville Franks28-Jun-04 12:31 
GeneralRe: perform action on close [X] button Pin
elephantstar28-Jun-04 12:41
elephantstar28-Jun-04 12:41 
GeneralRe: perform action on close [X] button Pin
Neville Franks28-Jun-04 12:48
Neville Franks28-Jun-04 12:48 
GeneralRe: perform action on close [X] button Pin
elephantstar28-Jun-04 13:13
elephantstar28-Jun-04 13:13 
GeneralRe: perform action on close [X] button Pin
Neville Franks28-Jun-04 13:20
Neville Franks28-Jun-04 13:20 
GeneralRe: perform action on close [X] button Pin
elephantstar28-Jun-04 14:51
elephantstar28-Jun-04 14:51 
GeneralRe: perform action on close [X] button Pin
Neville Franks28-Jun-04 14:57
Neville Franks28-Jun-04 14:57 
GeneralRe: perform action on close [X] button Pin
elephantstar29-Jun-04 8:23
elephantstar29-Jun-04 8:23 
GeneralRe: perform action on close [X] button Pin
Neville Franks29-Jun-04 10:38
Neville Franks29-Jun-04 10:38 
GeneralRe: perform action on close [X] button Pin
elephantstar29-Jun-04 13:01
elephantstar29-Jun-04 13:01 
GeneralRe: perform action on close [X] button Pin
Neville Franks29-Jun-04 13:43
Neville Franks29-Jun-04 13:43 
You could try using CMyView::OnNcLButtonDown() to work out if the close button is pressed or code like:


BOOL
CMyView::IsMouseOnCloseButton()
{
BOOL bStat = FALSE;

    if ( IsWindowVisible() )
    {
    CWnd* pFrameWnd;
    POINT point;

        // note: By the time we get here the LMB is no longer down.
        // TRACE( "In CDockTabsView::MouseOnCloseButton() and IsLButtonDown(): %d\n", IsLButtonDown() );

            // Was the click on the Output Window Frame (ie. Title Bar)
        GetCursorPos( &point );
        if ( ( pFrameWnd = WindowFromPoint( point ) )->IsChild( this ) )
        {
                // Can't call pFrameWnd ->OnNcHitTest( point ) as its protected so use WM_NCHITTEST
            UINT nHitPos = pFrameWnd->SendMessage( WM_NCHITTEST, 0, MAKELPARAM( point.x, point.y ) );
            // TRACE( "In CDockTabsView::MouseOnCloseButton() and Click in Parent of CDockTabsView: %x, NcHitTest: %x\n", m_hWnd, nHitPos );
            bStat = nHitPos == HTCLOSE;    // Over 'Close Button'
        }
    }
    return bStat;
}


Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
GeneralRe: perform action on close [X] button Pin
*Dreamz28-Jun-04 18:33
*Dreamz28-Jun-04 18:33 
GeneralRe: perform action on close [X] button Pin
elephantstar29-Jun-04 9:01
elephantstar29-Jun-04 9:01 
GeneralRe: perform action on close [X] button Pin
Neville Franks29-Jun-04 13:37
Neville Franks29-Jun-04 13:37 

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.