home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cenvi23.zip / WINLIST.CMD < prev    next >
OS/2 REXX Batch file  |  1995-03-28  |  1KB  |  29 lines

  1. EXTPROC CEnvi2
  2. /******************************************************************
  3.  *** WinList - CEnvi2 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.