PROGRESSWIN.CPP
上传用户:sanlisteel
上传日期:2008-06-19
资源大小:98k
文件大小:2k
- // ProgressWin.cpp : implementation file
- //
- #include "stdafx.h"
- #include "tbvc.h"
- #include "ProgressWin.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CProgressWin
- IMPLEMENT_DYNCREATE(CProgressWin, CWinThread)
- CProgressWin::CProgressWin()
- {
- }
- CProgressWin::~CProgressWin()
- {
- }
- BOOL CProgressWin::InitInstance()
- {
- // TODO: perform and per-thread initialization here
-
- m_pWindow.CreateEx(0,
- AfxRegisterWndClass(CS_VREDRAW | CS_HREDRAW,
- ::LoadCursor(NULL, IDC_ARROW),
- (HBRUSH) ::GetStockObject(BLACK_BRUSH),
- ::LoadIcon(NULL, IDI_APPLICATION)),
- "正在发送...",
- WS_VISIBLE|WS_POPUP|WS_CAPTION ,
- CRect(0,0,0,0),
- NULL,
- 0);
- HDC hdc=::GetDC(NULL);
- // m_pWindow.GetParent()->GetDC();
- //::GetDeviceCaps(HORZRES)
- int scWidth =::GetDeviceCaps(hdc,HORZRES);
- int scHeight = ::GetDeviceCaps(hdc,VERTRES);
- m_pWindow.CenterWindow();
- m_pWindow.MoveWindow(scWidth/2-125,scHeight/2-50,250,100);
- //m_pWindow.GetParent()->ReleaseDC(m_pDC);
- m_pMainWnd=&m_pWindow;
-
-
- return TRUE;
- }
- int CProgressWin::ExitInstance()
- {
- // TODO: perform any per-thread cleanup here
- return CWinThread::ExitInstance();
- }
- BEGIN_MESSAGE_MAP(CProgressWin, CWinThread)
- //{{AFX_MSG_MAP(CProgressWin)
- ON_THREAD_MESSAGE(WM_QUITTHREAD,OnQuitthread)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CProgressWin message handlers
- void CProgressWin::OnQuitthread()
- {
- AfxEndThread(0);
- }