// DlgPlay.cpp : implementation file // #include "stdafx.h" #include "mgrnve.h" #include "DlgPlay.h" #include "PageArchiveData.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CDlgPlay dialog CDlgPlay::CDlgPlay(CWnd* pParent /*=NULL*/) : CDialog(CDlgPlay::IDD, pParent) { //{{AFX_DATA_INIT(CDlgPlay) //}}AFX_DATA_INIT m_pCtrlDlg = NULL; } void CDlgPlay::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDlgPlay) DDX_Control(pDX, IDC_WEBAGENTCTRL_PLAY, m_AgentCtrl); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDlgPlay, CDialog) //{{AFX_MSG_MAP(CDlgPlay) ON_WM_DESTROY() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDlgPlay message handlers #define AWTD_LEFT 0x01 #define AWTD_RIGHT 0x02 #define AWTD_HCENTER 0x04 #define AWTD_TOP 0x08 #define AWTD_BOTTOM 0x10 #define AWTD_VCENTER 0x20 BOOL AnchorWindowToDesktop(HWND hwnd,DWORD pos) { //GetSystemMetrics(SM_CXFULLSCREEN); //GetSystemMetrics(SM_CXFULLSCREEN); RECT rc_screen; SystemParametersInfo(SPI_GETWORKAREA,0,&rc_screen,0); RECT rc_window; GetWindowRect(hwnd,&rc_window); int left_x=rc_screen.left; int hcenter_x=(rc_screen.left+rc_screen.right)/2 - (rc_window.right-rc_window.left)/2; int right_x=rc_screen.right-(rc_window.right-rc_window.left); int bottom_y=(rc_screen.bottom-(rc_window.bottom-rc_window.top)); int vcenter_y=(rc_screen.top+rc_screen.bottom)/2 - (rc_window.bottom-rc_window.top)/2;; int top_y=rc_screen.top; int x=0,y=0; if(pos&AWTD_LEFT) x = left_x; else if(pos&AWTD_RIGHT) x = right_x; else if(pos&AWTD_HCENTER) x = hcenter_x; if(pos&AWTD_TOP) y = top_y; else if(pos&AWTD_BOTTOM) y = bottom_y; else if(pos&AWTD_VCENTER) y = vcenter_y; return SetWindowPos(hwnd,NULL,x,y,0,0,SWP_NOZORDER|SWP_NOSIZE); } BOOL CDlgPlay::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here AnchorWindowToDesktop(m_hWnd,AWTD_RIGHT|AWTD_VCENTER); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CDlgPlay::OnDestroy() { CDialog::OnDestroy(); // TODO: Add your message handler code here } BEGIN_EVENTSINK_MAP(CDlgPlay, CDialog) //{{AFX_EVENTSINK_MAP(CDlgPlay) ON_EVENT(CDlgPlay, IDC_WEBAGENTCTRL_PLAY, 1 /* ConnectionInfo */, OnConnectionInfoWebagentctrlPlay, VTS_I2) ON_EVENT(CDlgPlay, IDC_WEBAGENTCTRL_PLAY, 2 /* ManageData */, OnManageDataWebagentctrlPlay, VTS_I4 VTS_I4 VTS_PI4 VTS_I4 VTS_PI4) //}}AFX_EVENTSINK_MAP END_EVENTSINK_MAP() void CDlgPlay::OnConnectionInfoWebagentctrlPlay(short nConnectionStatus) { // TODO: Add your control notification handler code here m_pCtrlDlg->ConnectionInfo(nConnectionStatus); } void CDlgPlay::OnManageDataWebagentctrlPlay(long nDataType, long nFirstParam, long FAR* pData, long nDataSize, long FAR* pHeaderData) { // TODO: Add your control notification handler code here m_pCtrlDlg->ManageData(nDataType, nFirstParam, pData, nDataSize, pHeaderData); } void CDlgPlay::SetControlDlg(CPageArchiveData *pDlg) { m_pCtrlDlg = pDlg; }