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 } |