I'm working on a windows service in which I need to interact with the desktop and control a browser instance. I've come across ShellWindows (from SHDocVw) in which I can enumerate sucessfully in a widows Forms Application to obtain the handle of the Intenet Explorer Browser.
The functionality I'm using is:-
For Each window As InternetExplorer In New ShellWindows
We need to migrate this funcitonality into a Windows service so that the processing can occur in the background and then on a given event the windows service will interact with the desktop
and then control the active Internet explorer instance.
However, when I try the code in the windows Service I get an error:-
System.IO.FileNotFoundException: The system cannot find the file specified.
I have attempted to run the service by allowing "Allow Service to interact with desktop" in the Log On section and even using the specific account that I'm logged in on but it always gives the above error.
I know that the widows service isn't designed to cater for interacting directly with desktop processes but is there a way to make this work? It's not really an option to code any windows Form type application (i.e. such as to have a second application which will communicate with the service).