Initial commit to new repository
This commit is contained in:
21
.decompiledproj/AxCopilot/Services/WindowTracker.cs
Normal file
21
.decompiledproj/AxCopilot/Services/WindowTracker.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AxCopilot.Services;
|
||||
|
||||
internal static class WindowTracker
|
||||
{
|
||||
public static nint PreviousWindow { get; private set; } = IntPtr.Zero;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern nint GetForegroundWindow();
|
||||
|
||||
public static void Capture()
|
||||
{
|
||||
nint foregroundWindow = GetForegroundWindow();
|
||||
if (foregroundWindow != IntPtr.Zero)
|
||||
{
|
||||
PreviousWindow = foregroundWindow;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user