是否有可能知道Windows小部件是否被其他窗口完全覆盖?
我们想要创建 天气小部件 的 Windows 桌面版本。
该小部件有 2 个特殊之处。
- 它消耗大量处理器时间 当活动时 - 它显示 动画图片(不幸的是,Flash 没有 GPU 加速)。
- 它会更新我们的天气 服务器(来自所有小部件用户的频繁服务器请求)。
当用户不看小部件时,不需要加载动画和天气。
所以我有一个想法,当我的小部件不可见并且不使用时将其置于睡眠状态。
是否可以检测该小部件是否被使用。 准确地说,我需要知道该小部件是否被其他窗口覆盖?
我最感兴趣的是 Vista/7 小工具引擎,但是我也想知道这些小工具引擎是否解决了这个问题
- 雅虎小工具
- Google 桌面
希望在这里找到一些桌面小工具专家。
帕夏
We want to create a Windows desktop version of our weather widget
There are 2 special things about the widget.
- It consumes a lot of processor time
while active - it displays an
animated picture (Flash without GPU acceleration, unfortunately). - It updates the weather from our
server (frequent server requests from all widget users).
When the user does not look at the widget there is no need for animation and weather loading.
So I have an idea of putting my widget to sleep when it is not visible and hense not used.
Is it possible to detect whether the widget is used or not.
Speaking precisely I need to know whether the widget is covered by other windows?
I mostly interested in Vista/7 gadgets engine, however I also would like to know if this problem is solved in these widget engines
- Yahoo widgets
- Google desktop
Hope to find some desktop widget guru here.
Pasha
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您InvalidateRect并且没有得到随后的
WM_PAINT
消息,则您的窗口将被隐藏。您可以在InvalidateRect
之后调用UpdateWindow
来强制立即发生(或不发生)WM_PAINT
消息。时,您可以执行类似
InvalidateRect
当您停止获取 WM_PAINT 消息时,您将停止重新设置计时器,因此您将停止向服务器请求更新。当WM_PAINT消息发生时(因为你不再被覆盖)。您再次开始请求数据。
If you InvalidateRect and don't get a subsequent
WM_PAINT
message, than your window is hidden. You can callUpdateWindow
afterInvalidateRect
to force theWM_PAINT
message to happen (or not happen) right away.So you could do something like this
InvalidateRect
When you stop getting WM_PAINT messages, you stop re-setting your timer, and you therefor stop requesting updates from the server. When the WM_PAINT message happens (because you are no longer covered). You start requesting data again.