如何开始使用 Windows 7 小工具
我从未为 Vista 或 7 编写过小工具,但我想尝试制作一个。 但我该从哪里开始呢? 我尝试在 google 和 msdn 上搜索,但没有找到任何有用的东西。 要么是非常非常老的东西(Vista beta 的东西),已经制作的小工具,要么是 Vista 和 7 中小工具之间的差异。 但这对我没有帮助,因为我一开始就不知道如何制作一个小工具...我什至没有设法找出它们是用什么写的...
所以,有人可以帮忙吗我一开始就出局了吗?
- 我从哪说起呢?
- 我需要知道什么?
- 它们是用什么写的?
- 它们是如何“包装”的?
换句话说,如何从带有 Visual Studio 的 Windows 7 全新安装转为可以安装并放置在 Windows 7 桌面上的可用小工具。
I have never programmed a gadget for Vista or Seven, but I would like to try to make one. But where do I start? I have tried to search around on google and msdn, but I haven't managed to find anything useful. Either very, very old stuff (Vista beta stuff), already made gadgets or differences between gadgets in Vista and Seven. But that doesn't help me, since I don't have a clue how to make a gadget in the first place... I haven't even managed to find out what they are written in...
So, could anyone help me out with a kick start?
- Where do I start?
- What do I need to know?
- What are they written in?
- How are they "packaged"?
In other words, how do I get from a clean install of Windows 7 with Visual Studio to a working Gadget that I can install and put on my Windows 7 desktop.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
将所有当前答案组合并组织成一个答案,然后添加我自己的研究:
Microsoft 小工具开发:
它们是用什么编写的? Windows Vista/7 小工具混合使用 XML、HTML、CSS 和一些语言来开发IE 脚本语言。 还可以将 C# 与最新版本的 Script# 一起使用。
它们是如何打包/部署的?实际的小工具存储在 *.gadget 文件中,这些文件只是将上面列出的文本源文件压缩到单个 zip 文件中。
小工具开发的有用参考:
我从哪里开始? Windows Vista/7 小工具开发的良好介绍性参考:
如果您愿意使用离线资源,这本书似乎是一个很好的资源:
我需要知道什么? 一些其他有用的参考资料; 不一定是指导性的
更新:嗯,这已经被证明是一个流行的答案~分享我自己最近的Windows 7小工具开发经验:
开始Windows 7小工具开发的最简单方法可能是修改一个具有以下功能的小工具:已经开发出来了。我最近自己做了这个,因为我想要一个更大的时钟小工具。 由于找不到任何东西,我修改了标准 Windows 时钟小工具的副本,直到它大小增加了一倍。 我建议从时钟小工具开始,因为它相当小并且写得很好。 这是我使用的过程:
C:\Program Files\Windows Sidebar\Gadgets\Clock.Gadget\
Clock
这是将在“小工具库”窗口中显示的名称。%LOCALAPPDATA%\Microsoft\Windows Sidebar\
)Combining and organizing all the current answers into one answer, then adding my own research:
Brief summary of Microsoft gadget development:
What are they written in? Windows Vista/Seven gadgets are developed in a mix of XML, HTML, CSS, and some IE scripting language. It is also possible to use C# with the latest release of Script#.
How are they packaged/deployed? The actual gadgets are stored in *.gadget files, which are simply the text source files listed above compressed into a single zip file.
Useful references for gadget development:
where do I start? Good introductory references to Windows Vista/Seven gadget development:
If you are willing to use offline resources, this book appears to be an excellent resource:
What do I need to know? Some other useful references; not necessarily instructional
Update: Well, this has proven to be a popular answer~ Sharing my own recent experience with Windows 7 gadget development:
Perhaps the easiest way to get started with Windows 7 gadget development is to modify a gadget that has already been developed. I recently did this myself because I wanted a larger clock gadget. Unable to find any, I tinkered with a copy of the standard Windows clock gadget until it was twice as large. I recommend starting with the clock gadget because it is fairly small and well-written. Here is the process I used:
C:\Program Files\Windows Sidebar\Gadgets\Clock.Gadget\
<name>Clock</name>
This is the name that will be displayed in the "Gadgets Gallery" window.%LOCALAPPDATA%\Microsoft\Windows Sidebar\
)这是关于 Vista 小工具 的 MSDN 文章。 有关 7 个小工具和更改的一些初步文档。 我认为唯一的主要变化是小工具不再驻留在侧边栏中,因此“停靠/取消停靠事件”现在是向后兼容的杂物,确实不应该使用。
最好的开始方法可能就是调整现有的小工具。 上面的链接中有一个示例小工具,或者您可以自己选择一个不同的小工具。
小工具是用 HTML、CSS 和一些 IE 脚本语言(通常是 Javascript,但我相信 VBScript 也可以)编写的。 对于真正奇特的东西,您可能需要创建一个 ActiveX 对象,因此了解 COM 的 C#/C++ 可能会很有用。
小工具被打包为“.gadget”文件,这些文件只是重命名为 Zip 存档,在其顶层包含小工具清单 (gadget.xml)。
Here's an MSDN article on Vista Gadgets. Some preliminary documentation on 7 gadgets, and changes. I think the only major changes are that Gadgets don't reside in the Sidebar anymore, and as such "dock/undock events" are now backwards-compatibility cludges that really shouldn't be used.
Best way to get started is probably to just tweak an existing gadget. There's an example gadget in the above link, or you could pick a different one out on your own.
Gadgets are written in HTML, CSS, and some IE scripting language (generally Javascript, but I believe VBScript also works). For really fancy things you might need to create an ActiveX object, so C#/C++ for COM could be useful to know.
Gadgets are packaged as ".gadget" files, which are just renamed Zip archives that contain a gadget manifest (gadget.xml) in their top level.
这是 Scott Allen 撰写的一篇精彩文章:为 Windows 边栏开发小工具
此站点,Windows 7/Vista 侧边栏小工具,包含许多小工具资源的链接。
Here's an excellent article by Scott Allen: Developing Gadgets for the Windows Sidebar
This site, Windows 7/Vista Sidebar Gadgets, has links to many gadget resources.
我已经开始为每个人编写有关此主题的教程,请参阅制作小工具对于 Windows 7。
I have started writing one tutorial for everyone on this topic, see making gadgets for Windows 7.