Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用c移动或调整第三方程序的窗口大小#_C# - Fatal编程技术网

C# 使用c移动或调整第三方程序的窗口大小#

C# 使用c移动或调整第三方程序的窗口大小#,c#,C#,我们公司有一个C#基本框架程序,它可以运行C#代码。当它启动时,它以全屏模式运行,此外,我们有更多的程序并行运行 我想把我们的程序放在左边,另一个程序放在启动时屏幕的右边 如何在C#中移动或调整第三方程序窗口的大小?您可以使用MoveWindowWinAPI函数: //Import: [DllImport("user32.dll", SetLastError = true)] internal static extern bool MoveWindow(IntPtr hWnd, int X, i

我们公司有一个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);