Initial commit to new repository

This commit is contained in:
2026-04-03 18:22:19 +09:00
commit 4458bb0f52
7672 changed files with 452440 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using System.Runtime.InteropServices;
namespace AxCopilot.Services;
/// <summary>
/// 런처 활성화 직전의 포그라운드 창 핸들을 보존합니다.
/// SnapHandler, ScreenCaptureHandler에서 "이전 창"으로 사용됩니다.
/// App.xaml.cs의 OnHotkeyTriggered()에서 Capture()를 호출합니다.
/// </summary>
internal static class WindowTracker
{
[DllImport("user32.dll")] private static extern IntPtr GetForegroundWindow();
/// <summary>런처 활성화 직전의 창 핸들</summary>
public static IntPtr PreviousWindow { get; private set; } = IntPtr.Zero;
/// <summary>현재 포그라운드 창을 PreviousWindow에 저장합니다.</summary>
public static void Capture()
{
var hwnd = GetForegroundWindow();
if (hwnd != IntPtr.Zero)
PreviousWindow = hwnd;
}
}