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. DWORD registry values...

DWORD registry values...

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

    RegSetValueEx(SubKey3,"ValueName",0,REG_DWORD,?,?); I know it's supposed to look kinda like this, but I can't figure out how to properly set those last two variables. I don't have any trouble with String values, but for some reason, I just can't seem to make DWORDs work for me. halblonious

    D 1 Reply Last reply
    0
    • H halblonious

      RegSetValueEx(SubKey3,"ValueName",0,REG_DWORD,?,?); I know it's supposed to look kinda like this, but I can't figure out how to properly set those last two variables. I don't have any trouble with String values, but for some reason, I just can't seem to make DWORDs work for me. halblonious

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Straight from MSDN:

      HKEY hk;
      DWORD dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE;

      RegSetValueEx(hk, // subkey handle
      "TypesSupported", // value name
      0, // must be zero
      REG_DWORD, // value type
      (LPBYTE) &dwData, // pointer to value data
      sizeof(DWORD)); // length of value data


      Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

      H 1 Reply Last reply
      0
      • D David Crow

        Straight from MSDN:

        HKEY hk;
        DWORD dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE;

        RegSetValueEx(hk, // subkey handle
        "TypesSupported", // value name
        0, // must be zero
        REG_DWORD, // value type
        (LPBYTE) &dwData, // pointer to value data
        sizeof(DWORD)); // length of value data


        Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

        H Offline
        H Offline
        halblonious
        wrote on last edited by
        #3

        Sweet! It works! It seems so simple now that you've told me. Hehe...I'm a dummy. Thanks a ton! halblonious

        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