Category : Files from Magazines
Archive   : WDJAN92.ZIP
Filename : 3N01006B

 
Output of file : 3N01006B contained in archive : WDJAN92.ZIP

/*****************************************************/
/* icon.c */
/* -- Module implements a routine to create an icon. */
/*****************************************************/

/*****************************************************/
/* Header files. */
/*****************************************************/
#include
#include "icon.h"

/*****************************************************/
/* Routines. */
/*****************************************************/

HICON
HicnFromBmpBmp(HBITMAP hbmpColor, HBITMAP hbmpMono)
/******************************************************/
/* -- Given a color and monochrome bitmap with the */
/* dimension, create and return a handle to an */
/* icon. */
/* -- hbmpColor : Color bitmap. */
/* -- hbmpMono : Monochrome bitmap. */
/******************************************************/
{
LPICN lpicn;
BITMAP bmpColor, bmpMono;
HICON hicn;
DWORD cbColor, cbMono;

/* Get the header info from the bitmaps. */
GetObject(hbmpMono, sizeof bmpMono, (LPSTR)&bmpMono);
cbMono = bmpMono.bmWidthBytes * bmpMono.bmHeight;
GetObject(hbmpColor, sizeof bmpColor, (LPSTR)&bmpColor);
cbColor = bmpColor.bmWidthBytes * bmpColor.bmHeight;

/* Get some space for the icon. */
hicn = GlobalAlloc(GMEM_MOVEABLE, sizeof *lpicn -
sizeof(BYTE) + cbColor + cbMono);
if (hicn == NULL)
return hicn;

/* Initialize the icon header info. */
lpicn = (LPICN)GlobalLock(hicn);
lpicn->cbLine = bmpMono.bmWidthBytes;
lpicn->dx = bmpColor.bmWidth;
lpicn->dy = bmpColor.bmHeight;
lpicn->ptHot.x = lpicn->ptHot.y = 0;
lpicn->cpln = bmpColor.bmPlanes;
lpicn->cbit = bmpColor.bmBitsPixel;

/* Finish the filling the icon with bitmap bits. */
GetBitmapBits(hbmpMono, cbMono, lpicn->rgb);
GetBitmapBits(hbmpColor, cbColor,
lpicn->rgb + cbMono);
GlobalUnlock(hicn);
return hicn;
}


  3 Responses to “Category : Files from Magazines
Archive   : WDJAN92.ZIP
Filename : 3N01006B

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/