ConnectDlg.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // ConnectDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "LYFZIPManage.h"
  5. #include "ConnectDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CConnectDlg dialog
  13. CConnectDlg::CConnectDlg(CWnd* pParent /*=NULL*/)
  14. : CDialog(CConnectDlg::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(CConnectDlg)
  17. // NOTE: the ClassWizard will add member initialization here
  18. //}}AFX_DATA_INIT
  19. }
  20. void CConnectDlg::DoDataExchange(CDataExchange* pDX)
  21. {
  22. CDialog::DoDataExchange(pDX);
  23. //{{AFX_DATA_MAP(CConnectDlg)
  24. // NOTE: the ClassWizard will add DDX and DDV calls here
  25. //}}AFX_DATA_MAP
  26. }
  27. BEGIN_MESSAGE_MAP(CConnectDlg, CDialog)
  28. //{{AFX_MSG_MAP(CConnectDlg)
  29. ON_WM_TIMER()
  30. ON_WM_CLOSE()
  31. ON_WM_DESTROY()
  32. //}}AFX_MSG_MAP
  33. END_MESSAGE_MAP()
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CConnectDlg message handlers
  36. void CConnectDlg::OnOK()
  37. {
  38. // TODO: Add extra validation here
  39. }
  40. void CConnectDlg::OnCancel()
  41. {
  42. // TODO: Add extra cleanup here
  43. }
  44. extern HWND g_hConnectWnd;
  45. BOOL CConnectDlg::OnInitDialog()
  46. {
  47. CDialog::OnInitDialog();
  48. g_hConnectWnd=m_hWnd;
  49. // TODO: Add extra initialization here
  50. SetTimer(1, 100, NULL);
  51. return TRUE; // return TRUE unless you set the focus to a control
  52. // EXCEPTION: OCX Property Pages should return FALSE
  53. }
  54. void CConnectDlg::OnTimer(UINT nIDEvent)
  55. {
  56. // TODO: Add your message handler code here and/or call default
  57. KillTimer(nIDEvent);
  58. if(g_pMainWnd->OnConnect()==0)
  59. {
  60. SetTimer(1, 1000, NULL);return;
  61. //::Sleep (1000);
  62. }
  63. g_bSendOK=1; g_hConnectWnd=NULL;
  64. CDialog::OnCancel ();
  65. }
  66. void CConnectDlg::OnClose()
  67. {
  68. // TODO: Add your message handler code here and/or call default
  69. KillTimer(1); g_hConnectWnd=NULL;
  70. CDialog::OnCancel ();
  71. }
  72. void CConnectDlg::OnDestroy()
  73. {
  74. CDialog::OnDestroy();
  75. g_hConnectWnd=NULL;
  76. // TODO: Add your message handler code here
  77. }