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. Redirecting the registy.

Redirecting the registy.

Scheduled Pinned Locked Moved C / C++ / MFC
c++windows-admintutorialquestion
5 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.
  • F Offline
    F Offline
    Fredrik
    wrote on last edited by
    #1

    Howdy! I was hoping that someone could tell me how to make my application get it's "fake" system colors (wich I define) on another place in the registry. I want to be able to redirect where my application(and mine only) gets its colors on another location in the registry. How would this be done in visual c++? And what would the code be like? Thankfull for any answers, /Fredrik

    E 1 Reply Last reply
    0
    • F Fredrik

      Howdy! I was hoping that someone could tell me how to make my application get it's "fake" system colors (wich I define) on another place in the registry. I want to be able to redirect where my application(and mine only) gets its colors on another location in the registry. How would this be done in visual c++? And what would the code be like? Thankfull for any answers, /Fredrik

      E Offline
      E Offline
      Erik Funkenbusch
      wrote on last edited by
      #2

      I don't understand what you're asking for. What do you mean by "gets it's colors"? What do you mean by "on another location in the registry"?

      F 1 Reply Last reply
      0
      • E Erik Funkenbusch

        I don't understand what you're asking for. What do you mean by "gets it's colors"? What do you mean by "on another location in the registry"?

        F Offline
        F Offline
        Fredrik
        wrote on last edited by
        #3

        The dialog window looks for what colors windows have in the registry and uses these colors to color the dialog. Thats the system colors that are located in the registry under the key: "MyComputer\HKEY_CURRENT_USER\Control Panel\Colors". These are the so called system colors, the colors the system sets for your dialog (if you don't draw it yourself). What I want to do is, I'd like my dialog window to look for it's own colors in the same kind of way, but at another location, wich I would have define. Maybe, "MyComputer\HKEY_CURRENT_USER\Software\MyProgram\Colors" where I can set the dialog window colors myself. To do this, I have to change where in the registry my dialog window looks for it's colors. Adding the necissary keys and colors is no biggie, but how do I redirect where\how the program looks for these colors?

        E 1 Reply Last reply
        0
        • F Fredrik

          The dialog window looks for what colors windows have in the registry and uses these colors to color the dialog. Thats the system colors that are located in the registry under the key: "MyComputer\HKEY_CURRENT_USER\Control Panel\Colors". These are the so called system colors, the colors the system sets for your dialog (if you don't draw it yourself). What I want to do is, I'd like my dialog window to look for it's own colors in the same kind of way, but at another location, wich I would have define. Maybe, "MyComputer\HKEY_CURRENT_USER\Software\MyProgram\Colors" where I can set the dialog window colors myself. To do this, I have to change where in the registry my dialog window looks for it's colors. Adding the necissary keys and colors is no biggie, but how do I redirect where\how the program looks for these colors?

          E Offline
          E Offline
          Erik Funkenbusch
          wrote on last edited by
          #4

          Sorry, but you simply can't do this. In order to get different colors, you have to intercept the WM_CTLCOLOR messages for each control (or control type) and for the dialog itself.

          F 1 Reply Last reply
          0
          • E Erik Funkenbusch

            Sorry, but you simply can't do this. In order to get different colors, you have to intercept the WM_CTLCOLOR messages for each control (or control type) and for the dialog itself.

            F Offline
            F Offline
            Fredrik
            wrote on last edited by
            #5

            Ah, would have been real neat though =) Ok, could you help me with intercepting the WM_CTLCOLOR messages. I've tried this but I only managed to do it with te buttons, and used SetDialogBgColor() to chandge the dialogs "view" color, but a few things remain. The color of my slider, ComboBox, the menu, the boarder (or is it called frame) of the dialog window. Thx, most thankfull for help. =) /Fredrik

            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