home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_11_09 / 1109045a < prev    next >
Text File  |  1993-04-26  |  2KB  |  75 lines

  1. Listing 3  Retrieving Display Device Characteristics
  2.  
  3.  
  4. struct DeviceInfo
  5. {
  6.  WORD version;
  7.  WORD technology;
  8.  WORD horzRes;        /* pixels */
  9.  WORD vertRes;        /* lines  */
  10.  WORD adjacentPixel;
  11.  WORD colorPlanes;
  12.  WORD colorTable;
  13.  WORD paletteSize;
  14.  WORD reservedPalette;
  15.  WORD bitsPerPixel;
  16.  int  BANDsupport;    /* T or F */
  17.  int  BM64support;    /* T or F */
  18.  int  GDIBsupport;    /* T or F */
  19.  int  SDIBTDsupport;  /* T or F */
  20.  int  PALsupport;     /* T or F */
  21. } devInf;
  22.  
  23. /*-------------------------------------------------*/
  24.  
  25. void getDeviceCapsInfo (HDC hDC,
  26.                         struct DeviceInfo *devInf)
  27. /*
  28. */
  29.   {
  30.    WORD rcaps;
  31.  
  32.    devInf->version =
  33.          (WORD)GetDeviceCaps(hDC,DRIVERVERSION);
  34.    devInf->technology =
  35.          (WORD)GetDeviceCaps(hDC,TECHNOLOGY);
  36.    devInf->horzRes =
  37.          (WORD)GetDeviceCaps(hDC,HORZRES);
  38.    devInf->vertRes =
  39.          (WORD)GetDeviceCaps(hDC,VERTRES);
  40.    devInf->adjacentPixel =
  41.          (WORD)GetDeviceCaps(hDC,BITSPIXEL);
  42.    devInf->colorPlanes =
  43.          (WORD)GetDeviceCaps(hDC,PLANES);
  44.    devInf->colorTable =
  45.          (WORD)GetDeviceCaps(hDC,NUMCOLORS);
  46.    devInf->paletteSize =
  47.          (WORD)GetDeviceCaps(hDC,SIZEPALETTE);
  48.    devInf->reservedPalette =
  49.          (WORD)GetDeviceCaps(hDC,NUMRESERVED);
  50.    devInf->bitsPerPixel =
  51.          (WORD)GetDeviceCaps(hDC,COLORRES);
  52.  
  53.    rcaps = (WORD)GetDeviceCaps(hDC,RASTERCAPS);
  54.  
  55.    if (rcaps & RC_BANDING)
  56.      devInf->BANDsupport = TRUE;
  57.    else devInf->BANDsupport = FALSE;
  58.  
  59.    if (rcaps & RC_BITMAP64)
  60.      devInf->BM64support = TRUE;
  61.    else devInf->BM64support = FALSE;
  62.  
  63.    if (rcaps & RC_DI_BITMAP)
  64.      devInf->GDIBsupport = TRUE;
  65.    else devInf->GDIBsupport = FALSE;
  66.  
  67.    if (rcaps & RC_DIBTODEV)
  68.      devInf->SDIBTDsupport = TRUE;
  69.    else devInf->SDIBTDsupport = FALSE;
  70.  
  71.    if (rcaps & RC_PALETTE)
  72.      devInf->PALsupport = TRUE;
  73.    else devInf->PALsupport = FALSE;
  74.   } /* getDeviceCapsInfo */
  75.