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. OnCtlColor

OnCtlColor

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsperformancehelpquestion
5 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.
  • S Offline
    S Offline
    sudheee
    wrote on last edited by
    #1

    what is the purpose of OnCtlColor i have used one brush in onctlcolor and i am returning the handle of that brush. cos of that GDI objects(can see in task manager) are going on increasing and memory usage is also increasing. if i comment that brush everything is ok.. nothing is increasing. but in my application i must use that brush to draw the whole application. can anyone give me solution to solve that problem

    regards sudhakar

    K A 2 Replies Last reply
    0
    • S sudheee

      what is the purpose of OnCtlColor i have used one brush in onctlcolor and i am returning the handle of that brush. cos of that GDI objects(can see in task manager) are going on increasing and memory usage is also increasing. if i comment that brush everything is ok.. nothing is increasing. but in my application i must use that brush to draw the whole application. can anyone give me solution to solve that problem

      regards sudhakar

      K Offline
      K Offline
      KarstenK
      wrote on last edited by
      #2

      make the brush a member of your Window class! what is the purpose of OnCtlColor=> RTFM

      Greetings from Germany

      S 1 Reply Last reply
      0
      • K KarstenK

        make the brush a member of your Window class! what is the purpose of OnCtlColor=> RTFM

        Greetings from Germany

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

        i need to change the color of the the entire dialog not only the controls on that dialog.

        regards sudhakar

        K 1 Reply Last reply
        0
        • S sudheee

          i need to change the color of the the entire dialog not only the controls on that dialog.

          regards sudhakar

          K Offline
          K Offline
          KarstenK
          wrote on last edited by
          #4

          The background can you paint in OnEraseBkgnd() :zzz:

          Greetings from Germany

          1 Reply Last reply
          0
          • S sudheee

            what is the purpose of OnCtlColor i have used one brush in onctlcolor and i am returning the handle of that brush. cos of that GDI objects(can see in task manager) are going on increasing and memory usage is also increasing. if i comment that brush everything is ok.. nothing is increasing. but in my application i must use that brush to draw the whole application. can anyone give me solution to solve that problem

            regards sudhakar

            A Offline
            A Offline
            alias_rizwan
            wrote on last edited by
            #5

            I guess you are creating a new brush in every time in OnCtlColor function. if yes a simple solution would be to 1>make the brush object as a memeber of a classs 2>create thebrush object only once say in the constructor. 3>return the same handle every time in the function. 4>delete the object in the destructor. Thanks Rizwan

            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