home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / win / prg / cenviw / iconmany.cmm < prev    next >
Text File  |  1994-11-11  |  701b  |  23 lines

  1. // IconMany.cmm - Demonstrate switching icons
  2. // ver.1
  3.  
  4. #include <Icon.lib>
  5. #include <WinTools.lib>
  6.  
  7. // find out how many icons are in Program Manager
  8. IconCount = ExtractIcon(Instance(),"PROGMAN.EXE",-1);
  9.  
  10. printf("IconMany will minimized and switch its minimized icons among\n");
  11. printf("the %d icons available in Program Manager.\n",IconCount);
  12. printf("Press any key to minimize...");
  13. getch();
  14. ShowWindow(ScreenHandle(),SW_MINIMIZE);
  15. printf("\nPress any key to exit...");
  16.  
  17. for ( IconIndex = 0; !kbhit(); IconIndex++ ) {
  18.    IconIndex = IconIndex % IconCount;
  19.    Icon = ExtractIcon(Instance(),"PROGMAN.EXE",IconIndex);
  20.    SetMyIcon(Icon);
  21.    suspend(500);   // wait 1/2 second
  22. }
  23.