?? progressinfo.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 + -