Try having a second form add the icon. Maybe the function only allows one tray icon per hwnd.