-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathEditQuote.cpp
More file actions
61 lines (52 loc) · 1.71 KB
/
EditQuote.cpp
File metadata and controls
61 lines (52 loc) · 1.71 KB
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
//EditQuote.cpp : Implementation of CEditQuote
//***************************************************************************//
// //
// This file was created using the CWindowImpl ATL Object Wizard //
// By Erik Thompson © 2000 //
// Version 1.1 //
// Email questions and comments to ErikT@RadBytes.com //
// //
//***************************************************************************//
#include "stdafx.h"
#include "EditQuote.h"
#include "MotleyFool.h"
#include "StockBar.h"
/////////////////////////////////////////////////////////////////////////////
// CEditQuote
CEditQuote::CEditQuote()
: m_pBand(NULL)
{
}
CEditQuote::~CEditQuote()
{
}
STDMETHODIMP CEditQuote::TranslateAcceleratorIO(LPMSG lpMsg)
{
int nVirtKey = (int)(lpMsg->wParam);
if (VK_RETURN == nVirtKey)
{
// remove system beep on enter key by setting key code to 0
lpMsg->wParam = 0;
::PostMessage(GetParent(), WM_GETQUOTE, 0, 0);
return S_OK;
}
else if (WM_KEYDOWN == lpMsg->message && nVirtKey == VK_TAB)
{
if (m_pBand) m_pBand->FocusChange(FALSE);
return S_FALSE;
}
TranslateMessage(lpMsg);
DispatchMessage(lpMsg);
return S_OK;
}
void CEditQuote::SetBand(CStockBar* pBand)
{
m_pBand = pBand;
}
LRESULT CEditQuote::OnSetFocus(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
//Notify host that our band has the focus so TranslateAcceleratorIO
//messages are directed towards our band.
if (m_pBand) m_pBand->FocusChange(TRUE);
return 0;
}