PROGRESSWIN.CPP
上传用户:sanlisteel
上传日期:2008-06-19
资源大小:98k
文件大小:2k
源码类别:

数据库系统

开发平台:

C/C++

  1. // ProgressWin.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "tbvc.h"
  5. #include "ProgressWin.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CProgressWin
  13. IMPLEMENT_DYNCREATE(CProgressWin, CWinThread)
  14. CProgressWin::CProgressWin()
  15. {
  16. }
  17. CProgressWin::~CProgressWin()
  18. {
  19. }
  20. BOOL CProgressWin::InitInstance()
  21. {
  22. // TODO:  perform and per-thread initialization here
  23. m_pWindow.CreateEx(0,
  24.              AfxRegisterWndClass(CS_VREDRAW | CS_HREDRAW,
  25.                      ::LoadCursor(NULL, IDC_ARROW),
  26.  (HBRUSH) ::GetStockObject(BLACK_BRUSH),
  27.  ::LoadIcon(NULL, IDI_APPLICATION)),
  28.  "正在发送...",
  29.  WS_VISIBLE|WS_POPUP|WS_CAPTION   ,
  30.  CRect(0,0,0,0),
  31.          NULL,
  32.          0);
  33. HDC hdc=::GetDC(NULL);
  34. // m_pWindow.GetParent()->GetDC();
  35.     //::GetDeviceCaps(HORZRES)
  36.     int scWidth =::GetDeviceCaps(hdc,HORZRES);
  37. int scHeight = ::GetDeviceCaps(hdc,VERTRES);
  38. m_pWindow.CenterWindow();
  39. m_pWindow.MoveWindow(scWidth/2-125,scHeight/2-50,250,100);
  40.     //m_pWindow.GetParent()->ReleaseDC(m_pDC);
  41.     m_pMainWnd=&m_pWindow;
  42.     
  43.     
  44. return TRUE;
  45. }
  46. int CProgressWin::ExitInstance()
  47. {
  48. // TODO:  perform any per-thread cleanup here
  49. return CWinThread::ExitInstance();
  50. }
  51. BEGIN_MESSAGE_MAP(CProgressWin, CWinThread)
  52. //{{AFX_MSG_MAP(CProgressWin)
  53. ON_THREAD_MESSAGE(WM_QUITTHREAD,OnQuitthread)
  54. //}}AFX_MSG_MAP
  55. END_MESSAGE_MAP()
  56. /////////////////////////////////////////////////////////////////////////////
  57. // CProgressWin message handlers
  58. void CProgressWin::OnQuitthread()
  59. {
  60. AfxEndThread(0);
  61. }