Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. The strange behaviour of the text.

The strange behaviour of the text.

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    daavena
    wrote on last edited by
    #1

    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.

    N 1 Reply Last reply
    0
    • D daavena

      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.

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups