Article View: borland.public.cppbuilder.nativeapi
Article #14165Re: api & Screenshots?
From: CC
Date: Tue, 02 Sep 2003 22:03
Date: Tue, 02 Sep 2003 22:03
35 lines
2149 bytes
2149 bytes
Bob, Thanks for the info - it was very helpful, although I was wondering in your example, what is 'hBmp' that is passed into GetObject(), and how is it obtained? Many Thanks, CurtC "Bob Gonder" <notbg@notmindspring.invalid> wrote in message news:bch9lv8jirl1qvkac2q02edgpdm0fpdphq@4ax.com... > CC wrote: > > >I thinkI have come across api's in the past that would allow you to get a > >bitmap of a window on the screen (probably given a window handle, etc). > > > >Does anyone know of the api(s) to do such a thing? > > You need the DC, no? > (Client area only, no title or menu bar) > HDC hwDC = GetDC( hWnd ); > (Complete window, title, menu,status,etc) > HDC hwDC = GetWindowDC( hWnd ); > > I think you'd then need to create an empty bitmap of the proper size. > Then you need a DC for your BITMAP. > hdcBmp = CreateCompatibleDC( hwDC ); > GetObject( hBmp, sizeof(BITMAP), &bm); > hbmpSaved = SelectObject(hdcBmp, hBmp ); > Then you BitBlt the screen to the bitmap and save/use it. > Then > SelectObject( hdcBmp, hbmpSaved ); > DeleteDC( hdcBmp ); > ReleaseDC( hWnd, hwDC ); > > Look in the help under "Bitmap Functions" > > >
Technical Details
Message-ID:
<3f551388@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f549e70$1@newsgroups.borland.com> <bch9lv8jirl1qvkac2q02edgpdm0fpdphq@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,63984f9ae83df73a X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-09-02 15:06:31 PST From: "CC" <Xcurtc@tmscorp.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f549e70$1@newsgroups.borland.com> <bch9lv8jirl1qvkac2q02edgpdm0fpdphq@4ax.com> Subject: Re: api & Screenshots? Date: Tue, 2 Sep 2003 17:03:26 -0500 Lines: 37 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 208.254.250.201 Message-ID: <3f551388@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1062540168 208.254.250.201 (2 Sep 2003 15:02:48 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail