MFC中实现定时执行与提醒功能(自编代码)
下面仅列举核心代码,详细步聚不作说明,效果如下所示:
void CShowTimer::OnTimer(UINT_PTR nIDEvent)
{
if (nIDEvent==1)
{
UpdateData(true);
CString hour;
CString minute;
CString second;
CString get_time_Hour;
CString get_time_Minute;
CString get_time_Second;
hour = m_time_edit2.Format("%H");
minute = m_time_edit2.Format("%M");
second = m_time_edit2.Format("%S");
CTime get_time=CTime::GetCurrentTime();
get_time_Hour=get_time.Format("%H");
get_time_Minute=get_time.Format("%M");
get_time_Second=get_time.Format("%S");
if (get_time_Hour==hour&&get_time_Minute==minute&&get_time_Second==second)
{
GetDlgItemText(IDC_EDIT_1,m_value_edit);
MessageBox(m_value_edit,"提示",64);
while (true)
{
GetDlgItemText(IDC_EDIT_3,m_value_edit3);
int m_edit3=atoi(m_value_edit3);
Sleep(m_edit3*1000*60);
MessageBox(m_value_edit,"提示",64);
}
}
else
{
return;
}
}
CDialog::OnTimer(nIDEvent);
}
其中上述,hour = m_time_edit2.Format("%H");
minute = m_time_edit2.Format("%M");
second = m_time_edit2.Format("%S"); 用来获取时间控件中时间,分钟与秒数,
get_time_Hour=get_time.Format("%H");
get_time_Minute=get_time.Format("%M");
get_time_Second=get_time.Format("%S");,用来获取当前系统运行的时间,分钟与秒数。
另外,两个设置按钮,通过双击按钮处理事件,添加如下代码即可:UpdateData(true);
上述为整个实现的核心代码。
MFC中实现定时执行与提醒功能(自编代码)的更多相关文章
- ASP.NET 中的定时执行任务
在一个网站中,设定一些任务能够在后台定时执行. public static void AddTask(int seconds, Action todo) { HttpRuntime.Cache.Ins ...
- Quartz.net 定时任务在IIS中没有定时执行
问题:Quartz.net 定时任务在项目部署到IIS中发现没有定时执行 解决方案: 1.在服务器上装一个360(自带自动刷新功能),在工具——>自动刷新——>自动刷新勾上 然后再设置一下 ...
- (转载)php中实现定时执行计划任务方法
(转载)http://www.111cn.net/phper/php/41216.htm PHP脚本执行时间限制,默认的是30m 解决办法:set_time_limit();或者修改PHP.ini 设 ...
- python实现秒杀商品的微信自动提醒功能(附代码)
技术实现原理:获取京东的具体的商品信息,然后再使用微信发送提醒 工具:需要两个微信号,这两个微信号互为好友 如果你处于想学Python或者正在学习Python,Python的教程不少了吧,但是是最新的 ...
- SpringBoot中使用@scheduled定时执行任务需要注意的坑
spring boot: 计划任务@ EnableScheduling和@Scheduled @Scheduled中的参数说明 @Scheduled(fixedRate=2000):上一次开始执行时间 ...
- 后端利用Redis队列及哈希实现定时推送提醒的三个思路
周煦辰 2016年8月31日 本文介绍了一下本人在开发过程中遇到"定时推送提醒"的需求的时候所思考的三种解决方案. 明确问题 首先明确一下这个需求可能包含的几个"坑&qu ...
- Linux中计划任务执行脚本crontab-简洁版
我使用的是ubuntu16,所以在ubuntu中一切正常,在其他linux系统中应该都差不多. 1 计划任务,crontab命令选项: -u指定一个用户, -l列出某个用户的任务计划, ...
- linux中计划任务执行脚本
我使用的是ubuntu14.4,所以在ubuntu中一切正常,在其他linux系统中应该都差不多. 1 计划任务,crontab命令选项: -u指定一个用户, -l列出某个用户的任务计 ...
- Jquery打造的类似新浪微博@提醒功能
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
随机推荐
- 查看Windows支持的内存大小
cmd命令: wmic memphysical get maxcapacity
- perl Mail::Sender模块发送邮件
#!/usr/bin/perl -w use strict; use Mail::Sender; ; ){ my $sender = Mail::Sender->new({ smtp => ...
- boolean attribute(布尔值属性) attribute vs property
boolean attribute(布尔值属性) boolean attribute HTML - Why boolean attributes do not have boolean val ...
- token 小记
最近了解下基于 Token 的身份验证,跟大伙分享下.很多大型网站也都在用,比如 Facebook,Twitter,Google+,Github 等等,比起传统的身份验证方法,Token 扩展性更强, ...
- redis 2
http://www.infoq.com/cn/articles/tq-redis-memory-usage-optimization-storage 在Ubuntu下安装reids redis-2. ...
- XOR and Favorite Number(莫队算法+分块)
E. XOR and Favorite Number time limit per test 4 seconds memory limit per test 256 megabytes input s ...
- Tomcat下log4j设置文件路径和temp目录
转自:http://www.cnblogs.com/dkblog/archive/2007/07/27/1980873.html 在Web应用中的如何设置日志文件的路径呢?最笨的方法是写绝对路径,但很 ...
- iOS开发瀑布流的实现
//自定义布局,继承于UICollectionViewLayout #import <UIKit/UIKit.h> @class WaterFlowLayout; @protocol W ...
- 2016WHD.china世界云计算日·北京站即将召开
WHD.china自进驻中国以来,已在上海.北京成功举办多届,2015年于北京举办的会议更是盛况空前,注册参会者逾800人次,汇聚了国内外众多知名云服务商.IDC商.电子商务企业.电信运营商.ISP等 ...
- 向网页中写入js和css
向网页中写入js和css 本函数由前辈所写 loadFile: function (url, ftype) { var fileref; if (ftype == "js") { ...