手机坏
下载闹钟软件
乱
自己写个垃圾应付一下早上无闹钟的情况
非常简单的
LRESULT CMainDlg::OnBnClickedButton1(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
// TODO: 在此添加控件通知处理程序代码
CEdit ehour = GetDlgItem(IDC_EDIT1);
CEdit emin = GetDlgItem(IDC_EDIT2);
CButton btnStart = GetDlgItem(IDC_BUTTON1);
if( bstart == false) //还未开始 点击了是要开始
{
ATL::CString strTemp;
ehour.GetWindowText(strTemp);
int hour = _wtoi(strTemp.GetBuffer());
emin.GetWindowText(strTemp);
int tmin = _wtoi(strTemp.GetBuffer());
this->no_hour = hour;
this->no_min = tmin;
SetTimer(1,3000,0);
ehour.EnableWindow(false);
emin.EnableWindow(false);
btnStart.SetWindowText(L"End");
bstart = true;
brun_one = false;
}
else if ( bstart == true) //已经开始 点击是结束
{
ehour.EnableWindow(true);
emin.EnableWindow(true);
KillTimer(1);
bstart = false;
btnStart.SetWindowText(L"Start");
brun_one = false;
mp3.Close();
}
return 0;
}
LRESULT CMainDlg::OnTimer(UINT_PTR nIDEvent)
{
//CTime tmer = CTime::GetCurrentTime();
KillTimer(1);
time_t t;
time(&t);
struct tm *tmtmer = localtime(&t);
if((tmtmer->tm_hour == this->no_hour ) && ( tmtmer->tm_min == this->no_min))
{
if(brun_one == false )
{
//MessageBox(L"",L"",0);
mp3.Open(L"Superman.mp3");
mp3.Play();
brun_one = true;
KillTimer(1);
}
}
SetTimer(1,3000,0);
return 0;
}
/Files/jimsmorong/nozhong.rar