Click here to Skip to main content
13,357,219 members (62,941 online)
Click here to Skip to main content


105 bookmarked
Posted 8 Dec 2003

A Basic Media Player

, 10 Jan 2013
Using MCIWnd wrapper class to write a simple media player
// mciDlg.h : header file

#if !defined(AFX_mciDLG_H__684F6913_C724_4CD0_9DBD_82A6F717E1CC__INCLUDED_)
#define AFX_mciDLG_H__684F6913_C724_4CD0_9DBD_82A6F717E1CC__INCLUDED_

#include "FullMovie.h"	// Added by ClassView
#include "EasyPlayer.h"	// Added by ClassView
#include "RegistrySettings.h"	// Added by ClassView
#include "PrefDlg.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// CmciDlg dialog

class CmciDlg : public CDialog
	friend class CmciDlgAutoProxy;

// Construction
	CRegistrySettings rs;
	long lPos;
	int lVol;
	CFullMovie dlgFullSize;
	int iPlaying;
	CEasyPlayer myPlayer;
	CString myPath;
	CmciDlg(CWnd* pParent = NULL);	// standard constructor
	virtual ~CmciDlg();

// Dialog Data
	enum { IDD = IDD_mci_DIALOG };
	CStatic	c_Status;
	CSliderCtrl	c_Volume;
	CButton	c_Stop;
	CButton	c_Pause;
	CButton	c_Play;
	CSliderCtrl	c_Slider;
	CStatic	c_Static;
	int		m_PlayPauseStop;
	int		m_Pos;

	// ClassWizard generated virtual function overrides
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

// Implementation
	//CmciDlgAutoProxy* m_pAutoProxy;
	HICON m_hIcon;

	BOOL CanExit();

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnClose();
	virtual void OnOK();
	virtual void OnCancel();
	afx_msg void OnViewFullscreen();
	afx_msg void OnFileOpen();
	afx_msg void OnPlaybackPlayPause();
	afx_msg void OnPlay();
	afx_msg void OnPause();
	afx_msg void OnStop();
	afx_msg void OnFileExit();
	afx_msg void OnDestroy();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnFileClose();
	afx_msg void OnAppAbout();
	afx_msg void OnCustomdrawSlider2(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnCustomdrawSlider1(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnPlaybackVolumeDown();
	afx_msg void OnPlaybackVolumeUp();
	afx_msg void OnViewPreferences();
	afx_msg void OnPlaybackSeekRewind();
	afx_msg void OnPlaybackSeekForward();
	HICON hPlay;
	HICON hPause;
	HICON hStop;

// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_mciDLG_H__684F6913_C724_4CD0_9DBD_82A6F717E1CC__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


About the Author

Mehdi Bonvari
Chief Technology Officer
Iran (Islamic Republic of) Iran (Islamic Republic of)
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180111.1 | Last Updated 10 Jan 2013
Article Copyright 2003 by Mehdi Bonvari
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid