Solved

Screenshot from a XP / 2000 service program

Posted on 2006-11-05
5
850 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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

713 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