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

Screen capture does not work in Windows Service...?

P: n/a
Hi guys,

I have a little problem. I have a class that uses Windows API to capture a
snapshot of the screen. I have this class in a library that I include in my
projects.

When I try to use this class in a windows service, the snapshot comes up as
a black screen. Any idea why? or how do I get around it?

The class works fine if I use it in a regular windows forms application.

Thank you in advance!

--
Juan Romero
-----------------------------------------
The successful person has the habit of doing the things failures don't like
to do.
E.M. Gray
Nov 22 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Windows services do not interact with the desktop. There is a setting in
the properties for the windows service that allows the service to interact
with the desktop. Try changing this setting. I have not done this before,
but it is a thought.

"Madestro" <me_no_like_spam_juanDOTromero@bowneDOTcom> wrote in message
news:BB**********************************@microsof t.com...
Hi guys,

I have a little problem. I have a class that uses Windows API to capture a
snapshot of the screen. I have this class in a library that I include in
my
projects.

When I try to use this class in a windows service, the snapshot comes up
as
a black screen. Any idea why? or how do I get around it?

The class works fine if I use it in a regular windows forms application.

Thank you in advance!

--
Juan Romero
-----------------------------------------
The successful person has the habit of doing the things failures don't
like
to do.
E.M. Gray

Nov 22 '05 #2

P: n/a
Thank you Peter. This is a good lead. However, I cannot find this setting
anywhere. Can you be more specific?

Thank you!

--
Juan Romero
-----------------------------------------
The successful person has the habit of doing the things failures don't like
to do.
E.M. Gray
"Peter Rilling" wrote:
Windows services do not interact with the desktop. There is a setting in
the properties for the windows service that allows the service to interact
with the desktop. Try changing this setting. I have not done this before,
but it is a thought.

"Madestro" <me_no_like_spam_juanDOTromero@bowneDOTcom> wrote in message
news:BB**********************************@microsof t.com...
Hi guys,

I have a little problem. I have a class that uses Windows API to capture a
snapshot of the screen. I have this class in a library that I include in
my
projects.

When I try to use this class in a windows service, the snapshot comes up
as
a black screen. Any idea why? or how do I get around it?

The class works fine if I use it in a regular windows forms application.

Thank you in advance!

--
Juan Romero
-----------------------------------------
The successful person has the habit of doing the things failures don't
like
to do.
E.M. Gray


Nov 22 '05 #3

P: n/a
1) Administrative Tools --> Services
2) Locate your service and right-click. Select the Properties command.
3) Click the Log On tab.
4) Check the Allow service to interact with desktop checkbox.

I don't know if this will work, but it is worth a try.
"Madestro" <me_no_like_spam_juanDOTromero@bowneDOTcom> wrote in message
news:10**********************************@microsof t.com...
Thank you Peter. This is a good lead. However, I cannot find this setting
anywhere. Can you be more specific?

Thank you!

--
Juan Romero
-----------------------------------------
The successful person has the habit of doing the things failures don't
like
to do.
E.M. Gray
"Peter Rilling" wrote:
Windows services do not interact with the desktop. There is a setting in
the properties for the windows service that allows the service to
interact
with the desktop. Try changing this setting. I have not done this
before,
but it is a thought.

"Madestro" <me_no_like_spam_juanDOTromero@bowneDOTcom> wrote in message
news:BB**********************************@microsof t.com...
> Hi guys,
>
> I have a little problem. I have a class that uses Windows API to
> capture a
> snapshot of the screen. I have this class in a library that I include
> in
> my
> projects.
>
> When I try to use this class in a windows service, the snapshot comes
> up
> as
> a black screen. Any idea why? or how do I get around it?
>
> The class works fine if I use it in a regular windows forms
> application.
>
> Thank you in advance!
>
> --
> Juan Romero
> -----------------------------------------
> The successful person has the habit of doing the things failures don't
> like
> to do.
> E.M. Gray


Nov 22 '05 #4

P: n/a
But what screen are you trying to capture? If no one is logged on,
then all you might get would be the logon screen?

Perhaps your windows service could detect when a user logged on and
when they did, then kick off a thread or process that would capture the
screen.

Nov 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.