“背景循环”的最佳方式 [英] Best way to "background-loop"

查看:77
本文介绍了“背景循环”的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,

我目前正在使用LogitechLCD-SDK进行编程,因为我的计划是在更大的应用程序中使用LogitechLCD。对于那些不知道的人:LogitechLCD基本上是一个带有几个按钮的小屏幕,它集成在一些键盘中。但是当我几乎完成了我的小测试项目时,有一个问题我无法自己解决。

我创建了一个检查四个状态的方法按钮并执行相关操作。 更大的应用程序在系统的后台运行,所以我不得不以某种方式调用CheckButton方法,而不会消耗明显的CPU功率。我怎么做?谷歌没有告诉我一种适合我情况的方式。

无论如何,感谢您的帮助!

Hey guys,
I'm currently programming around with the LogitechLCD-SDK, since my plan is to use the LogitechLCD in a bigger application. For those who don't know: The LogitechLCD is basically a little screen with a few buttons which is integrated in some keyboards. But as I'm almost finished with my little test-project, there is one problem I'm not able to solve on my own.
I've created a method which checks the state of the four buttons and performes the related actions. The "bigger application" runs in the background of the system, so I have to call the CheckButton-method pretty frequently somehow, without draining noticeable CPU-power. How do I do that? Google doesn't tell me a way which fits in my situation.
Thanks for your help anyway!

推荐答案

搜索CodeProject会产生一些后台进程示例。这是一个: BackgroundWorker线程和支持取消 [ ^ ]
Searching on CodeProject yields some examples of background processes. Here is one: BackgroundWorker Threads and Supporting Cancel[^]


这篇关于“背景循环”的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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