The strange behaviour of the text.
-
Hello gentlemen, I am drawing text directly onto the desktop-I am using hooks. I am capturing these messages from desktop - WM_ERASEBKGND and WM_PAINT and this is the drawing function: DrawText(hdc, pszText, strlen(pszText), &rcWindow, DT_RIGHT); Everythink is working fine - I see text on the desktop. But if I move with a window(which is currently open/active) the text will get bold. Even if I click on the desktop the text on the desktop will get bold. But if I hit F5 and the desktop is active - the text is normal. Can you give me a hind, what I am doing wrong? Thank you.
-
Hello gentlemen, I am drawing text directly onto the desktop-I am using hooks. I am capturing these messages from desktop - WM_ERASEBKGND and WM_PAINT and this is the drawing function: DrawText(hdc, pszText, strlen(pszText), &rcWindow, DT_RIGHT); Everythink is working fine - I see text on the desktop. But if I move with a window(which is currently open/active) the text will get bold. Even if I click on the desktop the text on the desktop will get bold. But if I hit F5 and the desktop is active - the text is normal. Can you give me a hind, what I am doing wrong? Thank you.
daavena wrote:
But if I move with a window(which is currently open/active) the text will get bold. Even if I click on the desktop the text on the desktop will get bold. But if I hit F5 and the desktop is active - the text is normal. Can you give me a hind, what I am doing wrong?
This happens if you have a wrong font selected into your dc (the one used for hdc). Also make sure the font object has a valid life time.
Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com