/* ** hIcon = some icon ** hIcon = ohyeah(hIcon,0) */ HICON ohyeah(HICON hIcon, int value) { //HICON dupicon; static HICON dupicon; //dupicon = DuplicateIcon(NULL, hIcon); dupicon = CopyIcon(hIcon); DestroyIcon(hIcon); hIcon = dupicon; Beep(880,20); printf("dupicon = %d\n",dupicon); return dupicon; } /* ** Without destroyicon dupicon = new address each time the function is called... ** with destroyicon dupicon = null after the first loop... */