有谁知道您是否可以使用 .NET 框架或通过 pinvoking 获取窗口的坐标?
我会有 processID 或 mainwindowhandle。
在 Windows 窗体 API 中,form.Top 和 form.Left 应该可以。
如果您只有进程 ID,则可以使用EnumWindowsProc windows API 方法遍历进程的寡妇。一旦你得到你想要的窗口句柄,你就可以查询它的大小和位置。
嗨,您可以使用 System.Windows.Forms.Control cr= System.Windows.Forms.Control.FromHandle(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle); 现在您可以获取该控件的位置。