0,建立如图所示mfc工程文件 选择基于对话框的确定 删除所有空间,建立如图所示对话框 属性如下: 播放 IDC_open; 添加 IDC_fileopen; 暂停 IDC_pause; 删除 IDC_del; 停止 IDC_stop; 退出 IDC_exit; 音乐名编辑框 IDC_filename; 音量控制滑块 IDC_SLIDER1; 音量控制编辑框 IDC_vol; 建立类向导对应如下: 在工程文件,右键,插入,bitmap 位图 引入你想插入的背景图,必须是 bmp 格式的 进入你的 dlg
cpp 文件 在onpaint 函数下添加代码 void CMp3Dlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc
GetSafeHdc(), 0); // Center icon in client rectangle int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect
Width() - cxIcon + 1) / 2; int y = (rect
Height() - cyIcon + 1) / 2; // Draw the icon dc
DrawIcon(x, y, m_hIcon); } else { //CDialog::OnPaint(); CPaintDC dc(this); CRect rect; GetClientRect(&re