📄 myabout.cpp
字号:
// MyAbout.cpp : implementation file
//
#include "stdafx.h"
#include "UsbCameraNew.h"
#include "MyAbout.h"
#include "UsbCameraNewDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyAbout dialog
CMyAbout::CMyAbout(CWnd* pParent /*=NULL*/)
: CDialog(CMyAbout::IDD, pParent)
{
//{{AFX_DATA_INIT(CMyAbout)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CMyAbout::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyAbout)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMyAbout, CDialog)
//{{AFX_MSG_MAP(CMyAbout)
ON_WM_LBUTTONDOWN()
ON_WM_SHOWWINDOW()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyAbout message handlers
LRESULT CMyAbout::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
static HDC winDC;
char szCredits[] = "致谢\n\n感谢所有帮助过我的人\n-----------\n2006-5-18";
switch (message)
{
case WM_CREATE:
winDC = ::GetDC( this->m_hWnd );
//
// Initialize the scroller by calling Initialize, and then SetString
//
m_Scroller.Initialize( this->m_hWnd, winDC,360, 200, 12, 78, RGB(236,233,216), RGB(0,0,0), "宋体" );
m_Scroller.SetString( szCredits, strlen( szCredits ) );
//
// Start the scroller (See WM_PAINT)
//
if( !m_Scroller.Start(this->m_hWnd, 20, 1) )
MessageBox( "Failed to start.");
return 1;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
break;
case WM_PAINT:
hdc = ::BeginPaint(this->m_hWnd, &ps);
//
// Draw scroller
//
m_Scroller.TextToScreen();
// TextOut(hdc, 50, 50,"asdfasddfhgj", 17);
::EndPaint( this->m_hWnd, &ps );
break;
case WM_DESTROY:
::ReleaseDC( this->m_hWnd, winDC );
m_Scroller.Cleanup();
if(*pStatus == 2)
PostQuitMessage(0);
*pStatus = 0;
// PostQuitMessage(0);
break;
}
return CDialog::WindowProc(message, wParam, lParam);
}
void CMyAbout::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
KillTimer(0);
ShowWindow(SW_HIDE);
DestroyWindow();
CDialog::OnLButtonDown(nFlags, point);
}
void CMyAbout::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
CRect rc, rc2;
GetWindowRect(&rc);
CUsbCameraNewDlg* dlg = (CUsbCameraNewDlg *)GetParent();
dlg->GetWindowRect(&rc2);
// MoveWindow(rc2.
MoveWindow((rc2.TopLeft().x + rc2.BottomRight().x)/2 - rc.Width()/2,
(rc2.TopLeft().y + rc2.BottomRight().y)/2 - rc.Height()/2, rc.Width(), rc.Height(), 1);
// TODO: Add your message handler code here
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -