I have gotten past this one. I'm not sure why it wasn't working before but
I've found that I need to reboot "A LOT" when developing a windows service.
All the building, installing, uninstalling, rebuilding, etc., just corrupts
the system and the service doesn't work as expected until a reboot. This is
on a brand new install too using .NET 2003.
Now my next problem is I need the service to "Allow interaction with
desktop". I have found most of the solution to do this. BUT, there is
something missing...
In the installer module I have coded it to enter all registry entries - and
for now I have given myself permission to the
HKLM\System\Cur rentControlSet\ Enum\Root node to enter the LEGACY_XXXXXXX
keys/values WHERE XXXXXXX is my service name.
I have obtained these entries by manually setting the service to "Allow
Interaction with desktop". But there is one setting not in this node or the
Service node that needs to be addressed. After install everything looks just
as I expect and looks like it should work - right? Wrong!
I still have to go the the service manager, uncheck the option, save,
re-check the option, save, and then the service works as expected. So my
question is: Is there a better way to set the "Allow Service to interact
with desktop"? Or does anyone have the faintest idea what else needs to
happen before this will work properly. It's the same problem as before -
there are no windows found - just like if the option was not set.
"Mattias Sjögren" wrote:
>
Can I use EnumchildWindow s from a windows service to find the IE windows and
Solitaire windows belonging to the logged on user?
It depends on your OS and some other factors.
Why do you want to do this from a service?
Mattias
--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.