forked from QuantBox/QuantBox_XAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDialogStockDrv.cpp
74 lines (56 loc) · 1.41 KB
/
DialogStockDrv.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
72
73
74
// DialogStockDrv.cpp : implementation file
//
#include "stdafx.h"
#include "QuantBox_TongShi_Quote.h"
#include "DialogStockDrv.h"
#include "afxdialogex.h"
#include "MdUserApi.h"
#define WM_USER_STOCK 2000
// CDialogStockDrv dialog
IMPLEMENT_DYNAMIC(CDialogStockDrv, CDialogEx)
CDialogStockDrv::CDialogStockDrv(CWnd* pParent /*=NULL*/)
: CDialogEx(CDialogStockDrv::IDD, pParent)
{
m_pUserApi = nullptr;
}
CDialogStockDrv::~CDialogStockDrv()
{
}
void CDialogStockDrv::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CDialogStockDrv, CDialogEx)
ON_MESSAGE(WM_USER_STOCK, OnTSDataDriver)
ON_WM_CLOSE()
END_MESSAGE_MAP()
// CDialogStockDrv message handlers
BOOL CDialogStockDrv::OnInitDialog()
{
CDialogEx::OnInitDialog();
// TODO: Add extra initialization here
if (m_pUserApi)
{
m_pUserApi->InitDriver(GetSafeHwnd(), WM_USER_STOCK);
MoveWindow(0, 0, 0, 0);
ShowWindow(SW_HIDE);
ModifyStyleEx(WS_EX_APPWINDOW, WS_EX_TOOLWINDOW);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
LONG CDialogStockDrv::OnTSDataDriver(UINT wParam, LONG lParam)
{
if (m_pUserApi)
return m_pUserApi->_OnMsg(wParam, lParam);
return 1;
}
void CDialogStockDrv::OnClose()
{
// TODO: Add your message handler code here and/or call default
if(m_pUserApi)
{
m_pUserApi->QuitDriver();
}
CDialogEx::OnClose();
}