navhaxs / media-control-deskband

Proof that IDeskBand2 is possible with C# (:
42 stars 7 forks source link

C# IDeskBand2 Sample - a Media control Deskband for Windows 7+

Screenshot

Original source from Pavel Zolnikov's article "Extending Explorer with Band Objects using .NET and Windows Forms", from way back in 2002. See for instructions.

I then adapted it to the IDeskBand2 interface.

For this example project, I added some rudimentary media control buttons to the deskband. For this I used SendInput() from InputSimulator.

This VS project builds with .NET 4.6.1 on Windows 10 x64.

Clearly most of this project lends itself to Win32 and C++ rather than C#, but this will do for now. Did not achieve native theming (such as button hover styles consistent to msstyles), which may or may not be even possible on Windows 10.

Get started

  1. Open SampleDeskband.sln in Visual Studio

  2. Build BandObjectLib. SampleControl is a dependency and will also get built.

  3. Follow the installation steps below

Installation

Follow these commands to install the deskband dll into the GAC - required for .NET assemblies to be loaded as a deskband. This includes any dependency assemblies as well (to my knowledge).

Note: The dll must be (re)installed into the GAC each and every time the dll is modified.

Start an elevated command prompt, then run env.bat which has some aliases set up (you likely will need to edit this file to match exact version numbers on your system)

(If you built in release mode) cd .\SampleDeskband\bin\Release\

(Or, if you built in debug mode) cd .\SampleDeskband\bin\Debug\

gacutil.exe /if SampleDeskband.dll

gacutil.exe /if BandObjectLib.dll

gacutil.exe /if WindowsInput.dll

Next, register our main deskband assembly,

regasm.exe SampleDeskband.dll

Lastly, restart explorer

k

explorer.exe

Notes

Also see