c# - 行为不当的 Screen.AllScreens.Length

标签 c# .net windows-services

我的笔记本电脑是 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/

相关文章:

c# - 通过C#方法编写HTML和JQuery

c# - Extending LINQ to Nhibernate provider,结合Dynamic LINQ问题

.net - 使用 Windows 服务运行 UI

c# - 使用 JasperReports Server API 从运行报告中检索 PDF

c# - SQL Server 2008 R2 查询通知上的死锁 (SqlDependency)

C#:实现特定接口(interface)的方法参数

c# - 负载平衡控制台应用程序或服务

windows-services - AppFabric缓存错误:The AppFabric Caching Service service terminated unexpectedly

c# - 无法更新 MSI 安装的 Windows 服务

c# - 将 bool 映射到 LINQ to SQL 数据源中的 'Y'/'N' 字段