title: Adding accelerators(shortcuts) in MFC - HOW?
body: <p>I found this link: <a href="http://support.microsoft.com/kb/222829" rel="nofollow">http://support.microsoft.com/kb/222829</a></p>
  
  <p>But I can't understand that much.</p>
  
  <p>Ok, I understood I need to add this to my header file: </p>
  
  <pre><code>HACCEL  m_hAccelTable;
  </code></pre>
  
  <p>and then this:</p>
  
  <pre><code>m_hAccelTable = LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ACCELERATOR1));
  </code></pre>
  
  <p>to my main .cpp</p>
  
  <p>But where does this go?</p>
  
  <pre><code>BOOL CAboutDlg::PreTranslateMessage(MSG* pMsg) {
     if (m_hAccelTable) {
        if (::TranslateAccelerator(m_hWnd, m_hAccelTable, pMsg)) {
           return(TRUE);
        }
     }
     return CDialog::PreTranslateMessage(pMsg);
  
  }
  </code></pre>
  
  <p>I need around 6 shortcuts (CTRL + U to load something, CTRL + O to load smth else), I can't understand how this works, need a little bit of help</p>