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. Painting with win32.

Painting with win32.

Scheduled Pinned Locked Moved C / C++ / MFC
csharpgraphicsjsontutorial
6 Posts 4 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.
  • S Offline
    S Offline
    Steve_
    wrote on last edited by
    #1

    Hi, Are there functions available in the windows api that will paint windows controls to a certain rectangle using GDI. Something similar to the ControlPaint class in .NET. If there are, can someone point me to the documentation that details how to use them. Thanks Steve

    M 1 Reply Last reply
    0
    • S Steve_

      Hi, Are there functions available in the windows api that will paint windows controls to a certain rectangle using GDI. Something similar to the ControlPaint class in .NET. If there are, can someone point me to the documentation that details how to use them. Thanks Steve

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

      If the control handles WM_PRINTCLIENT, you can send it that message to have it paint into a DC.

      --Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ I work for Keyser Söze

      S C 2 Replies Last reply
      0
      • M Michael Dunn

        If the control handles WM_PRINTCLIENT, you can send it that message to have it paint into a DC.

        --Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ I work for Keyser Söze

        S Offline
        S Offline
        Steve_
        wrote on last edited by
        #3

        I don't have an instance of a control. All I want to do, is call some routine that will paint me a button to a specified DC, like the ButtonRenderer.DrawButton method for the .NET framework. This allows you to pass an arbitrary Graphics object and some state information and it will draw a button using windows styles to it without needing an instance of Button.

        C L 2 Replies Last reply
        0
        • M Michael Dunn

          If the control handles WM_PRINTCLIENT, you can send it that message to have it paint into a DC.

          --Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ I work for Keyser Söze

          C Offline
          C Offline
          Code o mat
          wrote on last edited by
          #4

          How can you specify a rectangle for WM_PRINTCLIENT?

          > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

          1 Reply Last reply
          0
          • S Steve_

            I don't have an instance of a control. All I want to do, is call some routine that will paint me a button to a specified DC, like the ButtonRenderer.DrawButton method for the .NET framework. This allows you to pass an arbitrary Graphics object and some state information and it will draw a button using windows styles to it without needing an instance of Button.

            C Offline
            C Offline
            Code o mat
            wrote on last edited by
            #5

            Have a look at OpenThemeData[^], DrawThemeBackground[^] and related methods, but note that these only work under Windows XP (and i supose above) with themes enabled, so it might not be enough for your needs.

            > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

            1 Reply Last reply
            0
            • S Steve_

              I don't have an instance of a control. All I want to do, is call some routine that will paint me a button to a specified DC, like the ButtonRenderer.DrawButton method for the .NET framework. This allows you to pass an arbitrary Graphics object and some state information and it will draw a button using windows styles to it without needing an instance of Button.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              If you don't care about having a window theme you can use CDC::DrawFrameControl[^]. If you want the visual style associated with the current theme then use the solution code-O-matic provided. Best Wishes, -David Delaune

              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