How can I detect when Windows 10 enters tablet mode in a Windows Forms application?

To get whether the system is in tablet mode or not, query the system metric ConvertibleSlateMode like so (not tested, but it should work fine as far back as XP): public static class TabletPCSupport { private static readonly int SM_CONVERTIBLESLATEMODE = 0x2003; private static readonly int SM_TABLETPC = 0x56; private static Boolean isTabletPC = false; … Read more

Add new Microsoft Edge to web browser control?

UPDATE Jan 2021: WebView2 has been released. This enables integration of the Chromium based Edge as a web control. It’s a lot more complicated to use, unfortunately, but a lot more powerful. Works with WinForms or WPF or C++ apps. https://learn.microsoft.com/en-us/microsoft-edge/webview2/ UPDATE May 2018: FINALLY Microsoft has made it easy. https://blogs.windows.com/msedgedev/2018/05/09/modern-webview-winforms-wpf-apps/ For now, the new … Read more

VS Code / Bitbucket / SSH – Permission denied (publickey)

Windows 10 allows using all default OpenSSH tools. However, git was throwing permission denied for every time when I tried to clone repositories from Github, Gitlab or Bitbucket over SSH. You need to perform a few tweaks to make it work. Make sure ssh-agent service enabled, or run in Powershell (as administrator): Get-Service -Name ssh-agent … Read more

How to remove the Win10’s PATH from WSL

For Windows builds HIGHER than 17713: WSL uses the file /etc/wsl.conf inside each Linux VM’s filesystem to configure its behavior. Add the following configuration settings (explained here) to /etc/wsl.conf, creating that file if necessary: [interop] appendWindowsPath = false Note that appendWindowsPath must be under [interop] for this to work. You may need to shutdown the … Read more

How to use the new support for ANSI escape sequences in the Windows 10 console?

The problem is that the Python interpreter doesn’t enable the processing of ANSI escape sequences. The ANSI sequences work from the Windows command prompt because cmd does enable them. If you start Python from the command prompt you’ll find the ANSI sequences do work, including the ones for enabling and disabling the cursor. That’s because … Read more

How do you set the glass blend colour on Windows 10?

Since GDI forms on Delphi don’t support alpha channels (unless using alpha layered windows, which might not be suitable), commonly the black color will be taken as the transparent one, unless the component supports alpha channels. tl;dr Just use your TTransparentCanvas class, .Rectangle(0,0,Width+1,Height+1,222), using the color obtained with DwmGetColorizationColor that you could blend with a … Read more