gpt4 book ai didi

c# - 如何在 C# 中平铺两个程序窗口?

转载 作者:可可西里 更新时间:2023-11-01 10:33:29 25 4
gpt4 key购买 nike

我想在 C# 中水平平铺两个 Windows 程序。它用于使用 Chrome 查看 2d 图像的数据查看程序,Unity3d 用于 3d 和导航。

例如,我可以在 Windows 任务管理器中选择两个程序,上下文中有一个选项可以平铺它们。

.Net 框架中是否有用于平铺不同程序窗口的句柄?

最佳答案

可能最好的方法是使用 MoveWindow(其中 hWnd 是要移动的窗口):

[DllImport("user32.dll", SetLastError = true)]
internal static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);

MoveWindow(ApplicationHandle, 600, 600, 600, 600, true);

如果您不知道窗口指针,可以使用 FindWindow 功能。

另外值得一读的是 MSDN SetWindowPos(与 MoveWindow 非常相似)。

关于c# - 如何在 C# 中平铺两个程序窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40396177/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com