From d6da6ca598aaa7ebfe3536b03efb098815bed6ad Mon Sep 17 00:00:00 2001 From: That-One-Nerd Date: Sat, 27 May 2023 16:34:55 -0400 Subject: [PATCH] Added the GetConsoleWindow function. --- SrcMod/Shell/Interop/Kernel32.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SrcMod/Shell/Interop/Kernel32.cs b/SrcMod/Shell/Interop/Kernel32.cs index 82110c7..7bca82c 100644 --- a/SrcMod/Shell/Interop/Kernel32.cs +++ b/SrcMod/Shell/Interop/Kernel32.cs @@ -6,6 +6,9 @@ internal static partial class Kernel32 [return: MarshalAs(UnmanagedType.Bool)] public static partial bool GetConsoleScreenBufferInfo(nint hConsoleOutput, out ConsoleScreenBufferInfo lpConsoleScreenBufferInfo); + [LibraryImport("kernel32.dll", SetLastError = true)] + public static partial nint GetConsoleWindow(); + [LibraryImport("kernel32.dll", SetLastError = true)] public static partial uint GetFinalPathNameByHandleA(nint hFile, [MarshalAs(UnmanagedType.LPTStr)] string lpszFilePath, uint cchFilePath, uint dwFlags);