Article View: borland.public.cppbuilder.nativeapi
Article #789Re: How can I take a screen shot?
From: Bashar Termanini
Date: Fri, 11 Jan 2008 21:44
Date: Fri, 11 Jan 2008 21:44
23 lines
1648 bytes
1648 bytes
"Asger Joergensen" <junk@Asger-P.dk> wrote in message news:MPG.21e8f11d54bf16ac9899c6@newsgroups.borland.com... > > Hi Bashar > > Bashar Termanini says: >> How can I take a screen shot and save it to a bmp file? > > I think if You use GetDC(NULL) You will get a HDC to the screen > and then You can use BitBlt to copy the screen to a Bitmap. > > Kind regards > Asger I use this code to capture the screen HWND hWnd = GetDesktopWindow(); HWND hDC = GetWindowDC( hWnd ); Image1->Width = Screen->Width; Image1->Height = Screen->Height; BitBlt( Image1->Canvas->Handle, 0, 0, Screen->Width, Screen->Height, hDC, 0, 0, SRCCOPY ); It works first time. But when the Desktop change it still give me the first screen shot.
Technical Details
Message-ID:
<4787e357@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<477eabc5@newsgroups.borland.com> <MPG.21e8f11d54bf16ac9899c6@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,9a955b0dfec9583 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Bashar Termanini" <bashar-t@scs-net.org> Newsgroups: borland.public.cppbuilder.nativeapi References: <477eabc5@newsgroups.borland.com> <MPG.21e8f11d54bf16ac9899c6@newsgroups.borland.com> Subject: Re: How can I take a screen shot? Date: Fri, 11 Jan 2008 23:44:58 +0200 Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 88.86.13.164 Message-ID: <4787e357@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1200087895 88.86.13.164 (11 Jan 2008 13:44:55 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail