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