Docklets in .NET / C#?

Any interest?

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

17,574 views 18 replies
Reply #1 Top
/me has no idea what he said . . .

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

Now  . . about that icon organizer app . . .  ;)
Reply #2 Top
/me already did it ages ago :D

.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").
Reply #5 Top
Sign me up! A bit of documentation on the WC Wiki and I'm sure me and many others will be set :)
Reply #6 Top
I am good in C#, but I am not familiar with docklets  :SNIFF!: 
Reply #7 Top
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!
Reply #8 Top
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.
Reply #9 Top
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 :p) and I'll make it available here soon.
Reply #10 Top
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
Reply #11 Top
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 :D

The code is going to be released under a BSD license.
Reply #13 Top
Any info on the release date?
Reply #14 Top
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.
Reply #15 Top
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
+1 Loading…
Reply #16 Top

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.

Reply #17 Top

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.

Reply #18 Top

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?