Skip to content

Instantly share code, notes, and snippets.

View vborovikov's full-sized avatar

Vladislav Borovikov vborovikov

  • Russia
View GitHub Profile
internal static class SafeNativeMethods
{
[DllImport("dwmapi", SetLastError = true)]
private static extern int DwmIsCompositionEnabled([MarshalAs(UnmanagedType.Bool)] out bool isEnabled);
public static bool SafeDwmIsCompositionEnabled()
{
bool result = false;
if (Environment.OSVersion.Version.Major >= 6)
{
@vborovikov
vborovikov / Globbing.cs
Created February 19, 2025 19:54
File name globbing
namespace SimpleGlobbing;
using System;
using System.Buffers;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
static class Globbing
{