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.

77 lines
2.0 KiB

  1. // RecWDlg.cpp : implementation file
  2. //
  3. //=--------------------------------------------------------------------------=
  4. // Copyright 1997-1999 Microsoft Corporation. All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. #include "stdafx.h"
  12. #include "MQApitst.h"
  13. #include "RecWDlg.h"
  14. #ifdef _DEBUG
  15. #define new DEBUG_NEW
  16. #undef THIS_FILE
  17. static char THIS_FILE[] = __FILE__;
  18. #endif
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CReceiveWaitDialog dialog
  21. CReceiveWaitDialog::CReceiveWaitDialog(CWnd* pParent /*=NULL*/)
  22. : CDialog(CReceiveWaitDialog::IDD, pParent)
  23. {
  24. //{{AFX_DATA_INIT(CReceiveWaitDialog)
  25. // NOTE: the ClassWizard will add member initialization here
  26. //}}AFX_DATA_INIT
  27. }
  28. void CReceiveWaitDialog::DoDataExchange(CDataExchange* pDX)
  29. {
  30. CDialog::DoDataExchange(pDX);
  31. //{{AFX_DATA_MAP(CReceiveWaitDialog)
  32. // NOTE: the ClassWizard will add DDX and DDV calls here
  33. //}}AFX_DATA_MAP
  34. }
  35. BEGIN_MESSAGE_MAP(CReceiveWaitDialog, CDialog)
  36. //{{AFX_MSG_MAP(CReceiveWaitDialog)
  37. // NOTE: the ClassWizard will add message map macros here
  38. //}}AFX_MSG_MAP
  39. END_MESSAGE_MAP()
  40. /////////////////////////////////////////////////////////////////////////////
  41. // CReceiveWaitDialog message handlers
  42. void CReceiveWaitDialog::CenterWindow()
  43. {
  44. CWnd * pParent = GetParent();
  45. RECT parentRect;
  46. RECT childRect;
  47. pParent->GetWindowRect(&parentRect);
  48. int dxP = parentRect.right-parentRect.left;
  49. int dyP = parentRect.bottom - parentRect.top;
  50. GetWindowRect(&childRect);
  51. int dxC = childRect.right-childRect.left;
  52. int dyC = childRect.bottom - childRect.top;
  53. childRect.left = dxP/2-dxC/2;
  54. childRect.right = childRect.left+dxC;
  55. childRect.top = dyP/2-dyC/2;
  56. childRect.bottom = childRect.top+dyC;
  57. MoveWindow(&childRect);
  58. };