home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!cs.utexas.edu!usc!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!csus.edu!netcom.com!whedon
- From: whedon@netcom.com (Bill Whedon)
- Subject: Re: How do I put a DIB on the clipboard?
- Message-ID: <p19m=-m.whedon@netcom.com>
- Date: Mon, 17 Aug 92 18:58:49 GMT
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- References: <1992Aug17.113753.2174@siesoft.co.uk>
- Keywords: DIB clipboard
- Lines: 19
-
- In article <1992Aug17.113753.2174@siesoft.co.uk> crs@siesoft.co.uk (Chris Smith) writes:
- >Does anyone have some code to put a device independant bitmap on the clipboard?
- >I have the petzold book as my main reference and it just glosses over the
- >subject.
- I don't think it matters what kind of bitmap you have. You just :
- OpenClipboard(hWnd);
- EmptyClipboard();
- SetClipboardData(CF_BITMAP,hBitmap);
- CloseClipboard();
-
- The foregoing is straight out of Petzold, and it works for me. Or maybe
- I don't really understand the problem? (Not at all impossible :-) )
-
- Oh. You said DIB. Try
- SetClipboardData(CF_DIB,hMem); /* Instead of CF_BITMAP and hBitmap */
- giving the handle of your DIB memory. There's more detail (but no sample
- code that I could find) in the SDK doc under SetClipboardData.
- Good luck!
- Bill Whedon
-