IOleObject in old style
I have got a code snippet that uses IOleObjects and calls the method "SetClientSite".
pIOleObject.SetClientSite(this);
Now my problem is that the button is shown in an old Windows style, it is flat and there is no Aero effect. I guess I have to call "SetColorScheme", but I do not know how to use LOGPALETTE. I just need these IOleObjects for a webbrowser control in a trusted S开发者_运维百科ecurity Zone. Maybe someone can help, thanks.
Your OLE control is getting its style choice from its host application. You need to use an ID2 Win32 Manifest to create an activation context, assert that activation context on entry to each of your OLE methods, and ensure your control is windowed rather than windowless so that it gets your theme.
Alternatively, if the host exe is also under your control, just use an ID1 Win32 manifest to make themed controls the default process-wide.
http://msdn.microsoft.com/en-us/library/bb773175.aspx
Martyn
精彩评论