home *** CD-ROM | disk | FTP | other *** search
/ HomeWare 14 / HOMEWARE14.bin / os2 / cenv2_19.arj / WINLIST.CMD < prev    next >
OS/2 REXX Batch file  |  1994-03-08  |  1KB  |  29 lines

  1. EXTPROC CEnvi
  2. /******************************************************************
  3.  *** WinList - CEnvi program to display all windows that may be ***
  4.  *** ver.1     switched to.                                     ***
  5.  ******************************************************************/
  6.  
  7. #include <PMdll.lib>
  8. #include <WinTools.lib>
  9.  
  10. // create list of switchable windows
  11. SwitchList = WinQuerySwitchList(Info().hab);
  12. assert( SwitchList != NULL );
  13.  
  14. SwitchCount = 1 + GetArraySpan(SwitchList);
  15.  
  16. printf("Switch  Proc  Sess  WinHndl   Switch-Title/Window-Title\n");
  17. printf("------  ----  ----  --------  ----------------\n");
  18.  
  19. for ( i = 0; i < SwitchCount; i++ ) {
  20.    printf(" %-8d",SwitchList[i]);
  21.    if ( 0 == WinQuerySwitchEntry(SwitchList[i],SwEntry) ) {
  22.       printf("%-6d%-5d%-10X%s",SwEntry.process,SwEntry.session,SwEntry.hwnd,SwEntry.title);
  23.       if ( (FullTitle = GetWindowTitle(SwEntry.hwnd)) )
  24.          printf("\n                            / %s",FullTitle);
  25.    }
  26.    printf("\n");
  27. }
  28.  
  29.