I have an application which work using UI Automation API with other WPF application. I have created Windows service which use the same functionality but when the service tries to find the window hwd it receives NULL:
System.ArgumentException: hwnd cannot be IntPtr.Zero or null.
at System.Windows.Automation.AutomationElement.FromHandle(IntPtr hwnd)
at MyService.Scheduler.GetNotificationWindow(IntPtr hWndtoolBar)
Is it possible to use UI Automation API in Windows Service?