TaskFolder.RegisterTaskDefinition method - Win32 apps | Microsoft Docs

Not sure if this helps but read at the bottom regarding return value.