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. Handling WM_NCPAINT

Handling WM_NCPAINT

Scheduled Pinned Locked Moved C / C++ / MFC
helpcom
4 Posts 3 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.
  • N Offline
    N Offline
    Naveen
    wrote on last edited by
    #1

    Hi, I have some problem in handing the WM_NCPAINT. As per MSDN, the dc with the region clipped can be obtained as follows for handling the WM_NCPAINT. case WM_NCPAINT: { HDC hdc = GetDCEx(hwnd, (HRGN)wParam, DCX_WINDOW|DCX_INTERSECTRGN); } But when I tried this am getting hdc as NULL. Any solution for this issue. N.B - I tried using the DCX_CACHE flag in the GetDCEx() function. Eventhough in this case it returned a dc handle, the clipping is not proper. Thanks Naveen [OpenedFileFinder]

    A M 2 Replies Last reply
    0
    • N Naveen

      Hi, I have some problem in handing the WM_NCPAINT. As per MSDN, the dc with the region clipped can be obtained as follows for handling the WM_NCPAINT. case WM_NCPAINT: { HDC hdc = GetDCEx(hwnd, (HRGN)wParam, DCX_WINDOW|DCX_INTERSECTRGN); } But when I tried this am getting hdc as NULL. Any solution for this issue. N.B - I tried using the DCX_CACHE flag in the GetDCEx() function. Eventhough in this case it returned a dc handle, the clipping is not proper. Thanks Naveen [OpenedFileFinder]

      A Offline
      A Offline
      Akt_4_U
      wrote on last edited by
      #2

      Can u use GetClipBox API?

      akt

      1 Reply Last reply
      0
      • N Naveen

        Hi, I have some problem in handing the WM_NCPAINT. As per MSDN, the dc with the region clipped can be obtained as follows for handling the WM_NCPAINT. case WM_NCPAINT: { HDC hdc = GetDCEx(hwnd, (HRGN)wParam, DCX_WINDOW|DCX_INTERSECTRGN); } But when I tried this am getting hdc as NULL. Any solution for this issue. N.B - I tried using the DCX_CACHE flag in the GetDCEx() function. Eventhough in this case it returned a dc handle, the clipping is not proper. Thanks Naveen [OpenedFileFinder]

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        Is wParam == 1 when GetDXEx() fails? If not, try calling GetLastError() when it fails and see what the error code is. Mark

        "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

        N 1 Reply Last reply
        0
        • M Mark Salsbery

          Is wParam == 1 when GetDXEx() fails? If not, try calling GetLastError() when it fails and see what the error code is. Mark

          "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

          N Offline
          N Offline
          Naveen
          wrote on last edited by
          #4

          its now ok Mark. When I specified the DCX_PARENTCLIP flag it working fine also cliping is proper.

          nave [OpenedFileFinder]

          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