我有一个应用程序使用UI自动化API与其他WPF应用程序工作。 我创建了使用相同的功能,但是当服务尝试查找窗口HWD收到NULL Windows服务:WPF UI自动化:从Windows服务
System.ArgumentException:HWND不能IntPtr.Zero或空。
在System.Windows.Automation.AutomationElement.FromHandle(IntPtr的HWND)
在MyService.Scheduler.GetNotificationWindow(IntPtr的hWndtoolBar)
是否可以使用UI自动化API在Windows服务?
我不认为这是可能的或容易实现,因为[会话0隔离](https://blogs.technet.microsoft。 com/askperf/2007/04/27/application-compatibility-session-0-isolation /) – lokusking