|
| 1 | +// DialogStockDrv.cpp : implementation file |
| 2 | +// |
| 3 | + |
| 4 | +#include "stdafx.h" |
| 5 | +#include "QuantBox_TongShi_Quote.h" |
| 6 | +#include "DialogStockDrv.h" |
| 7 | +#include "afxdialogex.h" |
| 8 | + |
| 9 | +#include "MdUserApi.h" |
| 10 | + |
| 11 | +#define WM_USER_STOCK 2000 |
| 12 | +// CDialogStockDrv dialog |
| 13 | + |
| 14 | +IMPLEMENT_DYNAMIC(CDialogStockDrv, CDialogEx) |
| 15 | + |
| 16 | +CDialogStockDrv::CDialogStockDrv(CWnd* pParent /*=NULL*/) |
| 17 | + : CDialogEx(CDialogStockDrv::IDD, pParent) |
| 18 | +{ |
| 19 | + m_pUserApi = nullptr; |
| 20 | +} |
| 21 | + |
| 22 | +CDialogStockDrv::~CDialogStockDrv() |
| 23 | +{ |
| 24 | +} |
| 25 | + |
| 26 | +void CDialogStockDrv::DoDataExchange(CDataExchange* pDX) |
| 27 | +{ |
| 28 | + CDialogEx::DoDataExchange(pDX); |
| 29 | +} |
| 30 | + |
| 31 | + |
| 32 | +BEGIN_MESSAGE_MAP(CDialogStockDrv, CDialogEx) |
| 33 | + ON_MESSAGE(WM_USER_STOCK, OnTSDataDriver) |
| 34 | + ON_WM_CLOSE() |
| 35 | +END_MESSAGE_MAP() |
| 36 | + |
| 37 | + |
| 38 | +// CDialogStockDrv message handlers |
| 39 | + |
| 40 | + |
| 41 | +BOOL CDialogStockDrv::OnInitDialog() |
| 42 | +{ |
| 43 | + CDialogEx::OnInitDialog(); |
| 44 | + |
| 45 | + // TODO: Add extra initialization here |
| 46 | + if (m_pUserApi) |
| 47 | + { |
| 48 | + m_pUserApi->InitDriver(GetSafeHwnd(), WM_USER_STOCK); |
| 49 | + MoveWindow(0, 0, 0, 0); |
| 50 | + ShowWindow(SW_HIDE); |
| 51 | + ModifyStyleEx(WS_EX_APPWINDOW, WS_EX_TOOLWINDOW); |
| 52 | + } |
| 53 | + |
| 54 | + return TRUE; // return TRUE unless you set the focus to a control |
| 55 | + // EXCEPTION: OCX Property Pages should return FALSE |
| 56 | +} |
| 57 | + |
| 58 | +LONG CDialogStockDrv::OnTSDataDriver(UINT wParam, LONG lParam) |
| 59 | +{ |
| 60 | + if (m_pUserApi) |
| 61 | + return m_pUserApi->_OnMsg(wParam, lParam); |
| 62 | + return 1; |
| 63 | +} |
| 64 | + |
| 65 | +void CDialogStockDrv::OnClose() |
| 66 | +{ |
| 67 | + // TODO: Add your message handler code here and/or call default |
| 68 | + if(m_pUserApi) |
| 69 | + { |
| 70 | + m_pUserApi->QuitDriver(); |
| 71 | + } |
| 72 | + |
| 73 | + CDialogEx::OnClose(); |
| 74 | +} |
0 commit comments