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

📄 animatebtn.cpp

📁 动态图形显示程序源码
💻 CPP
字号:
// AnimateBtn.cpp : implementation file
//

#include "stdafx.h"
#include "DspCtl.h"
#include "AnimateBtn.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAnimateBtn

CAnimateBtn::CAnimateBtn()
{
	flag=TRUE;
}

CAnimateBtn::~CAnimateBtn()
{
}


BEGIN_MESSAGE_MAP(CAnimateBtn, CButton)
	//{{AFX_MSG_MAP(CAnimateBtn)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAnimateBtn message handlers

void CAnimateBtn::Play()
{
	flag=FALSE;
  if (IsWindow(m_ctrl.GetSafeHwnd()))
	 m_ctrl.Play(0,-1,-1);
}

void CAnimateBtn::Stop()
{
	if (IsWindow(m_ctrl.GetSafeHwnd()))
	  m_ctrl.Stop();
}

void CAnimateBtn::Close()
{
	flag=FALSE;
  if (IsWindow(m_ctrl.GetSafeHwnd()))
	  m_ctrl.Close();
}

bool CAnimateBtn::Open(LPCTSTR lpszFileName)
{
	TRACE("Open lpszfilename called\n");
   if (!::IsWindow(m_ctrl))
 {
     CRect arect;
     GetClientRect(&arect);
     arect.DeflateRect(8,(int)(arect.Height()/5.0));
     arect.OffsetRect(0,(int)(-arect.Height()/5.0));
     m_ctrl.Create(WS_CHILD | WS_VISIBLE | ACS_TRANSPARENT,arect,this,1);
 
   }
   flag=TRUE;
   return m_ctrl.Open(lpszFileName); 
}

bool CAnimateBtn::Open(UINT nID)
{

	TRACE("Open id called\n");
  if (!::IsWindow(m_ctrl))
  {
    CRect arect;
    GetClientRect(&arect);
    arect.DeflateRect(8,(int)(arect.Height()/5.0));
    arect.OffsetRect(0,(int)(-arect.Height()/5.0));
    m_ctrl.Create(WS_CHILD | WS_VISIBLE | ACS_TRANSPARENT |ACS_CENTER ,arect,this,1);
  }
  //if you change the Create call to include ACS_AUTOPLAY, then do not set flag to TRUE
  flag=TRUE;
  return m_ctrl.Open(nID);
}

⌨️ 快捷键说明

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