我有一個應用程序使用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