CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 1999
    Posts
    1

    How to Disable Alt F4 Acceletartor Key when i disable CANCEL Button in MFC Dialog Based application



    How to Disable Alt F4 Acceletartor Key when i disable CANCEL Button in MFC Dialog Based application.

  2. #2
    Join Date
    Apr 1999
    Posts
    32

    Re: How to Disable Alt F4 Acceletartor Key when i disable CANCEL Button in MFC Dialog Based applicat



    Find or add the OnSysCommand message handler and add some code similar to this:

    <P>

    <PRE>

    void CJunkDlg::OnSysCommand(UINT nID, LPARAM lParam)

    {

    if (bPreventClose && (nID == SC_CLOSE))

    {

    return;

    }

    //... rest of function ...

    }

    </PRE>


    Toggle bPreventClose to be true or false as you enable or disable the Cancel button.

  3. #3
    Join Date
    Jun 2001
    Location
    India
    Posts
    14

    Re: How to Disable Alt F4 Acceletartor Key when i disable CANCEL Button in MFC Dialog Based applicat

    This will also disable the close button. How can only Alt+F4 be disabled?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured