Wierd...Perhaps trying a somewhat different approach will yield better results. Try changing the LoadIcon calls for the parent and child windows to this.
Code:
wc.hIcon = LoadIcon(hInstance, IDPIC);
Then in your header file (.h) add the following.
Code:
#ifdef RC_INVOKED
#define ID(id) id
#else
#define ID(id) MAKEINTRESOURCE(id)
#endif
// resource id's
#define IDPIC ID(1) // for your icon
In your resource file (.rc) add this.
Code:
#include "resource.h" // assuming your header file is called resource.h
IDPIC ICON icon1.ico // icon for parent and child windows