外部プロセスのウィンドウから、位置、サイズ、およびアクティブ状態のイベントを受信できるようにします。
상속: IChromeOwner, IDisposable
예제 #1
0
        public void Register(IntPtr hWnd)
        {
            lock (this._sync)
            {
                if (this._pinnedWindows.ContainsKey(hWnd)) return;

                var external = new ExternalWindow(hWnd);
                var chrome = new WindowChrome
                {
                    BorderThickness = new Thickness(4.0),
                    Top = new PinMarker(),
                };
                chrome.Attach(external);
                external.Closed += (sender, e) => this.Unregister(hWnd);

                this._pinnedWindows[hWnd] = new PinnedWindow(external, chrome);
            }
        }
예제 #2
0
		private static async void SetGlowingForActiveWindow()
		{
			await Task.Delay(2500);

			var hWnd = User32.GetForegroundWindow();
			var appHandles = Application.Current.Windows
				.OfType<Window>()
				.Select(x => PresentationSource.FromVisual(x) as HwndSource)
				.Where(x => x != null)
				.Select(x => x.Handle)
				.ToArray();
			if (appHandles.All(x => x != hWnd))
			{
				var external = new ExternalWindow(hWnd);
				var chrome = new WindowChrome();
				chrome.Attach(external);
			}
		}
예제 #3
0
 public PinnedWindow(ExternalWindow window, WindowChrome chrome)
 {
     this._window = window;
     this._chrome = chrome;
 }