창 올라타기

This commit is contained in:
2026-08-26 11:01:56 +09:00
parent 65024110df
commit cab0d772b1
18 changed files with 1335 additions and 31 deletions

View File

@@ -30,14 +30,23 @@ internal static class Win32
public const uint SWP_FRAMECHANGED = 0x0020;
public const uint SWP_SHOWWINDOW = 0x0040;
public const int SM_CXSCREEN = 0; // 주 모니터 너비
public const int SM_CYSCREEN = 1; // 주 모니터 높이
public const int SM_XVIRTUALSCREEN = 76;
public const int SM_YVIRTUALSCREEN = 77;
public const int SM_CXVIRTUALSCREEN = 78;
public const int SM_CYVIRTUALSCREEN = 79;
// DwmGetWindowAttribute 속성 번호
public const int DWMWA_EXTENDED_FRAME_BOUNDS = 9; // 보이는 실제 프레임(투명 여백 제외)
public const int DWMWA_CLOAKED = 14; // UWP 등 "숨겨졌지만 살아있는" 창
public const uint SPI_GETWORKAREA = 0x0030;
public const int SW_HIDE = 0;
public const int SW_SHOW = 5;
public const int VK_LBUTTON = 0x01;
public const int VK_SHIFT = 0x10;
public const int VK_CONTROL = 0x11;
public const int VK_MENU = 0x12; // Alt
@@ -67,6 +76,7 @@ public struct RECT
}
[DllImport("user32.dll")] public static extern IntPtr GetActiveWindow();
[DllImport("user32.dll")] public static extern IntPtr GetForegroundWindow(); // 지금 활성화된 창
[DllImport("user32.dll", CharSet = CharSet.Unicode)] public static extern IntPtr FindWindowW(string lpClassName, string lpWindowName);
[DllImport("user32.dll")] public static extern uint GetWindowLongW(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")] public static extern uint SetWindowLongW(IntPtr hWnd, int nIndex, uint dwNewLong);
@@ -76,6 +86,22 @@ public struct RECT
[DllImport("user32.dll")] public static extern bool GetCursorPos(out POINT lpPoint);
[DllImport("user32.dll")] public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
[DllImport("user32.dll")] public static extern short GetAsyncKeyState(int vKey);
// --- 창 열거 ---
public delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
[DllImport("user32.dll")] public static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
[DllImport("user32.dll")] public static extern bool IsWindowVisible(IntPtr hWnd);
[DllImport("user32.dll")] public static extern bool IsIconic(IntPtr hWnd); // 최소화 여부
[DllImport("user32.dll", CharSet = CharSet.Unicode)] public static extern int GetWindowTextLengthW(IntPtr hWnd);
[DllImport("user32.dll", CharSet = CharSet.Unicode)] public static extern int GetWindowTextW(IntPtr hWnd, System.Text.StringBuilder lpString, int nMaxCount);
[DllImport("user32.dll")] public static extern bool SystemParametersInfoW(uint uiAction, uint uiParam, out RECT pvParam, uint fWinIni);
/// <summary>DWMWA_CLOAKED 등 int 값을 받는 속성용.</summary>
[DllImport("dwmapi.dll")] public static extern int DwmGetWindowAttribute(IntPtr hwnd, int dwAttribute, out int pvAttribute, int cbAttribute);
/// <summary>DWMWA_EXTENDED_FRAME_BOUNDS 처럼 RECT 를 받는 속성용.</summary>
[DllImport("dwmapi.dll")] public static extern int DwmGetWindowAttribute(IntPtr hwnd, int dwAttribute, out RECT pvAttribute, int cbAttribute);
[DllImport("user32.dll")] public static extern bool SetLayeredWindowAttributes(IntPtr hWnd, uint crKey, byte bAlpha, uint dwFlags);
[DllImport("dwmapi.dll")] public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMarInset);