home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l430 / 1.ddi / CHAP6.ZIP / CASCCHLD.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.5 KB  |  58 lines

  1. /*
  2.     CASCCHLD.C -- Uses CascadeChildWindows to cascade desktop
  3.  
  4.     From Chapter 6 of "Undocumented Windows" (Addison-Wesley 1992)
  5.     by Andrew Schulman, Dave Maxey and Matt Pietrek
  6.  
  7.     Build using: WINIOBC CASCCHLD (for Borland C++ v3.00)
  8.                  WINIOMS CASCCHLD (for Microsoft C/SDK)
  9. */
  10.  
  11. #include <windows.h> 
  12. #include "winio.h" 
  13.  
  14. /* undocumented function - no function prototype
  15.    because it differs between 3.0 and 3.1 */
  16. extern void FAR PASCAL CascadeChildWindows();
  17.  
  18. #include "checkord.c"
  19.  
  20. int main() 
  21.     {
  22.     WORD wVer = (WORD) GetVersion();
  23.     
  24.     // Ord/name check
  25.     if (! CheckOrdName("CascadeChildWindows", "USER", 198))
  26.         return 0;
  27.  
  28.     winio_about("CASCCHLD"
  29.         "\nUses CascadeChildWindows to cascade the desktop"
  30.         "\n\nFrom Chapter 6 of"
  31.         "\n\"Undocumented Windows\" (Addison-Wesley, 1992)"
  32.         "\nby Andrew Schulman, David Maxey and Matt Pietrek"
  33.         );
  34.  
  35.     winio_setecho(winio_current(), FALSE);
  36.     
  37.     for (;;)
  38.         if (wVer == 0x0003)
  39.             {
  40.             puts("Press a key to cascade the desktop.");
  41.             getchar();
  42.     
  43.             CascadeChildWindows(GetDesktopWindow());
  44.             }
  45.         else
  46.             {
  47.             puts("Press a key to cascade the desktop.");
  48.             getchar();
  49.     
  50.             CascadeChildWindows(GetDesktopWindow(), 0);
  51.             }
  52.     
  53.     // BCC spots the fact that logically we can't reach here -
  54.     // Ignore the warning.
  55.     printf("Program terminated");
  56.     return 0;
  57.     }
  58.