2015-11-23 18 views
0

我想通過桌面C#控制檯應用程序訪問Windows應用程序/非經典桌面應用程序的窗口維度。如何訪問非桌面Windows應用程序的窗口矩形

如果這將是一個桌面應用程序,我可以很容易地使用的代碼這個簡單的行: User32.GetWindowRect(handle, ref rect)

這行代碼無法檢索爲一體的現代化Windows的應用程序的矩形。 有沒有辦法得到窗口矩形或修改窗口尺寸?

回答

0

試試這個:

Windows.UI.Xaml.Window currentWindow = Windows.UI.Xaml.Window.Current; Windows.Foundation.Rect rect = currentWindow.Bounds;

rect.X和rect.Y會給你的座標。

相關問題