我的笔记本电脑是 Windows7 32 位,带有扩展显示器。从 Windows 服务 调用时,但从 Windows 应用程序 或 调用时,Screen.AllScreens.Length 返回 1控制台应用程序给我的是2。
最佳答案
基本上,您没有将屏幕作为“普通”Windows 服务;您也没有正确运行的 GDI/GDI+ 函数。
参见Get Desktop Size from Windows Service?了解更多信息。
参见Allow service to interact with desktop in Windows与桌面交互。请注意,这在 Vista 中是不允许的。
关于c# - 行为不当的 Screen.AllScreens.Length,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12243738/