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

📄 progressinfo.cpp

📁 视频芯片管理系统
💻 CPP
字号:
// PrgressInfo.cpp : implementation file
//

#include "stdafx.h"
#include "ProgressInfo.h"

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

/////////////////////////////////////////////////////////////////////////////
// CProgressInfo dialog


CProgressInfo::CProgressInfo(CWnd* pParent /*=NULL*/)
	: CDialog(CProgressInfo::IDD, pParent)
{
	//{{AFX_DATA_INIT(CProgressInfo)
	//}}AFX_DATA_INIT
	m_WndCreateFlag = 0;
}

void CProgressInfo::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CProgressInfo)
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CProgressInfo, CDialog)
	//{{AFX_MSG_MAP(CProgressInfo)
	ON_WM_SHOWWINDOW()
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CProgressInfo message handlers

void CProgressInfo::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CDialog::OnShowWindow(bShow, nStatus);
}

///显示提示菜单
/**
  * Prompt : 待提示的信息 \n
  */
void CProgressInfo::Show(const char *Promt)
{
	RECT rect;
	int width, height;

	if(m_WndCreateFlag==1){
		Destroy();
	}

	Create(IDD_PROGRESS_INFO, NULL);
	m_WndCreateFlag = 1;

	SetWindowText(Promt);

	GetParent()->GetWindowRect(&rect);

	width = strlen(Promt) * 8;
	if(width<300){
		width = 300;
	}
	height = 25;

	SetWindowPos(NULL, (rect.right+rect.left-width)/2, (rect.bottom+rect.top)/2 - 50, width, height, 0);
	ShowWindow(SW_SHOW);
}

///隐藏
void CProgressInfo::Hide()
{
	if(m_WndCreateFlag==1){
		Destroy();
		AfxGetApp()->GetMainWnd()->ShowWindow(SW_SHOW);
		m_WndCreateFlag = 0;
	}
}

///销毁
void CProgressInfo::Destroy()
{
	if(m_WndCreateFlag==1){
		DestroyWindow();
		m_WndCreateFlag = 0;
	}
}

void CProgressInfo::OnDestroy() 
{
	CDialog::OnDestroy();
	
	m_WndCreateFlag = 0;
}

CProgressInfo g_ProgressInfo;
void HideProgressInfo()
{
	g_ProgressInfo.Hide();
}

⌨️ 快捷键说明

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