OnFileClose - Programmer

This is a discussion on OnFileClose - Programmer ; Hi, I have a MDI application. Currently I am trying to display a message box when the user wants to close one of the window. However, instead of showing the message box, the window closes. I have overridden OnFileClose in ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: OnFileClose

  1. OnFileClose

    Hi, I have a MDI application. Currently I am trying to display a
    message box when the user wants to close one of the window. However,
    instead of showing the message box, the window closes. I have
    overridden OnFileClose in App. Can someone please tell me what is
    wrong? Thanks.


  2. Re: OnFileClose

    >Hi, I have a MDI application. Currently I am trying to display a
    >message box when the user wants to close one of the window. However,
    >instead of showing the message box, the window closes. I have
    >overridden OnFileClose in App. Can someone please tell me what is
    >wrong? Thanks.


    Try handling the SC_CLOSE notification for the child window in the
    OnSysCommand handler.

    Dave

  3. Re: OnFileClose

    Hallo lynnzyeo@yahoo.com!

    > Hi, I have a MDI application. Currently I am trying to display a
    > message box when the user wants to close one of the window. However,
    > instead of showing the message box, the window closes. I have
    > overridden OnFileClose in App. Can someone please tell me what is
    > wrong? Thanks.


    Interecept WM_CLOSE. Don't pass it to the default handler. Ask the user
    with a message box. Call DestroyWindow if the user wants to close.



    --
    Martin Richter [MVP] WWJD
    "In C we had to code our own bugs. In C++ we can inherit them."
    FAQ : http://www.mpdvc.de
    Samples: http://www.codeguru.com http://www.codeproject.com

+ Reply to Thread