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

📄 aboutdlg.cpp

📁 用C语言和mysql连接起来的程序
💻 CPP
字号:
// AboutDlg.cpp : implementation file
//

#include "stdafx.h"
#include "MySQL.h"
#include "AboutDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog


CAboutDlg::CAboutDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CAboutDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CAboutDlg)
	m_bMuch=false;
	//}}AFX_DATA_INIT
}


void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAboutDlg)
	DDX_Control(pDX, IDOK, m_cOk);
	DDX_Control(pDX, IDC_MORE, m_cMore);
	DDX_Control(pDX, IDC_EMAIL, m_cEmail);
	DDX_Control(pDX, IDC_INFO, m_cInfo);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
	//{{AFX_MSG_MAP(CAboutDlg)
	ON_BN_CLICKED(IDC_MORE, OnMore)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAboutDlg message handlers

BOOL CAboutDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_cEmail.SetURL("mailto:Friendlysoft@Hotmail.com");
	m_cEmail.SetUnderline(TRUE);

	TCHAR* pInfo=
	{_T(
		"MySQL 连接演示程序(VC版)\t|"
		"  版本号:    1.0.0  \n||"
		"  软件作者  \t|"
		"  Friendlysoft||"
		"  技术在于精  \t|"
		"  卓越在于新  \t||"
		"如发现BUG,请与我联系:\t|"
		"Friendlysoft@163.com|"
		"Friendlysoft@sina.com|"
		"Friendlysoft@Hotmail.com||"
	)};
	m_cInfo.SubclassDlgItem(IDD_ABOUTDLG,this);
	m_cInfo.SetCredits(pInfo);
	m_cInfo.SetSpeed(1);
	m_cInfo.SetColor(BACKGROUND_COLOR,RGB(0,255,200));
	m_cInfo.SetTransparent();
	m_cInfo.SetGradient(GRADIENT_RIGHT_DARK);

	int x,y,high,width;
	RECT wndrect,deskrect;
	GetWindowRect(&wndrect);
	high=wndrect.bottom-wndrect.top;
	width=wndrect.right-wndrect.left;
	GetDesktopWindow()->GetWindowRect(&deskrect);
	x=(deskrect.right-width)/2;
	y=(deskrect.bottom-high)/2;
	deskrect.left=x;
	deskrect.right=deskrect.left+width;
	deskrect.top=y;
	deskrect.bottom=deskrect.top+high;
	CWnd* wnd=GetDlgItem(IDC_INFO);
	wnd->GetWindowRect(&wndrect);
	high=wndrect.bottom-wndrect.top;
	deskrect.bottom-=high+10;
	MoveWindow(&deskrect);
	InitCover();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CAboutDlg::InitCover()
{
	m_cOk.SetIcon(IDI_OK);
	m_cOk.SetBtnCursor(IDC_HANDCUR);
	m_cMore.SetIcon(IDI_MORE_R);
	m_cMore.SetBtnCursor(IDC_HANDCUR);
	return;
}

void CAboutDlg::OnMore() 
{
	// TODO: Add your control notification handler code here
	if(!m_bMuch)
	{
		int i,high;
		RECT rect,wndrect;
		GetWindowRect(&wndrect);
		CWnd* wnd=GetDlgItem(IDC_INFO);
		wnd->GetWindowRect(&rect);
		high=rect.bottom-rect.top;
		for(i=0;i<high+5;wndrect.bottom++)
		{
			MoveWindow(&wndrect);
			i++;
		}
		m_cInfo.StartScrolling();
		m_cMore.SetWindowText("隐藏");
		m_cMore.SetIcon(IDI_MORE_L);
		m_bMuch=!m_bMuch;
	}
	else
	{
		int i,high;
		RECT rect,wndrect;
		GetWindowRect(&wndrect);
		CWnd* wnd=GetDlgItem(IDC_INFO);
		wnd->GetWindowRect(&rect);
		high=rect.bottom-rect.top;
		for(i=0;i<high+5;wndrect.bottom-=2)
		{
			MoveWindow(&wndrect);
			Sleep(1);
			i+=2;
		}
		m_cInfo.EndScrolling();
		m_cMore.SetWindowText("更多");
		m_cMore.SetIcon(IDI_MORE_R);
		m_bMuch=!m_bMuch;
	}	
}

⌨️ 快捷键说明

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