Click here to Skip to main content
12,890,181 members (48,551 online)
Click here to Skip to main content
Add your own
alternative version


127 bookmarked
Posted 13 Jun 2001

A very simple MP3 Player

, 13 Jun 2001
Rate this:
Please Sign up or sign in to vote.
A simple MP3/AVI player using the VFW32 library
<!-- Download Links --> <!-- Main HTML starts here -->


I made a little sample program that enables you to play MP3 files without needing the AUDIOX library. I used the Windows Library VFW32.Lib

Just put the VFW32.lib in the Linker's space (Alt +F7) and add

#include "vfw.h"

to your principal file.

Once you've done this, you just need to use the MCI commands:

Steps :

  • Create a private variable HWND m_Video and BOOL Pause;

  • in the OnInitDialog set m_Video = NULL;

  • Put almost the Play button and add this source code on

Here are the functions I use in my dialog class to play/pause/resume and stop video playback.

m_Play is the 'Play' button control, m_Pause is the pause/resume button, Pause is a boolean value, and m_Video is a HWND.

void CAVIPlayerDlg::OnPlay() 
	m_Video = NULL;
	if(m_Video == NULL)
		m_Video = MCIWndCreate(this->GetSafeHwnd(),
	Pause = FALSE;

void CAVIPlayerDlg::OnPause() 
		Pause = FALSE;
		Pause = TRUE;

void CAVIPlayerDlg::OnCancel() 
	if(m_Video !=NULL)

void CAVIPlayerDlg::OnStop() 
	// TODO: Add your control notification handler code here
	if(m_Video !=NULL)

I Suggest you to refer to the MCI Reference on the net at

I also include an AVI player in this program. :-)

That's all for this !


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

United States United States
My name is BLaZe and I have 15 years old

You may also be interested in...

Comments and Discussions

GeneralRe: Changing soundcards. Pin
BLaZiNiX2-Mar-02 6:04
memberBLaZiNiX2-Mar-02 6:04 
GeneralRe: Changing soundcards. Pin
Largie3-Mar-02 21:04
memberLargie3-Mar-02 21:04 
GeneralRe: Changing soundcards. Pin
Guitool30-Jul-02 0:22
memberGuitool30-Jul-02 0:22 
GeneralGood for beginner Pin
LIK27-Feb-02 6:17
memberLIK27-Feb-02 6:17 
GeneralCant compile it :( Pin
antivoid4-Jan-03 23:37
memberantivoid4-Jan-03 23:37 
GeneralI like it:) Pin
Mazdak20-Feb-02 3:52
memberMazdak20-Feb-02 3:52 
Generalto handle mci_stop message Pin
Jaggu13-Dec-01 11:11
memberJaggu13-Dec-01 11:11 
GeneralMp3 player Pin
Jarek Gibek7-Sep-01 2:18
memberJarek Gibek7-Sep-01 2:18 
GeneralRe: Mp3 player Pin
Anonymous10-Mar-02 14:38
memberAnonymous10-Mar-02 14:38 
GeneralBook Pin
Brian Hart15-Jun-01 5:07
memberBrian Hart15-Jun-01 5:07 
GeneralRe: Book Pin
Anonymous19-Jun-01 6:04
memberAnonymous19-Jun-01 6:04 
GeneralNot an MP3 player Pin
Anonymous14-Jun-01 6:20
memberAnonymous14-Jun-01 6:20 
GeneralRe: Not an MP3 player Pin
LOXmith21-Jun-01 21:25
memberLOXmith21-Jun-01 21:25 
GeneralRe: Not an MP3 player Pin
zrsoft16-Dec-01 4:36
memberzrsoft16-Dec-01 4:36 
GeneralRe: Not an MP3 player Pin
Anonymous21-Jul-02 15:03
sussAnonymous21-Jul-02 15:03 
GeneralRe: Not an MP3 player Pin
Christian Graus21-Jul-02 15:30
memberChristian Graus21-Jul-02 15:30 
Generalagree. It is not the code that i expect. Pin
sodic29-Jun-02 10:36
membersodic29-Jun-02 10:36 
GeneralGood job for 15 years old Pin
Brian V Shifrin14-Jun-01 5:30
memberBrian V Shifrin14-Jun-01 5:30 
GeneralRe: Good job for 15 years old Pin
BLaZe14-Jun-01 5:44
memberBLaZe14-Jun-01 5:44 
GeneralRe: Good job for 15 years old Pin
Carlos Antollini14-Jun-01 5:47
memberCarlos Antollini14-Jun-01 5:47 
GeneralRe: Good job for 15 years old Pin
Giles Forster14-Jun-01 11:51
memberGiles Forster14-Jun-01 11:51 
GeneralRe: Good job for 15 years old Pin
Carlos Antollini14-Jun-01 12:05
memberCarlos Antollini14-Jun-01 12:05 
GeneralRe: Good job for 15 years old Pin
Mike Stevenson18-Jun-01 10:32
memberMike Stevenson18-Jun-01 10:32 
GeneralRe: Good job for 15 years old Pin
Anonymous19-Jun-01 9:29
memberAnonymous19-Jun-01 9:29 
GeneralRe: What's Logo Pin
William E. Kempf21-Jun-01 9:10
memberWilliam E. Kempf21-Jun-01 9:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170424.1 | Last Updated 14 Jun 2001
Article Copyright 2001 by BLaZe
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid