int m_nHotKeyID;
afx_msg LRESULT OnHotKey(WPARAM wParam, LPARAM lParam);

BEGIN_MESSAGE_MAP(CTestDlg, CDialog)
ON_MESSAGE(WM_HOTKEY, OnHotKey)
END_MESSAGE_MAP()

BOOL CTestDlg::Init()
{
m_nHotKeyID = ::GlobalAddAtom("HotK");

if(!::RegisterHotKey(GetSafeHwnd(), m_nHotKeyID, MOD_CONTROL, 'D'))
AfxMessageBox("핫키 등록 실패!");
}

LRESULT CTestDlg::OnHotKey(WPARAM wParam, LPARAM lParam)  
{
if((int)wParam == m_nHotKeyID)
AfxMessageBox("^^*");

return 0;
}

BOOL CTestDlg::DestroyWindow() 
{
::UnregisterHotKey(GetSafeHwnd(), m_nHotKeyID);

return CDialog::DestroyWindow();
}
Posted by 띠깜
,