Solved

Screenshot from a XP / 2000 service program

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

Industry Leaders: 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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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