FullScreenDialog.cpp
上传用户:popouu88
上传日期:2013-02-11
资源大小:2894k
文件大小:2k
源码类别:

IP电话/视频会议

开发平台:

Visual C++

  1. // FullScreenDialog.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "conference.h"
  5. #include "FullScreenDialog.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CFullScreenDialog dialog
  13. CFullScreenDialog::CFullScreenDialog( CWnd* pParent /*=NULL*/)
  14. : CDialog(CFullScreenDialog::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(CFullScreenDialog)
  17. //}}AFX_DATA_INIT
  18. this->fullWnd = NULL;
  19. this->oldParent = NULL;
  20. this->oldRect = CRect( 0 , 0 , 0 , 0 );
  21. this->oldVisible = false;
  22. }
  23. void CFullScreenDialog::DoDataExchange(CDataExchange* pDX)
  24. {
  25. CDialog::DoDataExchange(pDX);
  26. //{{AFX_DATA_MAP(CFullScreenDialog)
  27. DDX_Control(pDX, IDC_FULL_STATIC, m_full);
  28. //}}AFX_DATA_MAP
  29. }
  30. BEGIN_MESSAGE_MAP(CFullScreenDialog, CDialog)
  31. //{{AFX_MSG_MAP(CFullScreenDialog)
  32. ON_WM_DESTROY()
  33. ON_WM_NCHITTEST()
  34. //}}AFX_MSG_MAP
  35. END_MESSAGE_MAP()
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CFullScreenDialog message handlers
  38. BOOL CFullScreenDialog::OnInitDialog() 
  39. {
  40. CDialog::OnInitDialog( );
  41. this->GetSystemMenu( FALSE )->RemoveMenu( 0 , MF_BYPOSITION );
  42. if( ! ::IsWindow( this->fullWnd->GetSafeHwnd( ) ) )
  43. this->EndDialog( IDOK );
  44. else
  45. {
  46. this->MoveWindow( 0 , 0 , ::GetSystemMetrics( SM_CXSCREEN ) , ::GetSystemMetrics( SM_CYSCREEN ) );
  47. CRect rc;
  48. this->GetClientRect( &rc );
  49. this->m_full.MoveWindow( &rc );
  50. this->fullWnd->GetWindowRect( &this->oldRect );
  51. this->oldParent = this->fullWnd->SetParent( &this->m_full );
  52. this->oldParent->ScreenToClient( &this->oldRect );
  53. this->oldVisible = this->fullWnd->GetStyle( ) & WS_VISIBLE;
  54. this->fullWnd->MoveWindow( &rc );
  55. this->fullWnd->ShowWindow( SW_SHOW );
  56. }
  57. return TRUE;
  58. }
  59. void CFullScreenDialog::OnDestroy() 
  60. {
  61. CDialog::OnDestroy( );
  62. if( ::IsWindow( this->oldParent->GetSafeHwnd( ) ) && ::IsWindow( this->fullWnd->GetSafeHwnd( ) ) )
  63. {
  64. this->fullWnd->SetParent( this->oldParent );
  65. this->fullWnd->MoveWindow( &this->oldRect );
  66. if( ! this->oldVisible )
  67. this->fullWnd->ShowWindow( SW_HIDE );
  68. }
  69. }
  70. UINT CFullScreenDialog::OnNcHitTest(CPoint point) 
  71. {
  72. UINT nHitTest = CDialog::OnNcHitTest(point);
  73. return nHitTest == HTCAPTION ? HTCLIENT : nHitTest;
  74. }