Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 11:01

    batzen on Win11WithNewGlow

    Improving showcase Removing TryToBeFlickerFree as … Improving showcase and 5 more (compare)

  • Oct 22 11:32

    batzen on Win11WithNewGlow

    We also have to delay position … (compare)

  • Oct 22 11:19

    batzen on Win11WithNewGlow

    Improving performance by using … (compare)

  • Oct 22 10:59

    batzen on Win11WithNewGlow

    Adding better error handling/lo… Merge remote-tracking branch 'o… (compare)

  • Oct 22 10:56

    batzen on Win11WithNewGlow

    Code cleanup Reducing allocations by removin… (compare)

  • Oct 21 16:12

    batzen on Win11WithNewGlow

    CreateCompatibleDC might return… (compare)

  • Oct 21 16:12

    batzen on Win11WithNewGlow

    Improving performance by using … Improving performance This get… (compare)

  • Oct 21 14:13

    batzen on Win11WithNewGlow

    Moving ChangeScope to separate … Adding IGlowWindow to ease swap… Adding support for glow window … and 1 more (compare)

  • Oct 19 19:10

    batzen on Win11WithNewGlow

    Fixing resizing when window is … Improving naming (compare)

  • Oct 19 15:56

    batzen on Win11WithNewGlow

    Adding COLORREF Changing GlowBrush to GlowColor Only show glow windows if GlowD… and 18 more (compare)

  • Oct 15 11:11

    batzen on Win11WithNewGlow

    Adding "test" for glow bitmap g… (compare)

  • Oct 15 10:58

    batzen on Win11WithNewGlow

    Making cornerGripThickness a fi… (compare)

  • Oct 15 10:49

    batzen on Win11WithNewGlow

    Let Windows calculate the NC-si… (compare)

  • Oct 15 07:10

    batzen on Win11WithNewGlow

    Improving resize area on captio… Don't do hit testing for resize… (compare)

  • Oct 14 14:32

    batzen on Win11WithNewGlow

    Improving glow corner rendering Improving perf when glow depth … Fixing wrongly sized black rect… (compare)

  • Oct 14 11:34

    batzen on Win11WithNewGlow

    Combining Win11 support and new… (compare)

  • Oct 14 09:27

    batzen on Win11Support

    Adding some disabled tracing to… (compare)

  • Oct 14 09:18

    batzen on Win11Support

    Improving showcase Adding ToString for POINT Fixing size calculation and 1 more (compare)

  • Oct 14 08:24

    batzen on Win11Support

    Fixing naming Improving showcase Adding some DWM stuff (compare)

  • Oct 13 23:01

    batzen on Win11Support

    Using typed code Removing explicit style setter (compare)

