home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / PMDIB1.ZIP / CALLDIB.C < prev    next >
Text File  |  1992-01-10  |  1KB  |  60 lines

  1. /*   calldib.c    -   call PMDIB dll from Full Screen
  2.  
  3.      (c) MIDORI S.A. 1991-1992
  4.      by skarbat@informat
  5. */
  6.  
  7. #define  INCL_DOS
  8. #include <os2.h>
  9.  
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <string.h>
  13. #include <io.h>
  14.  
  15. #include "pmdib.h"
  16.  
  17.  
  18. // global vars
  19. char chImagen[80] ;
  20. int  rc ;
  21.  
  22.  
  23. int main (int argc, char *argv[])
  24. {
  25.  
  26.  
  27.    // parse args
  28.    if (argc < 2)
  29.    {
  30.      DosBeep (1500, 250) ;
  31.      return -1 ;
  32.    }
  33.    else
  34.      strcpy (chImagen, argv[1]) ;
  35.  
  36.    // Load spec bmp file
  37.    if (access (argv[1], 0))
  38.      return -2 ;
  39.  
  40.    // Calling API...
  41.    rc = PMDIBDLL (chImagen, DIB_CREATE_BMP, NULL) ;
  42.  
  43.    if (rc != DIBERR_OK) {
  44.      DosBeep (3250, 250) ;
  45.      return -3 ;
  46.    }
  47.  
  48.    // delay time to allow PMDIB come out
  49.    DosSleep (5000) ;
  50.  
  51.    do {
  52.      // Call pmdib as long as its window exists
  53.      rc = PMDIBDLL (chImagen, DIB_BMP_WND_STRETCH_ON, NULL) ;
  54.  
  55.    } while (rc != DIBERR_PMDIBDLL_NOEXISTS) ;
  56.  
  57.    return 0 ;
  58.  
  59. } // main()
  60.