home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / mswindo / programm / misc / 1367 < prev    next >
Encoding:
Text File  |  1992-08-17  |  1.3 KB  |  31 lines

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