home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / CENVIW9.ZIP / WINLIST.CMM < prev    next >
Text File  |  1994-03-08  |  861b  |  30 lines

  1. //**************************************************
  2. //*** WinList.cmm  Display a list of all windows ***
  3. //*** ver.1        and all their child windows   ***
  4. //**************************************************
  5.  
  6. #include <Window.lib>
  7. #include <WinTools.lib>
  8.  
  9. ShowWindowAndChildren(0,GetDesktopWindow());
  10.  
  11. ShowWindowAndChildren(ChildDepth,ParentHandle)
  12. {
  13.    printf("\n%*d",7 * ChildDepth,ParentHandle);
  14.    if ( Title = GetWindowTitle(ParentHandle) )
  15.       printf("   %s",Title);
  16.  
  17.    // Do this same routine for each child window of this window
  18.    for ( ChildWindow = GetWindow(ParentHandle,GW_CHILD); ChildWindow;
  19.          ChildWindow = GetWindow(ChildWindow,GW_HWNDNEXT) )
  20.       ShowWindowAndChildren(ChildDepth+1,ChildWindow);
  21. }
  22.  
  23. GetDesktopWindow()
  24. {
  25.    return DynamicLink("USER","GETDESKTOPWINDOW",UWORD16,PASCAL);
  26. }
  27.  
  28. getch();
  29.  
  30.