Jan Karger ツ ☀
@punker76
@/all Version 5 of #ControlzEx with .NET 5 support has just been released. https://github.com/ControlzEx/ControlzEx/releases
Deadpikle
@Deadpikle
🎉 congrats!
Pavel Mikhaylov
@paulem
Hi @punker76 @batzen ! Could you please tell me how I can use ControlzEx if I want to use a standard window shadow, i.e. without using Glow. I can disable GlowWindowBehavior, but how do I get the standard window shadow back? If this is not possible, what was the reason for doing it? Thank you!
Jan Karger ツ ☀
@punker76
@paulem Reason was this MahApps/MahApps.Metro#1791 and changed here MahApps/MahApps.Metro#1799
Pavel Mikhaylov
@paulem
@punker76 Got it, thank you!
elTRexx
@elTRexx
Hi. I'm struggling with Window Chrome flickering effect on Resizing. Track down issue to this : https://stackoverflow.com/questions/53000291/how-to-smooth-ugly-jitter-flicker-jumping-when-resizing-windows-especially-drag
And also find mention to your project that may be or not solve it. I want to try it out, but I cannot find any ressource from your github to know how to use your WindowChromeBehavior beside importing your nuget package and referencing your namespace in my MainWindow.xaml.
Can you explain me how to have a simple <Window> ... </Window> having your <controlzex:WindowChromeBehavior/> ? Thank you.
Bastian Schmidt
@batzen
Hi @elTRexx you can have a look at WindowChromeWindow.InitializeWindowChromeBehavior to see how to use the behavior WindowChromeWindow can be found as part of the showcase application at https://github.com/ControlzEx/ControlzEx/tree/develop/src/ControlzEx.Showcase
I have to admit it's not as intuitive as the "legacy" window chrome is.
If you have issues with flickering you can try to set TryToBeFlickerFree on the behavior to true.
elTRexx
@elTRexx
Tank you.
By the way I Cannot build ControlzEX, I have the same error I spotted here MahApps/MahApps.Metro#4147
XamlColorSchemeGeneratorExecutable seems to value ""
Bastian Schmidt
@batzen
Will have a look at that tomorrow.
elTRexx
@elTRexx
Ok @batzen ;) For futher clue, I found that I have a NuGet restore error that occur because of "value cannot be null. parameter name versionRange"
Also when I try to cleanUp solution I got this
[...]\obj\project.asstes.json no target for "net452/win7-x86" and [...]\obj\project.asstes.json no target for "net462/win7-x86"
To be complete my errors list window in VS show this :
Error MSB3073 The command """" stoped with code 9009. ControlzEx.Showcase C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Showcase\ControlzEx.Showcase.csproj 46
and 4 of the same error following :
elTRexx
@elTRexx
Error NU1008 Projects using centralised package version managing shouldn't define version on PackageReference elements, but on PackageVersion elements : JetBrains.Annotations;WpfAnalyzers;Microsoft.Xaml.Behaviors.Wpf;XamlColorSchemeGenerator;StyleCop.Analyzers;JetBrains.Annotations;WpfAnalyzers;Microsoft.Xaml.Behaviors.Wpf;XamlColorSchemeGenerator;StyleCop.Analyzers;Microsoft.CodeAnalysis.CSharp;JetBrains.Annotations;WpfAnalyzers;Microsoft.Xaml.Behaviors.Wpf;XamlColorSchemeGenerator;StyleCop.Analyzers;Microsoft.CodeAnalysis.CSharp;JetBrains.Annotations;WpfAnalyzers;Microsoft.Xaml.Behaviors.Wpf;XamlColorSchemeGenerator;StyleCop.Analyzers. ControlzEx.Showcase C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Showcase\ControlzEx.Showcase.csproj 1
(error output translated from french on the fly, so might be not 100% that in english)
elTRexx
@elTRexx

To inquiry further, here is the error output from msbuild in CLI :

C:\Users\Aurélien\source\repos\ControlzEx\src>msbuild
Microsoft (R) Build Engine version 16.11.0+0538acc04 pour .NET Framework
Copyright (C) Microsoft Corporation. Tous droits réservés.

Les projets sont générés individuellement dans cette solution. Pour activer la génération en parallèle, ajoutez le commutateur "-m".
La génération a démarré 20/09/2021 00:19:59.
Projet "C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.sln" sur le noud 1 (cibles par défaut).
ValidateSolutionConfiguration:
Génération de la configuration de solution "Debug|Any CPU".
Le projet "C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.sln" (1) génère "C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Showcase\ControlzEx.Showcase.csproj" (2) sur le noud 1 (cibles par défaut).
GenerateXamlFiles:
""
'""' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Showcase\ControlzEx.Showcase.csproj(46,7): error MSB3073: La commande """" s'est arrêtée avec le code 9009.
Génération du projet "C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Showcase\ControlzEx.Showcase.csproj" terminée (cibles par défaut) -- ÉCHEC.

