By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,795 Members | 1,761 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,795 IT Pros & Developers. It's quick & easy.

Windows Service calling EnumChildWindows

P: n/a
Can I use EnumchildWindows from a windows service to find the IE windows and
Solitaire windows belonging to the logged on user?

And if so then I'll need to know what call to use to get the users desktop
window handle to enum them - Assuming GetDesktopWindow doesn't at this point.

I can do all this in a Forms application (trying to convert to service) but
as a service it simply doesn't think there are any of those windows open.
Nov 5 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
>Can I use EnumchildWindows 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.
Nov 6 '07 #2

P: n/a
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\CurrentControlSet\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 EnumchildWindows 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.
Nov 8 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.