首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

一个容易的闹钟程序

2012-11-08 
一个简单的闹钟程序一个简单的闹钟程序。资源下载地址http://download.csdn.net/detail/lingxiu0613/469560

一个简单的闹钟程序

一个简单的闹钟程序。资源下载地址http://download.csdn.net/detail/lingxiu0613/4695608

主要逻辑是:

设置一个临时时间变量m_strOwnTime,获取系统时间变量strSysTime,然后映射OnTimer函数,

在m_strOwnTime==strSysTime的时候,响闹铃

简单源码:

void CclockDlg::OnTimer(UINT_PTR nIDEvent){// TODO: Add your message handler code here and/or call defaultCString strSysTime;strSysTime = GetSysTime();if (signal_y != 0){if (strSysTime == m_strOwnTime)//判断时间{PlaySound("clock.wav" , NULL , 1);MessageBox("时间到了...");}}CDialog::OnTimer(nIDEvent);}

为了测试时钟,做的一个小功能,勿拍砖。

热点排行