Disable annoying sound when handling syskeydown message
<p>Hi I have written my own custom control overriding from MFC CEdit. For that I needed to override the SYS_KEY_UP and SYS_KEY_DOWN. However each time the control handles these message the annoying sound is heard as if the input is invalid or something. Does anyone knwo what generates the sound and how do I disable it.</p>

<p>UPD Code </p>

<pre><code>// CShotcutEdit

class CShortcutEdit : public CEdit
{
    DECLARE_DYNAMIC(CShortcutEdit)

public:
    CShortcutEdit();
    virtual ~CShortcutEdit();

protected:
    DECLARE_MESSAGE_MAP()

    afx_msg UINT OnGetDlgCode();

    afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);

    afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);

    afx_msg void OnSysKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);

    afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);

    virtual BOOL PreTranslateMessage(MSG* pMsg);

    virtual void DoDataExchange(CDataExchange* pDX);

    virtual void PreSubclassWindow();

    virtual void OnChar(UINT uiChar, UINT uiCount, UINT uiFlags);

    // ... Other Members


};

// ShotcutEdit.cpp : implementation file
//

#include "stdafx.h"
#include "GridPlus.h"
#include "ShortcutEdit.h"


// CShotcutEdit

IMPLEMENT_DYNAMIC(CShortcutEdit, CEdit)

CShortcutEdit::CShortcutEdit()
{

}

CShortcutEdit::~CShortcutEdit()
{

}


BEGIN_MESSAGE_MAP(CShortcutEdit, CEdit)
    ON_WM_GETDLGCODE()
    ON_WM_KEYDOWN()
    ON_WM_SYSKEYDOWN()
    ON_WM_SYSKEYUP()
    ON_WM_KEYUP()
    ON_WM_CHAR()
END_MESSAGE_MAP()

UINT CShortcutEdit::OnGetDlgCode()
{

    return DLGC_WANTARROWS | DLGC_WANTALLKEYS | DLGC_WANTCHARS;
}

void CShortcutEdit::DoDataExchange(CDataExchange* pDX)
{
    CEdit::DoDataExchange(pDX);
}

BOOL CShortcutEdit::PreTranslateMessage(MSG* pMsg)
{
    return CEdit::PreTranslateMessage(pMsg);
}

void CShortcutEdit::OnSysKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{

}

void CShortcutEdit::OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
    // ... Check for Alt or F10 and translate to string;
}

void CShortcutEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
    // .. Check for Ctrl Shift and translate to string

}

void CShortcutEdit::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
    SetWindowText(L"The desired shortcut is..."); // Should print "alt+f10" for example
}

void CShortcutEdit::OnChar(UINT uiChar, UINT uiCount, UINT uiFlags)
{

}


void CShortcutEdit::PreSubclassWindow()
{
    HideCaret();
    CEdit::PreSubclassWindow();
}

// CShotcutEdit message handlers
</code></pre>