Solved

Screenshot from a XP / 2000 service program

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now