Docklets in .NET / C#?

Any interest?

Thursday, January 31, 2008 by JMB1984 | Discussion: Docks

Hey everybody,

Poke your developer friends, I'm interested in hearing if anyone would be interested in writing docklets in .NET languages such as C#. Considering adding the ability to do so. Would allow for simple operation such as overloading the Paint method to do drawing, and performcing drawing via just drawing to the provided graphics object just like it were a regular window, etc etc etc. This as well as assistance in creating/drawing-to/animating alpha-blended windows for creating flyouts and whatnot. Not to mention all the benefits that the .NET libraries offer for making things quickly and easily. Would require .NET 2.0. If someone made me up a particularly sweet sample we'd consider doing 3.0 as well ha.

Thoughts?

-Jeff Bargmann
ObjectDock Lead Developer

ZubaZ
Reply #1 Thursday, January 31, 2008 11:38 PM
ZubaZ has no idea what he said . . .

He seems to like it though . . so I support it.  

Now  . . about that icon organizer app . . . 
Littleboy
Reply #2 Friday, February 1, 2008 5:45 AM
Littleboy already did it ages ago

.Net SDK and .Net Runtime.

It was compiled with .NET 1.1 and I haven't had the time (and courage...) to update it since. Back then I didn't know better and it's loading the .Net runtime in the ObjectDock process (gasp! - see info here). And some part of it is quite lame (especially the register & path handling parts).

It also requires admin rights to register the runtime and docklets, so I don't think it's working with a limited account (be it on XP or Vista).

The .Net part should be salvageable though. It's mainly an interface and some interop code (and code to deal with calls to ObjectDock, particularly for the context menu and conversion between managed/unmanaged Bitmaps).

I still have the code so let me know if you want to look at it (#stardock, msg "Julien").
fauxquixote
Reply #3 Monday, February 11, 2008 9:55 PM
I'm for it! I've got 2.0! Now how do I write one?
fauxquixote
Reply #4 Tuesday, February 12, 2008 12:00 AM
I'd love the code. I'll update it
qrush
Reply #5 Tuesday, February 12, 2008 1:07 AM
Sign me up! A bit of documentation on the WC Wiki and I'm sure me and many others will be set
jamespaulp
Reply #6 Tuesday, February 12, 2008 1:28 AM
I am good in C#, but I am not familiar with docklets   
Littleboy
Reply #7 Tuesday, February 12, 2008 6:15 AM
Ah well, time to update it I guess

The part that really needs some love is C++ side. There is a lot of crappy code there that I need to rewrite. The C# part is just an interface and some helper functions, so it can be kept mostly unchanged.

Update: Stupid RegistrationServices.RegisterAssembly wants to write to HKCR instead of HKCU//Software//Classes. I redirected it using RegOverridePredefKey but there may be a less convoluted way to do it.

Here is a test build.

Tested only with the 3 sample docklets. I included the old chm help file. It's up to date as I didn't change anything in NetDockletHelper, but most of the things in ObjectDockSDK.Utils are probably going to go away very soon.

Unzip to "ObjectDock/Docklets/DotNetDocklets" or better yet on Vista, open an elevated command prompt in "ObjectDock/Docklets" and use "mklink /D DotNetDocklets [Path to the unzipped folder]"

Enjoy!
Henners_666
Reply #8 Friday, February 15, 2008 10:57 AM
Hi Littleboy,

I am currently writing a docklet in C++, however I was interested in looking at using C# and your component would be ideal for that. However I downloaded the files from the link you gave but when I run the "Docklet Chooser dialog" it states for every sample docklet that "This docklet is not a valid .Net Docklet".

Maybe I'm going blind but I couldn't see anything obvious that I'd missed - is this a bug?

Regards.
Littleboy
Reply #9 Saturday, February 16, 2008 5:37 AM
It's probably a bug and since there is no logging and no check for the installed .Net Framework version, it's hard to know why it's not working.

A couple of things to check:
- it needs to be in "Docklets/DotNetDocklets" as the path is hardcoded
- make sure you have the latest version of the .Net Framework 2.0 (SP1)

I'm in the process of cleaning the code a bit (removing the really idiotic parts so as not to look too bad ) and I'll make it available here soon.
Henners_666
Reply #10 Saturday, February 16, 2008 6:24 AM
Thanks for the quick reply littleboy

Checked the path and it was actually Docklet/DotNetDocklets2, however renaming it to the suggestion has no effect (incidentally it does detect all 3 docklets).

My version of the .Net Framework is correct (Version 2.0.50727 SP1)

Ah, that's excellent if you are releasing the code perhaps I should wait till the code is available and debug it to see what's going on. I briefly looked into doing an interop utility and then I realised what a nightmare it would be marshalling all the data. It would certainly be interesting to see how you've done it What would the licensing terms be for using/editing your code?

Cheers
Littleboy
Reply #11 Saturday, February 16, 2008 11:01 AM
My bad, it was some leftover test code that I forgot to comment!

I've updated the download with a new version. Remove the previous version before unzipping this one. Additionally, there is a "CleanupRegistration.reg" registry file in the package that you might want to merge, as I renamed the NetDockletHelper dll.

The marshalling code is not that big, maybe 100-200 lines in managed code, a little bit more in native code. The .Net runtime is doing most of the job for us, the only thing we have to do by hand is the conversion from a System.Drawing.Image to a Bitmap to set the docklet image & overlay. The hard part back in 2004 was to learn how COM worked

The code is going to be released under a BSD license.
jsimmons3
Reply #12 Sunday, May 11, 2008 9:18 AM
What's the status on this? I'd like to write a docklet or two with .Net 3.5.

Smaky
Reply #13 Friday, August 1, 2008 7:05 PM
Any info on the release date?
neener
Reply #14 Friday, August 29, 2008 9:56 PM
I'd love to see a .net sdk for object dock. I'm sure there are a lot more C# developers out there compared to C++ developers these days. But then again, I'm a C# developer myself and I'd just love to have a chance to play with making some docklets.

By the way, I tried to get Littleboy's sdk going for the last hour or two with no luck yet. Is there a version incompatibility with his sdk and the newest objectdock? I put the docklets in the docklets folder, restarted object dock, but they don't show up in the add docklet menu.
Littleboy
Reply #15 Saturday, August 30, 2008 12:16 AM
neener, are you using the version from Wincustomize or the one from here?

You have to use the last one, it's updated to work with Vista and .Net 2.0
neener
Reply #16 Monday, September 15, 2008 3:17 PM

I don't think I tried that one. Is there some other voodoo you have to do after you build it and put it in the docklets folder? Some sort of guid or strong name.. anything like that? I tried dropping the dummy docklet folder into the objectdock docklets folder and I don't see an option to add a dummy docklet.

Littleboy
Reply #17 Monday, September 15, 2008 4:30 PM

You need to put your docklets in a subfolder of the DotNetDocklet folder. It doesn't check the standard docklets folder at this time.

As for the guid, if you want to create your own .net docklets, you will need to generate new ones. But if you only want to run existing ones or test the samples, you don't need to do anything.

barellano
Reply #18 Thursday, April 16, 2009 10:48 AM

I would like to write docklets, however I am a newbie scripter and need some direction on where to start. What utilities and tools are available to assist writing docklets?

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01