🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14161

Re: api & Screenshots?

#14161
From: Bob Gonder
Date: Tue, 02 Sep 2003 17:04
25 lines
1884 bytes
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: <bch9lv8jirl1qvkac2q02edgpdm0fpdphq@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.news2me.com!opentransit.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f549e70$1@newsgroups.borland.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 10:10:08 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: api & Screenshots?
Date: Tue, 02 Sep 2003 10:04:01 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <bch9lv8jirl1qvkac2q02edgpdm0fpdphq@4ax.com>
References: <3f549e70$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.31.164.110
X-Trace: newsgroups.borland.com 1062522244 67.31.164.110 (2 Sep 2003 10:04:04 -0700)
Lines: 28
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.news2me.com!opentransit.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail