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

  1. // PGroups.cmm - CEnvi file to demonstrate ProgMan.lib by displaying all
  2. // ver.1         Groups and items within the groups
  3.  
  4. #include <ProgMan.lib>
  5.  
  6. if ( !ConnectToProgman() ) {
  7.    printf("\aError. Program Manager does not appear to be running.\n"
  8.           "Cannot create a DDE link to Program Manager.\n"
  9.           "Press any key to exit...");
  10.    exit(EXIT_FAILURE);
  11. }
  12.  
  13. if ( !ProgmanGroups(GroupList,GroupCount) )
  14.    printf("\a\nNo Groups returned.\n");
  15. else {
  16.    for ( g = 0; g < GroupCount; g++ ) {
  17.       if ( !ProgmanGroupItems(GroupList[g],GroupInfo,ItemList) )
  18.          printf("\aItem list failure for group \"%s\".\n",GroupList[g]);
  19.       else {
  20.          printf("\nGroup: %s   Path: %s   Count %d   State %d\n",
  21.                 GroupInfo.Name,GroupInfo.Path,GroupInfo.Count,GroupInfo.State);
  22.          for ( i = 0; i < GroupInfo.Count; i++ ) {
  23.             d = ItemList[i];
  24.             printf("\n  Item Description: \"%s\"\n",d.description);
  25.             printf("     Working Directory: \"%s\"\n",d.WorkingDirectory);
  26.             printf("     Icon File, ID: \"%s\", %d\n",d.IconFile,d.IconID);
  27.             printf("     Col, Row: %d, %d\n",d.Col,d.Row);
  28.             printf("     Shortcut Key = %04X\n",d.ShortcutKey);
  29.             printf("     Run State = %s\n",d.RunMinimized ? "MINIMIZED" : "NORMAL" );
  30.          }
  31.       }
  32.    }
  33. }
  34.  
  35. CloseProgmanConnection();
  36.  
  37. printf("\nPress any key to exit...");
  38. getch();
  39.  
  40.