简体   繁体   English

是否可以将Windows Sidebar Widgeds嵌入到自己的.Net应用程序中

[英]Is it possible to embed Windows Sidebar Widgeds in own .Net Application

I'm trying to embed Windows-Sidebar-Widgets into my own .Net Application (WPF and C#), but I dont't realy know where to start. 我试图将Windows侧边栏小部件嵌入到自己的.Net应用程序(WPF和C#)中,但我真的不知道从哪里开始。 I googled a bit but only found SDK and tutorials for widget-development. 我在Google上搜索了一下,但只找到了用于小部件开发的SDK和教程。 I found that there is a small service in Windows, running the widgets. 我发现Windows中有一个运行小部件的小型服务。 My thought was that I could perhaps fake this service and provide his functions whithin my programm, so that I can run and show the widgets. 我的想法是,我可能会伪造该服务,并在程序中提供他的功能,以便我可以运行和显示小部件。

Does anyone have some tips on how to do this? 有人对如何执行此操作有一些提示吗? Or some experience in doing so? 或这样做的经验? Perhaps there is even some kind of libary for that kind of stuff? 也许对于这类东西甚至有某种图书馆?

If this is not possible it is also an option to switch to an OpenSource widged-manager to use this widgeds, but this is only an emergency solution and the windows-gadgeds would be very appreciated. 如果无法做到这一点,也可以选择切换到一个开放源代码的widged-manager来使用此widged,但这只是一种紧急解决方案,windows-gadged非常感谢。

Some information about my system: 有关我的系统的一些信息:

I've written some kind of small windowmanager for childwindows in my application. 我在应用程序中为子窗口编写了某种小型的窗口管理器。 And on the top of this I want to show the widgets in some kind of HostWindow. 在此之上,我想在某种HostWindow中显示小部件。

Any hint will be appreciated. 任何提示将不胜感激。

PS: I would be willing to share the results if I (or we) get this working :-) PS:如果我(或我们)可以完成此工作,我将愿意分享结果:-)

I've never seen a library for hosting gadgets, but since they are basically just websites you could use the MSHTML component to host any arbitrary gadget in theory. 我从未见过用于托管小工具的库,但是由于它们基本上只是网站,因此从理论上讲,您可以使用MSHTML组件托管任何任意小工具。

This isn't to say it will be easy. 这并不是说这很容易。

You'll need to extract a gadget to some temporary directory, spin up something hosting MSHTML (in WinForms WebBrowser would be convenient), navigate to the appropriate file in that temp directory (discovered by parsing gadget.xml ), and shove something resembling the System object into the gadget. 您需要将小工具提取到某个临时目录,旋转托管MSHTML的内容(在WinForms WebBrowser中会很方便),导航到该temp目录中的适当文件(通过解析gadget.xml来发现),并进行类似于将系统对象放入小工具。

As a starting point, inject some script that sets System = window.external; 首先,注入一些设置System = window.external;脚本System = window.external; onload and WebBrowerser.ObjectForScripting = new FakeGadgetSystem() . onload和WebBrowerser.ObjectForScripting = new FakeGadgetSystem()

FakeGadgetSystem will need [ComVisible(true)] and to implement a decent amount of stuff. FakeGadgetSystem将需要[ComVisible(true)]并实现大量的内容。 I'd advise grabbing a widget or two to test with that mildly exercise the Gadget API, and then slowly implement the calls they make. 我建议抓住一个或两个小部件来进行测试,以轻度地练习Gadget API,然后慢慢实现它们进行的调用。 It'll be a long haul for 100% compatibility with the official gadget hosting service. 与官方小工具托管服务100%兼容将是一个漫长的过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以在Blazor网站中嵌入.NET应用程序? - Is it possible to embed a .NET application within a Blazor website? 是否可以在自己的应用程序中使用Windows 7任务计划程序 - Is it possible to use Windows 7 Task scheduler in own application 是否可以在ASP.net应用程序中嵌入试用限制? - Is it possible to embed trial limitations in ASP.net application? 如何在Windows窗体应用程序c#/。net中嵌入壁虎 - how to embed gecko in windows form application c#/.net 在.net应用程序中嵌入orientdb服务器 - embed orientdb server in .net application 是否有可能开发适用于Windows 7和Vista的Windows 8的.Net应用程序 - Is it possible to develop a .Net application for windows 8 that works also on windows 7 and Vista 如何在Visual Studio 2005的c#.net Web应用程序中嵌入Windows Media Player - How can I embed a windows media player in my c#.net web application in visual studio 2005 在.NET应用程序中嵌入Android模拟器 - Embed Android emulator in .NET application 在Windows Phone 8.1应用程序中添加边栏 - Add a sidebar in Windows Phone 8.1 application 是否可以在没有ASP.NET的情况下创建“用户帐户” Windows应用程序? - Is it possible to create a ‘user account’ windows application without ASP.NET?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM