Multimedia


Author : V.Girish

	
Methods for playing an .avi file :-
1) Use CAnimateCtrl :- CAnimateCtrl m_Animate; m_Animate.Create( WS_CHILD | WS_VISIBLE | ACS_TRANSPARENT | ACS_CENTER, CRect(10,10,200,200),this,NULL); m_Animate.Open("D:\\Test\\ok1.avi"); m_Animate.Play(0, -1, -1); Remember to include #include "mmsystem.h" in your program. Add Winmm.lib in your linker settings. NOTE:- Can play ONLY uncompressed .avi files.For Example,it will not work with Globe.avi. 2) Use mciSendString :- ::mciSendString("open D:\\Girish\\Globe.avi",NULL,NULL,NULL); ::mciSendString("play D:\\Girish\\Globe.avi",NULL,NULL,NULL); Remember to include #include "mmsystem.h" in your program. Add Winmm.lib in your linker settings. 3) Use Video For Windows (VFW) :- HWND hMCI; TCHAR szFile[] = "D:\\Girish\\Globe.avi"; hMCI = MCIWndCreate(m_hWnd,AfxGetApp()->m_hInstance, MCIWNDF_SHOWNAME|MCIWNDF_NOMENU, NULL); if (MCIWndOpen(hMCI,szFile, 0) != 0) { MessageBox("Unable to play AVI!","Error!"); MCIWndDestroy(hMCI); } Remember to include #include "vfw.h" in your program. Add vfw32.lib in your linker settings.
To open & Close the CD drive automatically :-
To open the CD-ROM mciSendString("Set cdaudio door open wait",NULL,0,NULL); To close it automatically, mciSendString("Set cdaudio door closed wait",NULL,0,NULL); Remember to include #include "mmsystem.h" in your program. Add Winmm.lib in your linker settings.
Hosted by www.Geocities.ws

1