计划运行 Windows Mobile 应用程序 [英] Scheduling Windows Mobile apps to run

查看:50
本文介绍了计划运行 Windows Mobile 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您如何安排 Windows Mobile 应用程序定期启动以执行某些后台处理.例如,假设我正在编写一个电子邮件客户端,并且想要每小时检查一次电子邮件,而不管我的应用当时是否正在运行.

How do you schedule a Windows Mobile application to periodically start up to perform some background processing. For example, assume I'm writing an email client and want to check for email every hour, regardless of whether my app is running at the time.

该应用是 Windows Mobile 5.0 或更高版本上的原生 C/C++ 应用.

The app is a native C/C++ app on Windows Mobile 5.0 or later.

推荐答案

你需要的功能是:

CeRunAppAtTime( appname, time )

这不是确切的签名,还有 CeRunAppAtEvent,它们都应该在 MSDN 文档中(但链接是无用的,因为 MSDN url 总是会改变)

that isn't the exact signature, there is also CeRunAppAtEvent, they should both be in the MSDN docs (but linking is useless the way MSDN urls always change)

使用这些(以及通过 OpenNETCF.Win32.Notify 在托管世界中的 RunAppAtTime )的正常方法是定期执行,每次您的应用程序运行时,它将在下一次运行时自行重新安排.

The normal way to use these (and RunAppAtTime in the managed world via OpenNETCF.Win32.Notify ) is that for periodic execution, every time your app runs, it will rescedule itself for its next run-time.

如果您的应用正在运行,则新实例应启动已运行的进程.如果它没有运行,那么它就像正常启动一样 - 从 mmory 它向进程传递一些参数,因此它可以告诉它正在被调度而不是以其他方式启动.

If your app is running, the new instance should bring up the already running process. If it isn't running, then it is just like starting up normally - from mmory it passes some argument to the process so it can tell it is being scheduled and not started some other way.

这篇关于计划运行 Windows Mobile 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