home *** CD-ROM | disk | FTP | other *** search
- /*
- CASCCHLD.C -- Uses CascadeChildWindows to cascade desktop
-
- From Chapter 6 of "Undocumented Windows" (Addison-Wesley 1992)
- by Andrew Schulman, Dave Maxey and Matt Pietrek
-
- Build using: WINIOBC CASCCHLD (for Borland C++ v3.00)
- WINIOMS CASCCHLD (for Microsoft C/SDK)
- */
-
- #include <windows.h>
- #include "winio.h"
-
- /* undocumented function - no function prototype
- because it differs between 3.0 and 3.1 */
- extern void FAR PASCAL CascadeChildWindows();
-
- #include "checkord.c"
-
- int main()
- {
- WORD wVer = (WORD) GetVersion();
-
- // Ord/name check
- if (! CheckOrdName("CascadeChildWindows", "USER", 198))
- return 0;
-
- winio_about("CASCCHLD"
- "\nUses CascadeChildWindows to cascade the desktop"
- "\n\nFrom Chapter 6 of"
- "\n\"Undocumented Windows\" (Addison-Wesley, 1992)"
- "\nby Andrew Schulman, David Maxey and Matt Pietrek"
- );
-
- winio_setecho(winio_current(), FALSE);
-
- for (;;)
- if (wVer == 0x0003)
- {
- puts("Press a key to cascade the desktop.");
- getchar();
-
- CascadeChildWindows(GetDesktopWindow());
- }
- else
- {
- puts("Press a key to cascade the desktop.");
- getchar();
-
- CascadeChildWindows(GetDesktopWindow(), 0);
- }
-
- // BCC spots the fact that logically we can't reach here -
- // Ignore the warning.
- printf("Program terminated");
- return 0;
- }
-