Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.0 KiB

  1. // CWiaAcquireDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "wiatest.h"
  5. #include "wiaacquiredlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CWiaAcquireDlg dialog
  13. CWiaAcquireDlg::CWiaAcquireDlg(CWnd* pParent /*=NULL*/)
  14. : CDialog(CWiaAcquireDlg::IDD, pParent)
  15. {
  16. m_bCanceled = FALSE;
  17. //{{AFX_DATA_INIT(CWiaAcquireDlg)
  18. m_szAcquisitionCallbackMessage = _T("");
  19. m_szPercentComplete = _T("");
  20. //}}AFX_DATA_INIT
  21. }
  22. void CWiaAcquireDlg::DoDataExchange(CDataExchange* pDX)
  23. {
  24. CDialog::DoDataExchange(pDX);
  25. //{{AFX_DATA_MAP(CWiaAcquireDlg)
  26. DDX_Control(pDX, IDC_ACQUIRE_PROGRESS, m_AcquireProgressCtrl);
  27. DDX_Text(pDX, IDC_DATA_ACQUISITION_MESSAGE, m_szAcquisitionCallbackMessage);
  28. DDX_Text(pDX, IDC_DATA_ACQUSITION_PERCENTCOMPLETE, m_szPercentComplete);
  29. //}}AFX_DATA_MAP
  30. }
  31. BEGIN_MESSAGE_MAP(CWiaAcquireDlg, CDialog)
  32. //{{AFX_MSG_MAP(CWiaAcquireDlg)
  33. //}}AFX_MSG_MAP
  34. END_MESSAGE_MAP()
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CWiaAcquireDlg message handlers
  37. void CWiaAcquireDlg::OnCancel()
  38. {
  39. m_bCanceled = TRUE;
  40. }
  41. BOOL CWiaAcquireDlg::OnInitDialog()
  42. {
  43. CDialog::OnInitDialog();
  44. m_AcquireProgressCtrl.SetPos(0);
  45. m_AcquireProgressCtrl.SetRange(0,100);
  46. return TRUE; // return TRUE unless you set the focus to a control
  47. // EXCEPTION: OCX Property Pages should return FALSE
  48. }
  49. BOOL CWiaAcquireDlg::CheckCancelButton()
  50. {
  51. MSG msg;
  52. while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
  53. if (!m_hWnd || !IsDialogMessage(&msg)) {
  54. TranslateMessage(&msg);
  55. DispatchMessage(&msg);
  56. }
  57. }
  58. return m_bCanceled;
  59. }
  60. void CWiaAcquireDlg::SetCallbackMessage(TCHAR *szCallbackMessage)
  61. {
  62. m_szAcquisitionCallbackMessage = szCallbackMessage;
  63. UpdateData(FALSE);
  64. }
  65. void CWiaAcquireDlg::SetPercentComplete(LONG lPercentComplete)
  66. {
  67. m_szPercentComplete.Format(TEXT("%d%%"),lPercentComplete);
  68. UpdateData(FALSE);
  69. }