ITrayNotify interface not working when Windows 7 process is elevated ("Class not registered")
<p>I need to use the (undocumented) ITrayNotify interface.
It's working fine when run as a normal/UAC-restricted process in Windows 7. 
However, when I run it elevated ("Run as Administrator") the CoCreateInstance call returns <code>-2147221164 = $80040154 = REGDB_E_CLASSNOTREG = "Class not registered"</code>.
I've tested it on 4 different Windows 7 systems with the same result. It's the same for x64 and x86.</p>

<p>How is this possible?
Is this interface blocked for elevated processes? Is there a workaround for that?</p>

<p>For what it matters, heres the relevant part of the code. It's in Delphi, but I don't think that's relevant, since it works fine non-elevated.</p>

<pre><code>classGuid := StringToGUID('{25DEAD04-1EAC-4911-9E3A-AD0A4AB560FD}');
interfaceGuid := StringToGUID('{FB852B2C-6BAD-4605-9551-F15F87830935}');
result := CoCreateInstance(classGuid, nil, CLSCTX_LOCAL_SERVER, interfaceGuid, trayNotify);
</code></pre>

<p><strong>Edit/Notice:</strong> The problem isn't present in Windows 10 or 8. The interface is slightly different there and it works fine both elevated and non-elevated. The problem only applies to Windows 7 (don't know about Vista, not relevant for XP).</p>