home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / pmvnc100.zip / querycap.c < prev    next >
C/C++ Source or Header  |  1999-08-03  |  655b  |  33 lines

  1. /*
  2.  * querycap.c - query device capability
  3.  */
  4.  
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7.  
  8. #define INCL_PM
  9. #include <os2.h>
  10.  
  11. #include "pmvncdef.h"
  12.  
  13. int     queryColorIndex(void)
  14. {
  15.     HDC     hdc ;
  16.     LONG    num ;
  17.     
  18.     hdc = DevOpenDC(habNetwork, OD_MEMORY, "*", 0, NULL, NULLHANDLE) ;
  19.     if (hdc == NULLHANDLE) {
  20.         TRACE("queryColorIndex - NULL hdc\n") ;
  21.     return 0 ;
  22.     }
  23.     if (DevQueryCaps(hdc, CAPS_COLOR_INDEX, 1, &num) != TRUE) {
  24.         TRACE("queryColorIndex - failed\n") ;
  25.     return 0 ;
  26.     }
  27.     num += 1 ;
  28.     TRACE("queryColorIndex - %d\n", num) ; 
  29.     DevCloseDC(hdc) ;
  30.     
  31.     return (int) num ;
  32. }
  33.