home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l350 / 3.ddi / EXAMPLES / WINDOWS / GETCLIP.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-29  |  495 b   |  28 lines

  1. /* 
  2. GETCLIP.C -- get text from Windows clipboard
  3. */ 
  4.  
  5. #include <stdlib.h> 
  6. #include <stdio.h> 
  7. #include <string.h> 
  8. #include "winclip.h" 
  9.  
  10. void fail(char *s) { puts(s); exit(1); } 
  11.  
  12. int main(void) 
  13.     char *s; 
  14.     int maj, min; 
  15.      
  16.     if (! WinOldApVersion(&maj, &min)) 
  17.         fail("This program requires Windows Enhanced mode"); 
  18.  
  19.     if ((s = GetClipString()) != NULL)
  20.     { 
  21.         puts(s); 
  22.         FreeClipString(s); 
  23.     } 
  24.     
  25.     return 0;
  26.