See the question and my original answer on StackOverflow

You can't call Explorer API on a 64-bit OS from a 32-bit process and expect 64-bit information back (and the reverse).

So, your code compiled as 32-bit works only with 32-bit only control panel extensions (on my 64bit Windows, I have 'Java', 'Flash Player', 'Quick Time' and 'Mail' for example), but not for 64-bit extensions (which is the vast majority on a 64-bit installation, and especially for Windows-provided ones).

What's strange though is it seems to work, where it shoulnd't at all IMHO.

Anyway, to fix your issue, just compile it for 64-bit (x64).