WelcomeDlg.cpp
资源名称:FTP总集.rar [点击查看]
上传用户:tjfeida
上传日期:2013-03-10
资源大小:1917k
文件大小:3k
源码类别:
Ftp客户端
开发平台:
Visual C++
- // WelcomeDlg.cpp : implementation file
- //
- /*********************************************
- **该文件是属于WolfFTP工程中的。如果有什么问题
- **请联系
- ** tablejiang@21cn.com
- **或者访问
- ** http://wolfftp.51.net
- **以得到最新的支持。
- *********************************************/
- #include "stdafx.h"
- #include "quickftp.h"
- #include "WelcomeDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CWelcomeDlg dialog
- CWelcomeDlg::CWelcomeDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CWelcomeDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CWelcomeDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
- void CWelcomeDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CWelcomeDlg)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CWelcomeDlg, CDialog)
- //{{AFX_MSG_MAP(CWelcomeDlg)
- ON_WM_TIMER()
- ON_WM_LBUTTONDOWN()
- ON_WM_ERASEBKGND()
- ON_WM_DESTROY()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CWelcomeDlg message handlers
- void CWelcomeDlg::OnOK()
- {
- // TODO: Add extra validation here
- CDialog::OnOK();
- }
- void CWelcomeDlg::OnCancel()
- {
- // TODO: Add extra cleanup here
- CDialog::OnCancel();
- }
- void CWelcomeDlg::OnTimer(UINT nIDEvent)
- {
- // TODO: Add your message handler code here and/or call default
- KillTimer( 1 ) ;
- PostMessage( WM_CLOSE , 0 , 0 ) ;
- CDialog::OnTimer(nIDEvent);
- }
- BOOL CWelcomeDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- ::SetWindowLong(m_hWnd, GWL_STYLE, WS_POPUP );
- ::SetWindowLong(m_hWnd, GWL_EXSTYLE,WS_EX_TOOLWINDOW);
- ::SetWindowPos( m_hWnd , HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- ShowWindow( SW_HIDE ) ;
- RECT rect ;
- BITMAP bm ;
- m_BackBmp.LoadBitmap( IDB_BITMAP_WELCOME ) ;
- m_BackBmp.GetBitmap( &bm ) ;
- int x = ::GetSystemMetrics(SM_CXSCREEN);//get current display width
- int y = ::GetSystemMetrics(SM_CYSCREEN);//get current display height
- rect.left = x/2 - bm.bmWidth /2 ;
- rect.top = y/2 - bm.bmHeight / 2 ;
- rect.right = rect.left + bm.bmWidth ;
- rect.bottom = rect.top + bm.bmHeight ;
- m_iHeight = bm.bmHeight ;
- m_iWidth = bm.bmWidth ;
- MoveWindow( &rect , true ) ;
- ShowWindow( SW_SHOW ) ;
- SetTimer( 1 , 2000 , 0 ) ;
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CWelcomeDlg::OnLButtonDown(UINT nFlags, CPoint point)
- {
- // TODO: Add your message handler code here and/or call default
- KillTimer( 1 ) ;
- PostMessage( WM_CLOSE , 0 , 0 ) ;
- CDialog::OnLButtonDown(nFlags, point);
- }
- BOOL CWelcomeDlg::OnEraseBkgnd(CDC* pDC)
- {
- // TODO: Add your message handler code here and/or call default
- CDialog::OnEraseBkgnd(pDC);
- CDC memDC ;
- memDC.CreateCompatibleDC( pDC ) ;
- CBitmap * pOldBmp = memDC.SelectObject( &m_BackBmp ) ;
- pDC->BitBlt( 0 , 0 , m_iWidth , m_iHeight , &memDC ,
- 0 , 0 , SRCCOPY ) ;
- memDC.SelectObject( pOldBmp ) ;
- return true ;
- }
- void CWelcomeDlg::OnDestroy()
- {
- CDialog::OnDestroy();
- // TODO: Add your message handler code here
- m_BackBmp.DeleteObject( ) ;
- }