dsafa / csdeskband Goto Github PK
View Code? Open in Web Editor NEWWindows deskband with C#
License: MIT License
Windows deskband with C#
License: MIT License
For example, I'm using some timers, connections, etc. to periodically gather information to show on the deskband. But this process is necessary only if the deskband is shown. It the user hides the deskband I don't need to run these information gathering. If the user enable the deskband again then I need to start that information gathering again.
So is there any events that I can use to determine if the status of the deskband has changed?
WinForms
The documentation could use a lot more work. Stuff like
As it is nearing v1, it would be good to add more documentation on usage of the available features
I've used the Sample.Win and Sample.Wpf project to test if it works. Installation went fine, but I cannot select it. Also tried it with a new GUID and Name.
Using Visual Studio 2017 and Windows 10 Version 1803 64-bit, tested with both Pro and Enterprise. Also tested with "Any CPU", "x86" and "x64" (last one gives an error that it is not a valid .NET executable).
Bat-file:
@setlocal enableextensions
@cd /d "%~dp0"
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe /tlb /codebase Sample.Win.dll
pause
Result:
Microsoft .NET Framework Assembly Registration Utility version 4.7.3056.0
for Microsoft .NET Framework version 4.7.3056.0
Copyright (C) Microsoft Corporation. All rights reserved.
Succesfully registered deskband `Sample Winforms Deskband` - GUID: {5731fc61-8530-404c-86c1-86ccb8738d06}
Request to show deskband.
Types registered successfully
What can I do? Can we debug or test this, or are there any known issues?
Other deskbands like from Networx works fine.
It may be useful
Win 11 Taskbar dotn't have Toolbar option,
So I can't control the display and hiding.
I think I will use WINFORM application to control the display and hiding of DESKBAND. How to call it, thank you.
I am trying to use a Window
instead of a simple UserControl
so I can take advantage of its Activated
and Deactivated
events. However the deskband does not show.
Steps to reproduce:
Window1
protected override UIElement UIElement => new Window1();
Alternatively, is there any other way to detect if the deskband (including all of its child windows) get deactivated?
I registered deskband, but it need click taskbar toolbars to activate, how to activate it automatically?
It should actually be integers max height when horizontal and max width when vertical instead of a Size
struct
I received a bug report on a project of mine where I'm using CSDeskBand. It looks like right to left languages like Hebrew cause the deskband scaling to behave incorrectly. I tested it on my project and Audio Band as you can see in the video. Both of them use CSDeskBand.
Edit: Only WPF is affected by this.
Hi
I finished programming the toolbar tools itself and now I made my first stop onto getting the tools in the taskbar.
But unfortunately the new toolbar is not visible (or available in the toolbars selection menru).
Neither my new one nor the sample toolbar :-(
Any clever advices?
my control is an UserControl
the following is my "bandcontrol" the handle the band visibility for the UserControl
`
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using CSDeskBand;
namespace acsMetersControl {
[ComVisible( true )]
[Guid( "BE39FC0E-C019-49D0-BEE2-384747456526" )]
[CSDeskBandRegistration( Name = "acsMetersDeskBand", ShowDeskBand = true )]
public class acsDeskBandControl : CSDeskBandWin {
private static Control ctrl;
protected override Control Control => ctrl; // Returns your main control
public acsDeskBandControl() {
Options.MinHorizontalSize = new Size( 100, 30 );
ctrl = new acsMeterControl();
ctrl.SizeChanged += Control_SizeChanged;
}
private void Control_SizeChanged( object sender, EventArgs e ) {
Options.HorizontalSize = new DeskBandSize( Control.Width, Options.VerticalSize.Height );
}
}
}
`
registering seems ok
RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase can cause your assembly to interfere with other applications that may be installed on the same computer. The /codebase switch is intended to be used only with signed assemblies. Please give your assembly a strong name and re-register it. Succesfully registered deskband
acsMetersDeskBand- GUID: {be39fc0e-c019-49d0-bee2-384747456526} Request to show deskband. Types registered successfully
2021-01-22 : Just tried a release version and a strong signed version. Both seem to be registered, but none of them appears in the taskbar :(
I was wondering if .NET 5 Support was on the horizon or if there's something that would block updating this library & it's dependencies?
While testing a deskband on a 32bit VM I noticed explorer.exe hangs/freezes with 100% cpu usage after a few seconds of enabling the deskband. The problem occurs with the basic sample project attached here: WpfSampleProject_32bit_freeze.zip
I might look into this further in the future but wanted to report it here for now.
Do some investigation on maybe using a dummy deskband and keeping a Wpf window on top of it. Then we can still use all the deskband features but not have to use an ElementHost
to host the Wpf control.
I have an application which is inserted to the toolbar and it works fine.
But I have notice that when I try to build again the code, it says that the process is used by other process. After investigation I see that Explorer.exe is still running my code even when I unmarked my toolbar, so I need to shutdown explorer.exe in order to free my resources.
My question is ; how to stop explorer to use my code properly ?
Maybe merge win and wpf into csdeskband to reduce the amount of assemblies
Please update nuget version, spent couple of hours trying to understand why the examples aren't working.
指定的元素已经是另一个元素的逻辑子元素
Not sure if this can be done or not but something to look into.
all examples I saw were WPF. Did anyone use this in a WinForms project?
#56 is my open issue for WinForms
If someone has a running example for WinForms would be very helpful.
Even the demo WinForms project is not working...
Hi, great work!
I have some issues I would like to discuss with you.
EDIT:
I see that is not really hidden but shrink, so I need to extend it by the mouse. Its default size is really tiny?
Do you know if there is any automatic (script) way to mark the toolbar? maybe in registry?
The actions is not working when I click at the toolbar.
Sometimes, when I run the process, the explorer.exe locks my process so I can't run it again.
Hey,
I really like this project, especially its WPF-Example. When I set the MinWidth, I get DeskBand with the Size I need.
But there's a problem: The UserControl isn't correctly sized to the bounds of its parent. Is there a way to achieve this? I already tried to modify the CSDeskBand.cs, but that didn't do anything:
public IntPtr Handle
{
get
{
if (_rootVisual.Child == null)
{
_rootVisual.Child = UIElement;
_rootVisual.Child.ClipToBounds = true;
_rootVisual.ClipToBounds = true;
}
return HwndSource.Handle;
}
}
Do you have any other ideas?
Thank the author for making this project, but I found some small problems in use.
Currently busy so I'll be slow to respond and post updates
Add build and usage instructions to readme
also when I try to debug the app when it's registered on taskbar vs says "The file is locked by windows explorer" and I cannot build the project.
Can leverage existing IBandSite interface which is currently unused
I want to add sqlite database . But when sqlite object is initialized there is no deskband appears on TaskBar and db.sqlite is also not created. Is there any way to store some data in sqlite using this Deskband.
Hello,
The latest version of this library has a small issue. In WPF mode, if you set a UIElement in the child class of CSDeskbandWpf, it will not stretch to the whole width of the deskband. Instead it will take the minimum width and the deskband will shrink to its size, leaving the rest of the deskband area empty.
To solve this issue, a small patch is needed to the CSDeskBandWpf
class constructor. After creating HwndSource
using HwndSourceParameters
, assign the SizeToContent
property on it to SizeToContent.Manual
and it will behave the same as previous versions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.