> Yeah. I meant to put GetWindowsDC in not GetDC.
> 
> I'm not sure I understand exactly what your after.
> If you want to trap the entire screen just go
> 
> theDC := GetDC(0);
> Image1.Canvas.Handle := theDc;
> 
> If that doesn't work or not what your after give me a yell.
> 

Well it sounds as though this is what I am after, but it doesn't work. (I 
changed the line to GetWindowsDC(0) but it doesn't know that... took GetWindowDC
(0) OK but the TImage didn't have anything in it when the form came back.

Here's the section of code - perhaps I've misunderstood how to use it.


procedure TForm1.GetScreen1Click(Sender: TObject);
Var
 theDC   : HDC;
begin
    Form1.Visible := false;
    theDC := GetWindowDC(0);
    Image1.Canvas.Handle := theDC
    Form1.Visible := true;
end;

As you can see, I'm trying to get the form out of the way to display what is on 
the screen underneath, then calling GetWindowDC(0) and then making the form 
visible again.

I want the form to come back up with a copy of the desktop or whatever other 
application is running underneath showing in the TImage.

As I said, I can press the printscreen key manually before running the program 
then use ASSIGN method to get the image into the TIMage and that works fine - 
just can't do it from the program yet...

Laurie..



---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to