欢迎来到天天文库
浏览记录
ID:44815235
大小:123.50 KB
页数:15页
时间:2019-10-29
《基于MFC的音乐播放器vc6.0》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、1.新建一个基于对话框的player工程,对话框如图:2.各个控件属性如下图:1.在头文件playerDlg.h中添加如下:#if!defined(AFX_PLAYERDLG_H__A2A8C582_CC8E_4EED_85A6_7AC126703D36__INCLUDED_)#defineAFX_PLAYERDLG_H__A2A8C582_CC8E_4EED_85A6_7AC126703D36__INCLUDED_#if_MSC_VER>1000#pragmaonce#endif//_MSC_VER>1000/////////
2、//////////////////////////////////////////////////////////////////////CPlayerDlgdialogclassCPlayerDlg:publicCDialog{//Constructionpublic:CPlayerDlg(CWnd*pParent=NULL);//standardconstructorCStringm_title;//歌曲名称UINTm_count;//标志DWORDcdlen;//歌曲时间CStringFileName;BOOLm_fla
3、g;inti;intsecond,hour,minute;intm_max;CStringstime;//播放时长CStringallTime;//歌曲总时长DWORDcdfrom,cdto,aa;//歌曲的起点和终点//DialogData//{{AFX_DATA(CPlayerDlg)enum{IDD=IDD_PLAYER_DIALOG};CStaticm_playing;CStaticm_ST_Pause;CSliderCtrlm_setvoice;CSliderCtrlm_control;CButtonm_delete;
4、CButtonm_per;CButtonm_next;CButtonm_play;CButtonm_pause;CListBoxm_list2;//}}AFX_DATA//ClassWizardgeneratedvirtualfunctionoverrides//{{AFX_VIRTUAL(CPlayerDlg)protected:virtualvoidDoDataExchange(CDataExchange*pDX);//DDX/DDVsupport//}}AFX_VIRTUAL//Implementationprotecte
5、d:HICONm_hIcon;//Generatedmessagemapfunctions//{{AFX_MSG(CPlayerDlg)virtualBOOLOnInitDialog();afx_msgvoidOnSysCommand(UINTnID,LPARAMlParam);afx_msgvoidOnPaint();afx_msgHCURSOROnQueryDragIcon();afx_msgvoidAddSong();afx_msgvoidstopPlay();afx_msgvoidplaySong(CStringstr)
6、;afx_msgvoidOnButtonPause();afx_msgvoidDelSong();afx_msgvoidOnSelchangelist();afx_msgvoidsongListDBClk();afx_msgvoidNextSong();afx_msgDWORDsetvolume(DWORDvol);afx_msgvoidpreSong();afx_msgvoidOnTimer(UINTnIDEvent);afx_msgvoidOnButton1();afx_msgvoiddeltSong();afx_msgDW
7、ORDgetinfo(DWORDitem);afx_msgvoidOnVoice(NMHDR*pNMHDR,LRESULT*pResult);afx_msgvoidOnsetvoices(NMHDR*pNMHDR,LRESULT*pResult);afx_msgvoidOnPrevis();afx_msgvoidOnNexts();afx_msgvoidOnexit();//}}AFX_MSGDECLARE_MESSAGE_MAP()};1.在playerDlg.cpp中的函数如下//playerDlg.cpp:implemen
8、tationfile//#include"stdafx.h"#include"player.h"#include"playerDlg.h"#pragmacomment(lib,"winmm.lib")#include"mmsystem.h"#include"Di
此文档下载收益归作者所有