如何用 C# 编写 Windows 7 小工具?

发布于 2024-10-28 03:00:16 字数 48 浏览 9 评论 0原文

如何在 Windows 7 中使用 C# 编写小工具?

是否可以?

How can I use C# to write a gadget in Windows 7?

Is it possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一百个冬季 2024-11-04 03:00:16

侧边栏小工具是您正在寻找的吗?

看看这个 Silverlight 技巧!

Is Sidebar gadgets what you are looking for?

Have a look at this Silverlight trick!

淡淡の花香 2024-11-04 03:00:16

假设正在谈论“Windows Sidebar Gadgets”,这是不可能直接做到的。但是,有一些解决方案(Microsoft 均不支持):

  1. 使用 Silverlight。然而,据我记得,背景不能“绘制透明”,这对于 64 位 IE 来说不起作用(默认情况下,运行小工具的 IE 并不总是 32 位),如下所示没有 64 位 Silverlight。这与困扰使用 Flash 的侧边栏小工具的问题相同。 (与 Pandora 一样,可能需要狂热的用户启动 32 位版本的 sidebar.exe)。

  2. 包裹小工具窗口。我开始研究这样的项目,该项目允许 WPF(在单独的进程中)“覆盖”小工具窗口 - 通过 COM 启动。避免 32/64 位问题(实际上,这并不重要,因为它位于单独的进程中,并且是 CLR,而不是 Silverlight)。默认小工具边框、大小、属性等存在一些问题。仅适用于概念。

  3. 使用嵌入式HTA启动32 位 IE 并获取该句柄(如果启动了 32 位版本,则可以使用/嵌入 Silverlight)。我没有成功,但它“应该可以工作”。

  4. 使用像 Script# 这样的转换器—​​—用 C# 编写,“编译”为 JavaScript。< /p>

快乐编码。

Assuming that "Windows Sidebar Gadgets" are being talked about, this is not possible to do directly. However there are some work-abouts (none of which are supported by Microsoft):

  1. Use Silverlight. However, as I recall, the background can't be "painted transparent" and this will not work with a 64-bit IE (the IE running gadgets isn't always 32-bit by default) as there is no 64-bit Silverlight. This is the same problem plaguing sidebar gadgets that use Flash. (Like Pandora, one could require avid users to launch the 32-bit version of sidebar.exe).

  2. Wrap the gadget window. I started work on a project like this that allowed WPF (in a separate process) to "overlay" the gadget window -- started via COM. Avoids 32/64-bit issues (actually, doesn't matter since it's in a separate process and is CLR, not Silverlight). Some issues with default gadget border, sizing, properties, etc. Concept work only.

  3. Use an embedded HTA to launch a 32-bit IE and grab that handle (can then use/embedd Silverlight if launched the 32-bit version). I didn't have success with this, but it "should work".

  4. Use a converter like Script# -- write in C#, "compile" to JavaScript.

Happy coding.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文