But you can try to use the "EnumEnhMetaFile" function.
In the callback you will be able to detect each single
call to SetTextColor. You should not change the contents
of the records passed to this callback. Instead you could
use SetTextColor with your own color value and omit the
standard call to PlayEnhMetaFileRecord.
While this is the key to solve your problem, it is not easy.
Color is introduced by various GDI calls. You also will
have to monitor records for CreatePen, CreateSolidBrush
etc.
Rolf
(1997 should be removed from my email address)
Christian Fürst <christi...@enator.se> wrote in article
<01bce60c$b337dcf0$420a0d93@chfu>...
>
> I'm using a 3'rd-party dll that transfers filedata to memory available to
> my application.
> I then "create a memory-based enhanced-format metafile from supplied
data"
> with SetEnhMetaFileBits(...) and can play it with PlayEnhMetaFile(...).
> Works fine.
>
> What I want to do is dynamically change the color of it once in a while.
>
> I have tried to define and ::SelectObject a HPEN before calling
> PlayEnhMetaFile(...) but the lines of the file are still black.
> I have tried to ::CreatePalette, ::SelectPalette, ::RealizePalette before
> calling PlayEnhMetaFile(...). The same result!
>
> Has anyone tried to change the color (with or without success), tell me!