-
Notifications
You must be signed in to change notification settings - Fork 1
/
HotKeyCtrlEx.cpp
71 lines (58 loc) · 1.72 KB
/
HotKeyCtrlEx.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyleft 2004 Chris Korda
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or any later version.
/*
chris korda
revision history:
rev date comments
00 05feb05 initial version
extended hot key control
*/
// HotKeyCtrlEx.cpp : implementation file
//
#include "stdafx.h"
#include "mixere.h"
#include "HotKeyCtrlEx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CHotKeyCtrlEx
CHotKeyCtrlEx::CHotKeyCtrlEx()
{
}
CHotKeyCtrlEx::~CHotKeyCtrlEx()
{
}
DWORD CHotKeyCtrlEx::GetHotKey() const
{
// Our override returns a DWORD, with the virtual key code in the low word,
// and the modifier flags in the high word, which is what the base class is
// SUPPOSED to do; the base class function returns a WORD, with the virtual
// key code in the low *byte*, and the modifier flags in the high *byte*.
WORD VKey, Mods;
CHotKeyCtrl::GetHotKey(VKey, Mods);
return(MAKELONG(VKey, Mods));
}
BEGIN_MESSAGE_MAP(CHotKeyCtrlEx, CHotKeyCtrl)
//{{AFX_MSG_MAP(CHotKeyCtrlEx)
ON_WM_KILLFOCUS()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CHotKeyCtrlEx message handlers
void CHotKeyCtrlEx::OnKillFocus(CWnd* pNewWnd)
{
CHotKeyCtrl::OnKillFocus(pNewWnd);
CWnd *Parent = GetParent();
if (Parent != NULL) {
NMHDR nmh;
nmh.hwndFrom = m_hWnd;
nmh.idFrom = GetDlgCtrlID();
nmh.code = HKN_KILLFOCUS;
Parent->SendMessage(WM_NOTIFY, nmh.idFrom, long(&nmh));
}
}