[英]Move or resize the windows of 3rd party programs with c#
我们公司这里有一个C#基本框架程序,它能够运行C#代码。 当它启动时,它以全屏模式运行,此外我们还有更多的程序可以并行运行。
我想在启动时将我们的程序放在屏幕的左侧,将另一个程序放在屏幕的右侧。
如何在C#中移动或调整第三方程序窗口的大小?
您可以使用MoveWindow
WinAPI函数来做到这一点:
//Import:
[DllImport("user32.dll", SetLastError = true)]
internal static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
//Usage:
MoveWindow(ApplicationHandle, 600, 600, 600, 600, True);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.