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. Problem handling WM_NCPAINT using XP visual style

Problem handling WM_NCPAINT using XP visual style

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
3 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.
  • K Offline
    K Offline
    khb
    wrote on last edited by
    #1

    Hi! I wrote an application where I draw an additional button to the caption of a dialog. This works perfectly for all versions of windows, even for XP when the "classic style" is used. But, if I select an XP theme, I run into a problem: When I handle the WM_NCPAINT message, the caption of the dialog (and also the frame) is not drawn using the corresponding visual style, it is drawn in "classic style"! This looks really ugly. My SDK is up to date. I tried it with and without a manifest file, it makes no difference. I develop the code under win2k, using vc6. Maybe this is the problem: does anybody know, if this works correctly with vc7? If anybody has an idea how to solve this problem, please help. I've been trying it for two weeks now any I'm out of ideas... X| Thanks in advance, Marcus.

    M 1 Reply Last reply
    0
    • K khb

      Hi! I wrote an application where I draw an additional button to the caption of a dialog. This works perfectly for all versions of windows, even for XP when the "classic style" is used. But, if I select an XP theme, I run into a problem: When I handle the WM_NCPAINT message, the caption of the dialog (and also the frame) is not drawn using the corresponding visual style, it is drawn in "classic style"! This looks really ugly. My SDK is up to date. I tried it with and without a manifest file, it makes no difference. I develop the code under win2k, using vc6. Maybe this is the problem: does anybody know, if this works correctly with vc7? If anybody has an idea how to solve this problem, please help. I've been trying it for two weeks now any I'm out of ideas... X| Thanks in advance, Marcus.

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      AFAICT this is By Design(tm). Since themes change the look of the non-client area, when an app handles WM_NCPAINT (also to change the look of the non-client area), XP turns off the theme so the app's own painting takes precedence. Look at RealPlayer 8 for another example. --Mike-- "Big handwavy generalizations made from a position of deep ignorance is one of the biggest wastes of time on the net today. -- Joel Spolsky Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber

      K 1 Reply Last reply
      0
      • M Michael Dunn

        AFAICT this is By Design(tm). Since themes change the look of the non-client area, when an app handles WM_NCPAINT (also to change the look of the non-client area), XP turns off the theme so the app's own painting takes precedence. Look at RealPlayer 8 for another example. --Mike-- "Big handwavy generalizations made from a position of deep ignorance is one of the biggest wastes of time on the net today. -- Joel Spolsky Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber

        K Offline
        K Offline
        khb
        wrote on last edited by
        #3

        Thank you for the answer, Mike. Is it possible, to draw the nonclient area by hand using the correct theme? I know that I can use GetSystemMetrics() to get all dimensions I need. I also know that I can load the theme elements from the uxtheme.dll. But, I'm not sure how to apply them to the window. Do you know how to do that? Any code fragments, links to descriptions or articles would help, too. Thanks again, Marcus.

        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