How to write a Windows 7 gadget in C #?

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

Is it possible?

+4
source share
3 answers

Are there any sidebar gadgets that you are looking for?

Ask to see this Silverlight trick!

+1
source

Assuming the "Windows Sidebar gadgets" are being discussed, this cannot be done directly. However, there are some problems (none of which are supported by Microsoft):

  • Use Silverlight . However, as I recall, the background cannot be “painted into transparency”, and this will not work with 64-bit IE (IE does not always work with gadgets by 32-bit by default), since there is no 64-bit Silverlight. This The same issue faced by sidebar gadgets that use Flash. (Like Pandora, you can require amateur users to run the 32-bit version of sidebar.exe).

  • Wrap the gadget window. I started work on a project that allowed WPF (in a separate process) to "overlay" the gadget window - it was launched through COM. Avoids 32/64-bit problems (in fact, it does not matter, since in a separate process it is CLR, not Silverlight). Some problems with the default gadgets, sizes, properties, etc. Only the concept of work.

  • Use the built-in HTA to start 32-bit IE and grab this handle (then it can use / insert Silverlight if the 32-bit version starts). I was not successful with this, but it "should work."

  • Use a converter, for example Script # - write in C #, "compile" in JavaScript.

Happy coding.

+1
source

Source: https://habr.com/ru/post/1346175/


All Articles