home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / msmqocm.cab / recwdlg.cpp < prev    next >
C/C++ Source or Header  |  1997-10-06  |  2KB  |  68 lines

  1. // RecWDlg.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "MQApitst.h"
  6. #include "RecWDlg.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CReceiveWaitDialog dialog
  16.  
  17.  
  18. CReceiveWaitDialog::CReceiveWaitDialog(CWnd* pParent /*=NULL*/)
  19.     : CDialog(CReceiveWaitDialog::IDD, pParent)
  20. {
  21.     //{{AFX_DATA_INIT(CReceiveWaitDialog)
  22.         // NOTE: the ClassWizard will add member initialization here
  23.     //}}AFX_DATA_INIT
  24. }
  25.  
  26.  
  27. void CReceiveWaitDialog::DoDataExchange(CDataExchange* pDX)
  28. {
  29.     CDialog::DoDataExchange(pDX);
  30.     //{{AFX_DATA_MAP(CReceiveWaitDialog)
  31.         // NOTE: the ClassWizard will add DDX and DDV calls here
  32.     //}}AFX_DATA_MAP
  33. }
  34.  
  35.  
  36. BEGIN_MESSAGE_MAP(CReceiveWaitDialog, CDialog)
  37.     //{{AFX_MSG_MAP(CReceiveWaitDialog)
  38.         // NOTE: the ClassWizard will add message map macros here
  39.     //}}AFX_MSG_MAP
  40. END_MESSAGE_MAP()
  41.  
  42. /////////////////////////////////////////////////////////////////////////////
  43. // CReceiveWaitDialog message handlers
  44.  
  45.  
  46. void CReceiveWaitDialog::CenterWindow()
  47. {
  48.     CWnd * pParent = GetParent();
  49.     RECT parentRect;
  50.     RECT childRect;
  51.  
  52.     pParent->GetWindowRect(&parentRect);
  53.     int dxP = parentRect.right-parentRect.left;
  54.     int dyP = parentRect.bottom - parentRect.top;
  55.  
  56.     GetWindowRect(&childRect);
  57.     int dxC = childRect.right-childRect.left;
  58.     int dyC = childRect.bottom - childRect.top;
  59.  
  60.     childRect.left = dxP/2-dxC/2;
  61.     childRect.right = childRect.left+dxC;
  62.  
  63.     childRect.top = dyP/2-dyC/2;
  64.     childRect.bottom = childRect.top+dyC;
  65.  
  66.     MoveWindow(&childRect);
  67. };
  68.