如何用 C# 编写 Windows 7 小工具?
如何在 Windows 7 中使用 C# 编写小工具?
是否可以?
How can I use C# to write a gadget in Windows 7?
Is it possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何在 Windows 7 中使用 C# 编写小工具?
是否可以?
How can I use C# to write a gadget in Windows 7?
Is it possible?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
http://www.codeproject.com/KB/gadgets/CPRepWindowsGadget.aspx
在 codeproject 上搜索会显示更多信息:http://www.codeproject。 com/search.aspx?q=gadget&sbo=kw
http://www.codeproject.com/KB/gadgets/CPRepWindowsGadget.aspx
And a search on codeproject shows even more: http://www.codeproject.com/search.aspx?q=gadget&sbo=kw
侧边栏小工具是您正在寻找的吗?
看看这个 Silverlight 技巧!
Is Sidebar gadgets what you are looking for?
Have a look at this Silverlight trick!
假设正在谈论“Windows Sidebar Gadgets”,这是不可能直接做到的。但是,有一些解决方案(Microsoft 均不支持):
使用 Silverlight。然而,据我记得,背景不能“绘制透明”,这对于 64 位 IE 来说不起作用(默认情况下,运行小工具的 IE 并不总是 32 位),如下所示没有 64 位 Silverlight。这与困扰使用 Flash 的侧边栏小工具的问题相同。 (与 Pandora 一样,可能需要狂热的用户启动 32 位版本的 sidebar.exe)。
包裹小工具窗口。我开始研究这样的项目,该项目允许 WPF(在单独的进程中)“覆盖”小工具窗口 - 通过 COM 启动。避免 32/64 位问题(实际上,这并不重要,因为它位于单独的进程中,并且是 CLR,而不是 Silverlight)。默认小工具边框、大小、属性等存在一些问题。仅适用于概念。
使用嵌入式HTA启动32 位 IE 并获取该句柄(如果启动了 32 位版本,则可以使用/嵌入 Silverlight)。我没有成功,但它“应该可以工作”。
使用像 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):
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).
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.
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".
Use a converter like Script# -- write in C#, "compile" to JavaScript.
Happy coding.