龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VC开发 >

制作自动循环播放的MP3播放器(下)

时间:2009-12-30 15:42来源:未知 作者:admin 点击:
分享到:
BOOL CMp3PlayerDlg::OnInitDialog()//初始化函数 { m_DlgStyle.sTitleName = "音乐播放器";//设定标题 COwnerDrawDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the applications


 BOOL CMp3PlayerDlg::OnInitDialog()//初始化函数
{

       m_DlgStyle.sTitleName = "音乐播放器";//设定标题

       COwnerDrawDialog::OnInitDialog();

       // Set the icon for this dialog.  The framework does this automatically

       //  when the application's main window is not a dialog

       SetIcon(m_hIcon, TRUE);                 // Set big icon

       SetIcon(m_hIcon, FALSE);         // Set small icon

       SetTimer(4,100,NULL);//启动4号定时器
 

  ///////////////

        if(m_bAutoRun)

              SetTimer(1,1000,NULL);//如果是自动播放,则启动1号定时器

       //以下为应用程序隐藏任务栏,放到托盘中去的程序

       long wl = GetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE);

       SetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE,WS_EX_TOOLWINDOW);

       //

       NOTIFYICONDATA tnd;

       tnd.cbSize=sizeof(NOTIFYICONDATA);

       tnd.hWnd=this->m_hWnd;

       tnd.uID=IDI_MAINFRAME;

       tnd.uFlags=NIF_MESSAGE|NIF_ICON|NIF_TIP;

       tnd.uCallbackMessage=WM_DLG_SHOW;

       tnd.hIcon=LoadIcon(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_MAINFRAME));

       strcpy(tnd.szTip,"音乐播放器");

       Shell_NotifyIcon(NIM_ADD,&tnd);

       return TRUE;  // return TRUE  unless you set the focus to a control

}

  =================

精彩图集

赞助商链接