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