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

IP电话/视频会议

开发平台:

Visual C++

  1. // FullScreenDialog.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "Share.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 * pFullWnd , CWnd* pParent /*=NULL*/)
  14. : CDialog(CFullScreenDialog::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(CFullScreenDialog)
  17. //}}AFX_DATA_INIT
  18. this->pFullWnd = pFullWnd;
  19. }
  20. void CFullScreenDialog::DoDataExchange(CDataExchange* pDX)
  21. {
  22. CDialog::DoDataExchange(pDX);
  23. //{{AFX_DATA_MAP(CFullScreenDialog)
  24. //}}AFX_DATA_MAP
  25. }
  26. BEGIN_MESSAGE_MAP(CFullScreenDialog, CDialog)
  27. //{{AFX_MSG_MAP(CFullScreenDialog)
  28. ON_WM_SIZE()
  29. ON_WM_DESTROY()
  30. ON_WM_NCHITTEST()
  31. //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CFullScreenDialog message handlers
  35. BOOL CFullScreenDialog::OnInitDialog() 
  36. {
  37. CDialog::OnInitDialog( );
  38. //删除系统菜单的移动项
  39. this->GetSystemMenu( FALSE )->RemoveMenu( 1 , MF_BYPOSITION );
  40. this->pFullWnd->SetParent( this );
  41. this->MoveWindow( 0 , 0 , ::GetSystemMetrics( SM_CXSCREEN ) , ::GetSystemMetrics( SM_CYSCREEN ) );
  42. return TRUE;
  43. }
  44. void CFullScreenDialog::OnSize(UINT nType, int cx, int cy) 
  45. {
  46. CDialog::OnSize(nType, cx, cy);
  47. if( ::IsWindow( this->pFullWnd->GetSafeHwnd( ) ) )
  48. this->pFullWnd->MoveWindow( 0 , 0 , cx , cy );
  49. }
  50. void CFullScreenDialog::OnDestroy() 
  51. {
  52. CFrameWnd * frame = ( CFrameWnd * )this->GetOwner( );
  53. if( frame )
  54. {
  55. this->pFullWnd->SetParent( frame );
  56. frame->RecalcLayout( );
  57. this->pFullWnd = NULL;
  58. }
  59. CDialog::OnDestroy( );
  60. }
  61. UINT CFullScreenDialog::OnNcHitTest(CPoint point) 
  62. {
  63. UINT hitTest = CDialog::OnNcHitTest( point );
  64. return hitTest == HTCAPTION ? HTCLIENT : hitTest;
  65. }