home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol11n15.zip / GETCLIP.C < prev    next >
C/C++ Source or Header  |  1992-05-16  |  507b  |  28 lines

  1. /* GETCLIP.C -- get text from Windows clipboard */
  2.  
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. #include <string.h>
  6. #include "winclip.h"
  7.  
  8. void fail(char *s) { puts(s); exit(1); }
  9.  
  10. int main(void)
  11. {
  12.     char *s;
  13.     
  14.     if (! WindowsClipboard())
  15.          fail("This program must run in a DOS box "
  16.           "under Enhanced mode Windows");
  17.  
  18.     if (s = GetClipString())
  19.     {
  20.         puts(s);
  21.         FreeClipString(s);
  22.     }
  23.     else
  24.         puts("* clipboard empty *");
  25.     return 0;
  26. }
  27.  
  28.