// RemoteHideConfig.cpp : implementation file // #include "stdafx.h" #include "StoneU_HC_OCX.h" #include "RemoteHideConfig.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CRemoteHideConfig dialog RECT g_ShowRect1[MAX_SHELTERNUM]; RECT g_MouseRect1[MAX_SHELTERNUM]; int m_idetectnum1 = 4; void CALLBACK DrawFunShow1(long nPort,HDC hDc,DWORD nUser) { CRect rect; int i = 0,j = 0; CPoint point; HBRUSH hBrush=::CreateSolidBrush(COLORREF(0xff00ff)); for (i=0; iEnableWindow(TRUE); GetDlgItem(IDC_CHECKHIDESETRECT)->EnableWindow(TRUE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CRemoteHideConfig::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default if (m_bDrawdetect) { if (MK_CONTROL&nFlags) { NET_DVR_RigisterDrawFun(m_iPlayhandle, DrawFun0, 0); if (m_idetectnum1 >=MAX_SHELTERNUM) m_idetectnum1 = 0; point.x -= DETECTPICLEFT; point.y -= DETECTPICTOP; if (point.x < 0) point.x = 0; g_MouseRect1[m_idetectnum1].left=point.x/16*16; if (point.y < 0) point.y = 0; g_MouseRect1[m_idetectnum1].top=point.y/16*16; g_MouseRect1[m_idetectnum1].right=g_MouseRect1[m_idetectnum1].left; g_MouseRect1[m_idetectnum1].bottom=g_MouseRect1[m_idetectnum1].top; POINT tPoint=point; g_ShowRect1[m_idetectnum1].left=tPoint.x/16*16; g_ShowRect1[m_idetectnum1].top=tPoint.y/16*16; g_ShowRect1[m_idetectnum1].right=tPoint.x/16*16+1; g_ShowRect1[m_idetectnum1].bottom=tPoint.y/16*16+1; m_idetectnum1 ++; } } CDialog::OnLButtonDown(nFlags, point); } void CRemoteHideConfig::OnMouseMove(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default if (m_bDrawdetect) { if (MK_CONTROL&nFlags&&MK_LBUTTON&nFlags) { point.x -= DETECTPICLEFT; point.y -= DETECTPICTOP; if (point.x > 352) point.x = 352; g_MouseRect1[m_idetectnum1-1].right=point.x/16*16; if (point.y > 288) point.y = 288; g_MouseRect1[m_idetectnum1-1].bottom=point.y/16*16; POINT tPoint=point; g_ShowRect1[m_idetectnum1-1].right=tPoint.x/16*16; g_ShowRect1[m_idetectnum1-1].bottom=tPoint.y/16*16; } } CDialog::OnMouseMove(nFlags, point); } void CRemoteHideConfig::OnCheckhidegetrect() { // TODO: Add your control notification handler code here if (m_iPlayhandle < 0) return; UpdateData(TRUE); if (m_bSetDetect) { m_bSetDetect = FALSE; m_bDrawdetect = FALSE; UpdateData(FALSE); GetDlgItem(IDHIDEOK)->EnableWindow(FALSE); } if (m_bShowDetect) { NET_DVR_RigisterDrawFun(m_iPlayhandle,NULL, 0); Sleep(200); NET_DVR_RigisterDrawFun(m_iPlayhandle,DrawFunShow1, 0); } else { NET_DVR_RigisterDrawFun(m_iPlayhandle,NULL, 0); } } void CRemoteHideConfig::OnCheckhidesetrect() { // TODO: Add your control notification handler code here if (m_iPlayhandle < 0) return; UpdateData(TRUE); if (m_bShowDetect) { m_bShowDetect = FALSE; UpdateData(FALSE); } if (m_bSetDetect) { NET_DVR_RigisterDrawFun(m_iPlayhandle,NULL,0); m_bDrawdetect = TRUE; m_idetectnum1 = 0; for(int i=0; iEnableWindow(TRUE); } else { m_bDrawdetect = FALSE; NET_DVR_RigisterDrawFun(m_iPlayhandle,NULL,0); GetDlgItem(IDHIDEOK)->EnableWindow(FALSE); } } void CRemoteHideConfig::OnExit() { // TODO: Add your control notification handler code here if (m_iPlayhandle >= 0) { NET_DVR_RigisterDrawFun(m_iPlayhandle,NULL, 0); NET_DVR_StopRealPlay(m_iPlayhandle); m_iPlayhandle = -1; } CDialog::OnOK(); } void CRemoteHideConfig::OnHideok() { // TODO: Add your control notification handler code here int k=0; for(k=0; k