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. Windows API
  4. RegSetValueEx in Vista

RegSetValueEx in Vista

Scheduled Pinned Locked Moved Windows API
windows-adminhelptutorialquestion
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.
  • Y Offline
    Y Offline
    Yashusid
    wrote on last edited by
    #1

    i am writing a key data in registry by, lRetCode=RegSetValueEx(hDckey,sourceName,0,REG_SZ, (LPBYTE)RegFile, (DWORD) (_tcslen(RegFile)+1)*sizeof(TCHAR)); It didn't write value sourceName in registry, then i changed the "Privilege level" to "Run this program as administrator", now it writes this data. How to do this programmatically ? and i have some "cout" statements but they are not displaying to the console...what settings do i need for this ? please help me...

    M 1 Reply Last reply
    0
    • Y Yashusid

      i am writing a key data in registry by, lRetCode=RegSetValueEx(hDckey,sourceName,0,REG_SZ, (LPBYTE)RegFile, (DWORD) (_tcslen(RegFile)+1)*sizeof(TCHAR)); It didn't write value sourceName in registry, then i changed the "Privilege level" to "Run this program as administrator", now it writes this data. How to do this programmatically ? and i have some "cout" statements but they are not displaying to the console...what settings do i need for this ? please help me...

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

      Yashusid wrote:

      It didn't write value sourceName in registry, then i changed the "Privilege level" to "Run this program as administrator", now it writes this data.

      What reg key are you trying to write to? You're trying to write to a key that a non-admin doesn't have permission to write to.

      --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

      Y 1 Reply Last reply
      0
      • M Michael Dunn

        Yashusid wrote:

        It didn't write value sourceName in registry, then i changed the "Privilege level" to "Run this program as administrator", now it writes this data.

        What reg key are you trying to write to? You're trying to write to a key that a non-admin doesn't have permission to write to.

        --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

        Y Offline
        Y Offline
        Yashusid
        wrote on last edited by
        #3

        i am writing to "HKLM\SOFTWARE\Test\Myprogram"

        J 1 Reply Last reply
        0
        • Y Yashusid

          i am writing to "HKLM\SOFTWARE\Test\Myprogram"

          J Offline
          J Offline
          Jonathan Darka
          wrote on last edited by
          #4

          See here Re: Registry read operation fails on Vista. regards,


          Jonathan Wilkes Darka[Xanya.net]

          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