home *** CD-ROM | disk | FTP | other *** search
/ Prima Shareware 3 / DuCom_Prima-Shareware-3_cd1.bin / PROGRAMO / C / MRCE / DOCKTEST.ZIP / VIDEOCLI.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-12  |  2.1 KB  |  82 lines

  1. // videocli.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "docktest.h"
  6. #include "videocli.h"
  7.  
  8. #ifdef _DEBUG
  9. #undef THIS_FILE
  10. static char BASED_CODE THIS_FILE[] = __FILE__;
  11. #endif
  12.  
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CVideoClipDialog dialog
  15.  
  16.  
  17. CVideoClipDialog::CVideoClipDialog(CWnd* pParent /*=NULL*/)
  18.     : CDialog(CVideoClipDialog::IDD, pParent)
  19. {
  20.     //{{AFX_DATA_INIT(CVideoClipDialog)
  21.         // NOTE: the ClassWizard will add member initialization here
  22.     //}}AFX_DATA_INIT
  23. }
  24.  
  25.  
  26. void CVideoClipDialog::DoDataExchange(CDataExchange* pDX)
  27. {
  28.     CDialog::DoDataExchange(pDX);
  29.     //{{AFX_DATA_MAP(CVideoClipDialog)
  30.         // NOTE: the ClassWizard will add DDX and DDV calls here
  31.     //}}AFX_DATA_MAP
  32. }
  33.  
  34.  
  35. BEGIN_MESSAGE_MAP(CVideoClipDialog, CDialog)
  36.     //{{AFX_MSG_MAP(CVideoClipDialog)
  37.     //}}AFX_MSG_MAP
  38. END_MESSAGE_MAP()
  39.  
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CVideoClipDialog message handlers
  43.  
  44. BOOL CVideoClipDialog::OnInitDialog() 
  45. {
  46.     CDialog::OnInitDialog();
  47.     
  48.     CWnd * pGroupBox = GetDlgItem(IDC_GROUP);
  49.  
  50.     CRect rect;
  51.     pGroupBox->GetClientRect(&rect);
  52.     
  53.     char szPath[MAX_PATH], szDrive[MAX_PATH], szDir[MAX_PATH],
  54.                  szName[MAX_PATH], szExt[MAX_PATH];
  55.         
  56.     GetModuleFileName(NULL, szPath, MAX_PATH);
  57.     _splitpath(szPath, szDrive, szDir, szName, szExt);
  58.     _makepath(szPath, szDrive, szDir, "smugfngr", "avi");
  59.             
  60.     m_pSmugVideo = new CMRCAnimateCtrl;
  61.     if (m_pSmugVideo->Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER,
  62.                                 rect, pGroupBox, 99))
  63.     {
  64.         if (m_pSmugVideo->Open(szPath)     
  65.                     && m_pSmugVideo->Play(ACF_REPEAT, 0, -1, 0 ))
  66.         {    
  67.             CenterWindowWithinParent(m_pSmugVideo);
  68.         }
  69.         else
  70.         {
  71.             m_pSmugVideo->DestroyWindow();
  72.               CString strMsg;
  73.             strMsg.Format("Error playing AVI file. Please ensure %s exists in the specified directory", 
  74.                          szPath);              
  75.               AfxMessageBox(strMsg);
  76.         }
  77.     }        
  78.     
  79.     return TRUE;  // return TRUE unless you set the focus to a control
  80.                   // EXCEPTION: OCX Property Pages should return FALSE
  81. }
  82.