■ Window 클래스를 사용해 AppWindow 객체 구하기
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
using System; using Microsoft.UI; using Microsoft.UI.Windowing; using Microsoft.UI.Xaml; using WinRT.Interop; #region 앱 윈도우 구하기 - GetAppWindow(window) /// <summary> /// 앱 윈도우 구하기 /// </summary> /// <param name="window">윈도우</param> /// <returns>앱 윈도우</returns> public AppWindow GetAppWindow(Window window) { IntPtr windowHandle = WindowNative.GetWindowHandle(window); WindowId windowID = Win32Interop.GetWindowIdFromWindow(windowHandle); return AppWindow.GetFromWindowId(windowID); } #endregion |