⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lastprojectdlg.cpp

📁 类似于股市K线技术分析的系统源码
💻 CPP
字号:
// LastProjectDlg.cpp : implementation file
//

#include "stdafx.h"
#include "LastProject.h"
#include "LastProjectDlg.h"


#include "Records.h"
#include "ChartMA.h"
#include "ChartRSI.h"
#include "ChartKDJ.h"
#include "ChartMACD.h"

#define SHOWNEXTCHART 150

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


///////////////////////////////////////////////////////////////////////////
UINT ThreadProc(LPVOID param)
{
	Sleep(50);
	CLastProjectDlg * pdlg = (CLastProjectDlg *)param;
	pdlg->m_DirectFace.DrawFrame();
	if(atoi(__argv[1])==1) pdlg->SetTimer(1,1000,NULL);
	return 0;
}

/////////////////////////////////////////////////////////////////////////////
// CLastProjectDlg dialog

CLastProjectDlg::CLastProjectDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CLastProjectDlg::IDD, pParent)
{
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CLastProjectDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CLastProjectDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CLastProjectDlg, CDialog)
	//{{AFX_MSG_MAP(CLastProjectDlg)
	ON_WM_QUERYDRAGICON()
	ON_WM_TIMER()
	ON_MESSAGE(SHOWNEXTCHART,OnShowNextChart)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CLastProjectDlg message handlers

BOOL CLastProjectDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	//Set Main Window possition 
	ReMoveWindow(m_WindowRect);
	MoveWindow(m_WindowRect);
	::SetWindowPos(AfxGetMainWnd()->m_hWnd,HWND_TOPMOST,0,0,m_WindowRect.Width(),m_WindowRect.Height(),SWP_NOMOVE|SWP_NOSIZE);	
	if(m_DirectFace.Create(m_hWnd,m_WindowRect)) AfxBeginThread(ThreadProc,this);
		else return FALSE;
	return TRUE;
}

HCURSOR CLastProjectDlg::OnQueryDragIcon()
{
	return (HCURSOR) m_hIcon;
}



void CLastProjectDlg::OnTimer(UINT nIDEvent) 
{
	KillTimer(1);
	::PostMessage(HWND_BROADCAST,SHOWNEXTCHART,NULL,NULL);
	CDialog::OnTimer(nIDEvent);
}



void CLastProjectDlg::OnShowNextChart()
{
	SShowInfo showinfo = m_schedual.GetNextShowInfo();
	CRecords records(showinfo.TableName,showinfo.ExCode);
	if(showinfo.ChartType == "MA")
	{
		CChartMA ma(&records,&m_DirectFace,showinfo.Param[0],showinfo.Param[1],showinfo.Param[2]);
	}
	if(showinfo.ChartType == "RSI")
	{
		CChartRSI rsi(&records,&m_DirectFace,showinfo.Param[0],showinfo.Param[1],showinfo.Param[2]);
	}
	if(showinfo.ChartType == "KDJ")
	{
		CChartKDJ kdj(&records,&m_DirectFace,showinfo.Param[0],showinfo.Param[1],showinfo.Param[2]);
	}
	if(showinfo.ChartType == "MACD")
	{
		CChartMACD macd(&records,&m_DirectFace,showinfo.Param[0],showinfo.Param[1],showinfo.Param[2]);
	}
	if(atoi(__argv[1])==1) SetTimer(1,showinfo.DelaySeconds*1000,NULL);
}




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -