#define WM_F9 (WM_USER + 102)
void CTCP_ChatDlg::OnDestroy()
{
CDialog::OnDestroy();
// TODO: Add your message handler code here
UnregisterHotKey(m_hWnd,1002);
}
int CTCP_ChatDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
RegisterHotKey( m_hWnd, WM_F9, 0, VK_F9 );
return 0;
}
VOID CTCP_ChatDlg::OnHotKey(WPARAM wParam,LPARAM lParam)
{
if( wParam == WM_F9 )
{
CWnd::SetForegroundWindow();
}
}
ON_MESSAGE(WM_HOTKEY,OnHotKey)
afx_msg VOID OnHotKey(WPARAM wParam,LPARAM lParam) ;