?
Solved

Screenshot from a XP / 2000 service program

Posted on 2006-11-05
5
Medium Priority
?
859 Views
Last Modified: 2008-03-15
Hi,

I need to take a screenshot FROM A XP/2000 SERVICE.  When I take the screenshot from a normal program it works fine (using any of the differents codes available in internet), but using that code from a service program is not working (I only get a white screen).

Not sure if it helps, but:

I'm using getdc(0) to get the desktop handle; looking code written in C, I notice that a working code use getdc(null), but I cannot use that in delphi because it generates an  "could not convert variant of type (Null) into type (int64)" error.

As far as I can imagine, my problem is that I get the handle to the current user desktop, not the "real" desktop, so the function called from a regular application works well, but from a service program (system user) it fails...

Remember, take a normal screenshot from a normal application is not the problem, but using the same code in a xp/2000 service application.

Thanks in advance...
ps. sorry for my bad english
0
Comment
Question by:jcanonmercado
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 28

Expert Comment

by:TName
ID: 17879877
Works for me with GetDc(0)...
(ServiceType stWin32, Interactive is true)
0
 
LVL 28

Expert Comment

by:TName
ID: 17879943
You could also try something like this:

aCanvas := TCanvas.Create;
aCanvas.Handle := GetWindowDC(GetDesktopWindow);
0
 

Author Comment

by:jcanonmercado
ID: 17883496
OK, maybe I wasn't clear enough...

I'm trying to make a remote control program, and it works... except on logon screen...

When in windows logon screen, my service application comunicates well, I have responses of all request I made, but I can't get a screenshot at this moment...if the service is allowed to interact with desktop I can get screenshots when the user log in... but not in logon screen...

I know this is possible because some remote control programs can do that (when in service mode...)

Any ideas?

tkanks...
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 21133153
PAQed with points refunded (250)

Computer101
EE Admin
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question