Bastian Schmidt
@batzen
That's strange as the CI build runs without any restore issues. Could you run "dotnet restore" in the src folder and see if that works.
elTRexx
@elTRexx
Actually I already did this command before msbuild : git clean -xfd, nuget restore, dotnet restore $sln, msbuild(taken from a comment on this SO question : https://stackoverflow.com/questions/63433471/assets-file-obj-project-assets-json-doesnt-have-a-target-netframework-version)
Bastian Schmidt
@batzen
@elTRexx I applied the same fixes as i did in MahApps.Metro so it should work now.
elTRexx
@elTRexx
I pulled last commit (b4e5ef6), clean the solution (no error this time), build (1 error, same) tried rebuild (1 error, same)
Here is my VS2019 Build output

L'opération de regénération a démarré...

Le projet C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Tests\ControlzEx.Tests.csproj utilise CentralPackageVersionManagement, une fonctionnalité en préversion de NuGet.

Le projet C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Showcase\ControlzEx.Showcase.csproj utilise CentralPackageVersionManagement, une fonctionnalité en préversion de NuGet.

Le projet C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx\ControlzEx.csproj utilise CentralPackageVersionManagement, une fonctionnalité en préversion de NuGet.

Restauration effectuée de C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Showcase\ControlzEx.Showcase.csproj (en 28 ms).

Restauration effectuée de C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx\ControlzEx.csproj (en 72 ms).

Restauration effectuée de C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Tests\ControlzEx.Tests.csproj (en 280 ms).

1>------ Début de la regénération globale : Projet : ControlzEx, Configuration : Debug Any CPU ------

1>ControlzEx -> C:\Users\Aurélien\source\repos\ControlzEx\src\bin\Debug\ControlzEx\net462\ControlzEx.dll

1>ControlzEx -> C:\Users\Aurélien\source\repos\ControlzEx\src\bin\Debug\ControlzEx\net452\ControlzEx.dll

1>ControlzEx -> C:\Users\Aurélien\source\repos\ControlzEx\src\bin\Debug\ControlzEx\netcoreapp3.1\ControlzEx.dll

1>ControlzEx -> C:\Users\Aurélien\source\repos\ControlzEx\src\bin\Debug\ControlzEx\net5.0-windows\ControlzEx.dll

2>------ Début de la regénération globale : Projet : ControlzEx.Showcase, Configuration : Debug Any CPU ------

3>------ Début de la regénération globale : Projet : ControlzEx.Tests, Configuration : Debug Any CPU ------

2>Deleting XAML Color Scheme files...

2>Deleting XAML Color Scheme files...

2>Deleting XAML Color Scheme files...

2>Deleting XAML Color Scheme files...

2>Deleting XAML Color Scheme files...

2>Generating XAML files ()

2>'""' n'est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes.

2>C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Showcase\ControlzEx.Showcase.csproj(44,7): error MSB3073: La commande """" s'est arrêtée avec le code 9009.

2>Génération du projet "ControlzEx.Showcase.csproj" terminée -- ÉCHEC.

3>XamlColorSchemeGenerator - 4.0.0.155

3>XamlColorSchemeGenerator - 4.0.0.155

3>XamlColorSchemeGenerator - 4.0.0.155

3>XamlColorSchemeGenerator - 4.0.0.155

3>ControlzEx.Tests -> C:\Users\Aurélien\source\repos\ControlzEx\src\bin\Debug\ControlzEx.Tests\net452\ControlzEx.Tests.dll

3>ControlzEx.Tests -> C:\Users\Aurélien\source\repos\ControlzEx\src\bin\Debug\ControlzEx.Tests\net462\ControlzEx.Tests.dll

3>XamlColorSchemeGenerator - 4.0.0.155

3>ControlzEx.Tests -> C:\Users\Aurélien\source\repos\ControlzEx\src\bin\Debug\ControlzEx.Tests\netcoreapp3.1\ControlzEx.Tests.dll

3>ControlzEx.Tests -> C:\Users\Aurélien\source\repos\ControlzEx\src\bin\Debug\ControlzEx.Tests\net5.0-windows\ControlzEx.Tests.dll

========== Regénération globale : 2 a réussi, 1 a échoué, 0 a été ignoré ==========

elTRexx
@elTRexx
I will try on a fresh new solution to be sure
I Deleted ControlzEx folder from file explorer, cloned again in VS209, and build it : I have same error unfortunately
elTRexx
@elTRexx
I will try from CLI
elTRexx
@elTRexx
On CLI it fail also on Showcase :
ÉCHEC de la build.

"C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.sln" (cible par défaut) (1) ->
"C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Showcase\ControlzEx.Showcase.csproj" (cible par défaut) (2) ->
"C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Showcase\ControlzEx.Showcase.csproj" (Build cible) (2:3) ->
(GenerateXamlFiles cible) ->
  C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Showcase\ControlzEx.Showcase.csproj(44,7): error MSB3073: La commande """" s'est arrêtée avec le code 9009.
  "C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.sln" (cible par défaut) (1) ->
  "C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Showcase\ControlzEx.Showcase.csproj" (cible par défaut) (2) ->
  "C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Showcase\ControlzEx.Showcase.csproj" (Build cible) (2:4) ->
    C:\Users\Aurélien\source\repos\ControlzEx\src\ControlzEx.Showcase\ControlzEx.Showcase.csproj(44,7): error MSB3073: La commande """" s'est arrêtée avec le code 9009.

0 Avertissement(s)
2 Erreur(s)
Looking more precisely, it failed on Generating XAML files (net462) and Generating XAML files (netcoreapp3.1)
elTRexx
@elTRexx
But Generating XAML files (net452) and Generating XAML files (net5.0-windows) worked !
I hope it helps to pinpoint the error (maybe on my side, though I have downloaded .Net Core 3.1 SDK before I cloned ControlzEx ?)
Bastian Schmidt
@batzen
Having sdk version 5.0.something (from global.json) or a later 5 version should be enough to build. It's very strange that it works for some framework versions only.
Could you run dotnet --info and post the output here?
elTRexx
@elTRexx

C:\Users\Aurélien\source\repos\ControlzEx\src>dotnet --info
SDK .NET (reflétant tous les fichiers global.json) :
Version: 5.0.401
Commit: 4bef5f3dbf

Environnement d'exécution :
OS Name: Windows
OS Version: 10.0.19043
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.401\

Host (useful for support):
Version: 5.0.10
Commit: e1825b4928

.NET SDKs installed:
2.1.602 [C:\Program Files\dotnet\sdk]
2.1.700 [C:\Program Files\dotnet\sdk]
2.1.801 [C:\Program Files\dotnet\sdk]
2.1.802 [C:\Program Files\dotnet\sdk]
3.1.413 [C:\Program Files\dotnet\sdk]
5.0.302 [C:\Program Files\dotnet\sdk]
5.0.401 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

Bastian Schmidt
@batzen
That looks ok. Will try to find out what else could be wrong.
Bastian Schmidt
@batzen
@elTRexx I wasn't able to reproduce your issue in Windows Sandbox. The only thing i noticed is that the build behaves strange when the targeting packs for net4.5.2 and/or net4.6.2 are missing.
elTRexx
@elTRexx
I still got the error, but I am able to run the App (under correct .Net I guess), beyond the error message, and understood how your WindowChromeBehavior work (maybe update your readme ?, posted my result here : https://stackoverflow.com/questions/67551705/custom-resize-window-shaking/69288382#69288382).
Thank you to have taken time to look into this anyway.
Bastian Schmidt
@batzen
@elTRexx Glad it's working for you.
If you are still interested in a solution to your build problem the best way would be to create an issue on GitHub so we can try to find out what's wrong in your case.
elTRexx
@elTRexx
@batzen Ok I'll will do that then. Btw, I try to have a custom window shape, so I'm using AllowsTransparency="True" but the what should be transparent background is Black instead. I commented my use of WindowChromeBehavior in XAML to get back to native WPF Window (WindowStyle="None" ofc) and it work. So I suspect it is somewhere in your WindowChromeBehaviorthat the default background is Black ?
Jan Karger ツ ☀
@punker76
@elTRexx The AllowTransparency in WPF is broken for years.
Bastian Schmidt
@batzen
Using AllowsTransparency is prevented by ControlzEx as it causes severe performance and all kinds of other issues most of the time
If you absolutely want to use WindowChromeBehavior with AllowsTransparency=True you can inherit from the behavior, override OnAttached, call base.OnAttached and set AllowsTransparency=True afterwards
But don't report any bugs that are caused by doing so ;-)
elTRexx
@elTRexx
@batzen Ok, I review your code today. Indeed you force AllowsTransparency to false.
Btw, I tried to understand how you manage FlickerFree.
Is the trick of increasing height by 1 pixel in private IntPtr _HandleNCCALCSIZE(WM uMsg, IntPtr wParam, IntPtr lParam, out bool handled) is all it needed ?
Bastian Schmidt
@batzen
Yes, that's all that's needed to be flicker free most of the time. It doesn't matter on which side that happens as long the area is not equal to the window size. I still consider that a bug in windows itself.
elTRexx
@elTRexx
I copy only necessary code to handle your WindowChromeBehavior (so without usign your dll anymore), it work, and yeah, allowing AllowsTransparency=True result in a invisible window !
I guess I'll have to accept my ugly custom window corner and find a color close enough to fade in.