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...
我从未为Vista或Seven编写过小工具,但我想尝试制作一个。但是我从哪里开始呢?我试图在谷歌和msdn上搜索,但我没有找到任何有用的东西。无论是非常非常古老的东西(Vista测试版的东西),已经制作了小工具或Vista和Seven中的小工具之间的差异。但这对我没有帮助,因为我不知道如何制作一个小工具......我甚至没有设法找出他们写的是什么......
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.
换句话说,如何从使用Visual Studio的Windows 7的干净安装到我可以安装并放在Windows 7桌面上的工作小工具。
4 个解决方案
#1
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.
这是关于Vista Gadgets的MSDN文章。关于7个小工具和更改的一些初步文档。我认为唯一的主要变化是小工具不再存在于补充工具栏中,因此“停靠/取消停靠事件”现在是向后兼容的问题,实际上不应该使用。
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.
小工具是用HTML,CSS和一些IE脚本语言编写的(通常是Javascript,但我相信VBScript也有效)。对于您可能需要创建ActiveX对象的真正奇特的东西,因此用于COM的C#/ C ++可能很有用。
Gadgets are packaged as ".gadget" files, which are just renamed Zip archives that contain a gadget manifest (gadget.xml) in their top level.
小工具打包为“.gadget”文件,这些文件刚刚重命名为Zip档案,其顶层包含小工具清单(gadget.xml)。
#2
Combining and organizing all the current answers into one answer, then adding my own research:
将所有当前答案组合并组织成一个答案,然后添加我自己的研究:
Brief summary of Microsoft gadget development:
Microsoft小工具开发简介:
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#.
他们写的是什么? Windows Vista / Seven小工具是以XML,HTML,CSS和一些IE脚本语言混合开发的。也可以将C#与最新版本的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.
它们是如何打包/部署的?实际的小工具存储在* .gadget文件中,这些文件只是将上面列出的文本源文件压缩成单个zip文件。
Useful references for gadget development:
小工具开发的有用参考:
where do I start? Good introductory references to Windows Vista/Seven gadget development:
我从哪里开始?对Windows Vista / Seven小工具开发的良好介绍性参考:
- Developing Gadgets for the Windows Sidebar
- Vista Gadgets Introductory tutorial from I-Programmer
- Authoring Sidebar Gadgets in C#
- Developing a Gadget for Windows Sidebar Part 1: The Basics Official MSDN tutorial.
开发Windows边栏的小工具
来自I-Programmer的Vista Gadgets入门教程
在C#中创建边栏小工具
为Windows边栏开发小工具第1部分:基础知识官方MSDN教程。
If you are willing to use offline resources, this book appears to be an excellent resource:
如果您愿意使用离线资源,这本书似乎是一个很好的资源:
- Creating Vista Gadgets: Using HTML, CSS and JavaScript with Examples in RSS, Ajax, ActiveX (COM) and Silverlight
- blog related to book: http://www.innovatewithgadgets.com/
创建Vista小工具:在RSS,Ajax,ActiveX(COM)和Silverlight中使用HTML,CSS和JavaScript
与书有关的博客:http://www.innovatewithgadgets.com/
What do I need to know? Some other useful references; not necessarily instructional
我需要知道什么?一些其他有用的参考;不一定是教学
- Windows Sidebar (Official MSDN documentation)
- related Stack Overflow question: C# tutorial to write gadgets
Windows边栏(官方MSDN文档)
相关的Stack Overflow问题:编写小工具的C#教程
Update: Well, this has proven to be a popular answer~ Sharing my own recent experience with Windows 7 gadget development:
更新:嗯,这已被证明是一个受欢迎的答案〜分享我自己最近使用Windows 7小工具开发的经验:
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:
开始使用Windows 7小工具开发的最简单方法可能是修改已经开发的小工具。我最近自己做了这个,因为我想要一个更大的时钟小工具。无法找到任何内容,我修改了标准Windows时钟小工具的副本,直到它的两倍大。我建议从时钟小工具开始,因为它相当小并且写得很好。这是我使用的过程:
- Locate the gadget you wish to modify. They are located in several different places. Search for folders named *.gadget. Example:
C:\Program Files\Windows Sidebar\Gadgets\Clock.Gadget\
- Make a copy of this folder (installed gadgets are not wrapped in zip files.)
- Rename some key parts:
- The folder name
- The name inside the gadget.xml file. It looks like:
<name>Clock</name>
This is the name that will be displayed in the "Gadgets Gallery" window.
文件夹名称
gadget.xml文件中的名称。它看起来像:
Clock 这是将在“Gadgets Gallery”窗口中显示的名称。 - Zip up the entire *.gadget directory.
- Change the file extension from "zip" to "gadget" (Probably just need to remove the ".zip" extension.)
- Install your new copy of the gadget by double clicking the new *.gadget file. You can now add your gadget like any other gadget (right click desktop->Gadgets)
- Locate where this gadget is installed (probably to
%LOCALAPPDATA%\Microsoft\Windows Sidebar\
) - Modify the files in this directory. The gadget is very similar to a web page: HTML, CSS, JS, and image files. The gadget.xml file specifies which file is opened as the "index" page for the gadget.
- After you save the changes, view the results by installing a new instance of the gadget. You can also debug the JavaScript (The rest of that article is pretty informative, too).
找到您要修改的小工具。它们分布在几个不同的地方。搜索名为* .gadget的文件夹。示例:C:\ Program Files \ Windows Sidebar \ Gadgets \ Clock.Gadget \
制作此文件夹的副本(已安装的小工具不包含在zip文件中。)
重命名一些关键部分:文件夹名称gadget.xml文件中的名称。它看起来像:
压缩整个* .gadget目录。
将文件扩展名从“zip”更改为“gadget”(可能只需要删除“.zip”扩展名。)
双击新的* .gadget文件,安装小工具的新副本。您现在可以像任何其他小工具一样添加小工具(右键单击桌面 - >小工具)
找到此小工具的安装位置(可能是%LOCALAPPDATA%\ Microsoft \ Windows Sidebar \)
修改此目录中的文件。小工具与网页非常相似:HTML,CSS,JS和图像文件。 gadget.xml文件指定将哪个文件作为小工具的“索引”页面打开。
保存更改后,通过安装小工具的新实例来查看结果。您也可以调试JavaScript(该文章的其余部分也非常有用)。
#3
Here's an excellent article by Scott Allen: Developing Gadgets for the Windows Sidebar
这是Scott Allen撰写的一篇优秀文章:为Windows边栏开发小工具
This site, Windows 7/Vista Sidebar Gadgets, has links to many gadget resources.
此站点是Windows 7 / Vista边栏小工具,它包含许多小工具资源的链接。
#4
I have started writing one tutorial for everyone on this topic, see making gadgets for Windows 7.
我已经开始为这个主题为每个人编写一个教程,请参阅为Windows 7制作小工具。
#1
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.
这是关于Vista Gadgets的MSDN文章。关于7个小工具和更改的一些初步文档。我认为唯一的主要变化是小工具不再存在于补充工具栏中,因此“停靠/取消停靠事件”现在是向后兼容的问题,实际上不应该使用。
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.
小工具是用HTML,CSS和一些IE脚本语言编写的(通常是Javascript,但我相信VBScript也有效)。对于您可能需要创建ActiveX对象的真正奇特的东西,因此用于COM的C#/ C ++可能很有用。
Gadgets are packaged as ".gadget" files, which are just renamed Zip archives that contain a gadget manifest (gadget.xml) in their top level.
小工具打包为“.gadget”文件,这些文件刚刚重命名为Zip档案,其顶层包含小工具清单(gadget.xml)。
#2
Combining and organizing all the current answers into one answer, then adding my own research:
将所有当前答案组合并组织成一个答案,然后添加我自己的研究:
Brief summary of Microsoft gadget development:
Microsoft小工具开发简介:
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#.
他们写的是什么? Windows Vista / Seven小工具是以XML,HTML,CSS和一些IE脚本语言混合开发的。也可以将C#与最新版本的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.
它们是如何打包/部署的?实际的小工具存储在* .gadget文件中,这些文件只是将上面列出的文本源文件压缩成单个zip文件。
Useful references for gadget development:
小工具开发的有用参考:
where do I start? Good introductory references to Windows Vista/Seven gadget development:
我从哪里开始?对Windows Vista / Seven小工具开发的良好介绍性参考:
- Developing Gadgets for the Windows Sidebar
- Vista Gadgets Introductory tutorial from I-Programmer
- Authoring Sidebar Gadgets in C#
- Developing a Gadget for Windows Sidebar Part 1: The Basics Official MSDN tutorial.
开发Windows边栏的小工具
来自I-Programmer的Vista Gadgets入门教程
在C#中创建边栏小工具
为Windows边栏开发小工具第1部分:基础知识官方MSDN教程。
If you are willing to use offline resources, this book appears to be an excellent resource:
如果您愿意使用离线资源,这本书似乎是一个很好的资源:
- Creating Vista Gadgets: Using HTML, CSS and JavaScript with Examples in RSS, Ajax, ActiveX (COM) and Silverlight
- blog related to book: http://www.innovatewithgadgets.com/
创建Vista小工具:在RSS,Ajax,ActiveX(COM)和Silverlight中使用HTML,CSS和JavaScript
与书有关的博客:http://www.innovatewithgadgets.com/
What do I need to know? Some other useful references; not necessarily instructional
我需要知道什么?一些其他有用的参考;不一定是教学
- Windows Sidebar (Official MSDN documentation)
- related Stack Overflow question: C# tutorial to write gadgets
Windows边栏(官方MSDN文档)
相关的Stack Overflow问题:编写小工具的C#教程
Update: Well, this has proven to be a popular answer~ Sharing my own recent experience with Windows 7 gadget development:
更新:嗯,这已被证明是一个受欢迎的答案〜分享我自己最近使用Windows 7小工具开发的经验:
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:
开始使用Windows 7小工具开发的最简单方法可能是修改已经开发的小工具。我最近自己做了这个,因为我想要一个更大的时钟小工具。无法找到任何内容,我修改了标准Windows时钟小工具的副本,直到它的两倍大。我建议从时钟小工具开始,因为它相当小并且写得很好。这是我使用的过程:
- Locate the gadget you wish to modify. They are located in several different places. Search for folders named *.gadget. Example:
C:\Program Files\Windows Sidebar\Gadgets\Clock.Gadget\
- Make a copy of this folder (installed gadgets are not wrapped in zip files.)
- Rename some key parts:
- The folder name
- The name inside the gadget.xml file. It looks like:
<name>Clock</name>
This is the name that will be displayed in the "Gadgets Gallery" window.
文件夹名称
gadget.xml文件中的名称。它看起来像:
Clock 这是将在“Gadgets Gallery”窗口中显示的名称。 - Zip up the entire *.gadget directory.
- Change the file extension from "zip" to "gadget" (Probably just need to remove the ".zip" extension.)
- Install your new copy of the gadget by double clicking the new *.gadget file. You can now add your gadget like any other gadget (right click desktop->Gadgets)
- Locate where this gadget is installed (probably to
%LOCALAPPDATA%\Microsoft\Windows Sidebar\
) - Modify the files in this directory. The gadget is very similar to a web page: HTML, CSS, JS, and image files. The gadget.xml file specifies which file is opened as the "index" page for the gadget.
- After you save the changes, view the results by installing a new instance of the gadget. You can also debug the JavaScript (The rest of that article is pretty informative, too).
找到您要修改的小工具。它们分布在几个不同的地方。搜索名为* .gadget的文件夹。示例:C:\ Program Files \ Windows Sidebar \ Gadgets \ Clock.Gadget \
制作此文件夹的副本(已安装的小工具不包含在zip文件中。)
重命名一些关键部分:文件夹名称gadget.xml文件中的名称。它看起来像:
压缩整个* .gadget目录。
将文件扩展名从“zip”更改为“gadget”(可能只需要删除“.zip”扩展名。)
双击新的* .gadget文件,安装小工具的新副本。您现在可以像任何其他小工具一样添加小工具(右键单击桌面 - >小工具)
找到此小工具的安装位置(可能是%LOCALAPPDATA%\ Microsoft \ Windows Sidebar \)
修改此目录中的文件。小工具与网页非常相似:HTML,CSS,JS和图像文件。 gadget.xml文件指定将哪个文件作为小工具的“索引”页面打开。
保存更改后,通过安装小工具的新实例来查看结果。您也可以调试JavaScript(该文章的其余部分也非常有用)。
#3
Here's an excellent article by Scott Allen: Developing Gadgets for the Windows Sidebar
这是Scott Allen撰写的一篇优秀文章:为Windows边栏开发小工具
This site, Windows 7/Vista Sidebar Gadgets, has links to many gadget resources.
此站点是Windows 7 / Vista边栏小工具,它包含许多小工具资源的链接。
#4
I have started writing one tutorial for everyone on this topic, see making gadgets for Windows 7.
我已经开始为这个主题为每个人编写一个教程,请参阅为Windows 7制作小工具。