新任务,要打开设置页面,并移动到指定位置,并设定窗口大小。 打开设置和移动窗口是非常简单,直接用ShellExecute和MoveWindow就可以了,上代码: using System; using System.Runtime.InteropServices; namespace OpenWindows { class Program { static void Main(string[] args) { ShellExecute(IntPtr.Zero, "open", "ms-settings:storagesense", "", null, 9); IntPtr handle = (IntPtr)0x00030E7E; MoveWindow(handle, 960, 0, 960, 1050, true); } [DllImport("Shell32.dll", CharSet = CharSet.Auto, SetLastError = true)] static extern IntPtr ShellExecute(IntPtr hwnd, string...