FullScreenDialog.cpp
资源名称:视频会议系统.rar [点击查看]
上传用户:popouu88
上传日期:2013-02-11
资源大小:2894k
文件大小:2k
源码类别:
IP电话/视频会议
开发平台:
Visual C++
- // FullScreenDialog.cpp : implementation file
- //
- #include "stdafx.h"
- #include "conference.h"
- #include "FullScreenDialog.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CFullScreenDialog dialog
- CFullScreenDialog::CFullScreenDialog( CWnd* pParent /*=NULL*/)
- : CDialog(CFullScreenDialog::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CFullScreenDialog)
- //}}AFX_DATA_INIT
- this->fullWnd = NULL;
- this->oldParent = NULL;
- this->oldRect = CRect( 0 , 0 , 0 , 0 );
- this->oldVisible = false;
- }
- void CFullScreenDialog::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CFullScreenDialog)
- DDX_Control(pDX, IDC_FULL_STATIC, m_full);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CFullScreenDialog, CDialog)
- //{{AFX_MSG_MAP(CFullScreenDialog)
- ON_WM_DESTROY()
- ON_WM_NCHITTEST()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CFullScreenDialog message handlers
- BOOL CFullScreenDialog::OnInitDialog()
- {
- CDialog::OnInitDialog( );
- this->GetSystemMenu( FALSE )->RemoveMenu( 0 , MF_BYPOSITION );
- if( ! ::IsWindow( this->fullWnd->GetSafeHwnd( ) ) )
- this->EndDialog( IDOK );
- else
- {
- this->MoveWindow( 0 , 0 , ::GetSystemMetrics( SM_CXSCREEN ) , ::GetSystemMetrics( SM_CYSCREEN ) );
- CRect rc;
- this->GetClientRect( &rc );
- this->m_full.MoveWindow( &rc );
- this->fullWnd->GetWindowRect( &this->oldRect );
- this->oldParent = this->fullWnd->SetParent( &this->m_full );
- this->oldParent->ScreenToClient( &this->oldRect );
- this->oldVisible = this->fullWnd->GetStyle( ) & WS_VISIBLE;
- this->fullWnd->MoveWindow( &rc );
- this->fullWnd->ShowWindow( SW_SHOW );
- }
- return TRUE;
- }
- void CFullScreenDialog::OnDestroy()
- {
- CDialog::OnDestroy( );
- if( ::IsWindow( this->oldParent->GetSafeHwnd( ) ) && ::IsWindow( this->fullWnd->GetSafeHwnd( ) ) )
- {
- this->fullWnd->SetParent( this->oldParent );
- this->fullWnd->MoveWindow( &this->oldRect );
- if( ! this->oldVisible )
- this->fullWnd->ShowWindow( SW_HIDE );
- }
- }
- UINT CFullScreenDialog::OnNcHitTest(CPoint point)
- {
- UINT nHitTest = CDialog::OnNcHitTest(point);
- return nHitTest == HTCAPTION ? HTCLIENT : nHitTest;
- }