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. Create Registry Entry in Vista ...

Create Registry Entry in Vista ...

Scheduled Pinned Locked Moved C / C++ / MFC
windows-adminquestion
15 Posts 5 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.
  • M Offline
    M Offline
    Manjunath S
    wrote on last edited by
    #1

    Hi all, My Application uses RegCreateKeyEx to create a registry.This appilcation has to work in both windows XP and Vista. In windows XP it create registry successfully ,But in Vista it fails to create registry ... How do i Solve it ....

    Manjunath S GESL Bangalore

    P S M P 4 Replies Last reply
    0
    • M Manjunath S

      Hi all, My Application uses RegCreateKeyEx to create a registry.This appilcation has to work in both windows XP and Vista. In windows XP it create registry successfully ,But in Vista it fails to create registry ... How do i Solve it ....

      Manjunath S GESL Bangalore

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      Manjunath S wrote:

      But in Vista it fails to create registry ...

      Vista has lots of restrictions, dealing with registry. You may like to read UAC for that. Search for UAC on MSDN.


      Prasad MS MVP -  VC++

      M 1 Reply Last reply
      0
      • P prasad_som

        Manjunath S wrote:

        But in Vista it fails to create registry ...

        Vista has lots of restrictions, dealing with registry. You may like to read UAC for that. Search for UAC on MSDN.


        Prasad MS MVP -  VC++

        M Offline
        M Offline
        Manjunath S
        wrote on last edited by
        #3

        Thanks for your reply Any sample code available to just create a registry in windows Vista ...

        Manjunath S GESL Bangalore

        1 Reply Last reply
        0
        • M Manjunath S

          Hi all, My Application uses RegCreateKeyEx to create a registry.This appilcation has to work in both windows XP and Vista. In windows XP it create registry successfully ,But in Vista it fails to create registry ... How do i Solve it ....

          Manjunath S GESL Bangalore

          S Offline
          S Offline
          Sameer_Thakur
          wrote on last edited by
          #4

          I faced the same problem with my application. I used a manifest.xml in my application as a resource and it solved the problem. Here are the contents of that manifest.xml file. Your application description here. Call InitCommonControls() in the InitInstance() of ur application BOOL CURApp::InitInstance() { InitCommonControls(); -------------------------- ---------------------- } U can follow these steps to include manifest.xml in ur project. Once writing manifest.xml is completed, you will want to add the manifest.xml file to your project in the resource editor. In Visual Studio 6, hit Ctrl+R to add a new resource, select all files and double click manifest.xml to add the file. When you see the custom resource dialog, enter the number "24" as the resource type and hit OK. Once imported, right click on the resource to open the properties window and change the ID to the number "1". Sameer Thakur

          M 1 Reply Last reply
          0
          • S Sameer_Thakur

            I faced the same problem with my application. I used a manifest.xml in my application as a resource and it solved the problem. Here are the contents of that manifest.xml file. Your application description here. Call InitCommonControls() in the InitInstance() of ur application BOOL CURApp::InitInstance() { InitCommonControls(); -------------------------- ---------------------- } U can follow these steps to include manifest.xml in ur project. Once writing manifest.xml is completed, you will want to add the manifest.xml file to your project in the resource editor. In Visual Studio 6, hit Ctrl+R to add a new resource, select all files and double click manifest.xml to add the file. When you see the custom resource dialog, enter the number "24" as the resource type and hit OK. Once imported, right click on the resource to open the properties window and change the ID to the number "1". Sameer Thakur

            M Offline
            M Offline
            Manjunath S
            wrote on last edited by
            #5

            Thanks Sammer for ur valuable reply... Iam using Visual studio installer to install an application.In the installer i have a custom action DLL.In this DLL before installing the application i have to check the registry whetheir any entry with name same as my application name is present,if present take the path entered there, if not create a registry entry named with my applciation name.... Any tips to do above in vista ....

            Manjunath S GESL Bangalore

            S 1 Reply Last reply
            0
            • M Manjunath S

              Thanks Sammer for ur valuable reply... Iam using Visual studio installer to install an application.In the installer i have a custom action DLL.In this DLL before installing the application i have to check the registry whetheir any entry with name same as my application name is present,if present take the path entered there, if not create a registry entry named with my applciation name.... Any tips to do above in vista ....

              Manjunath S GESL Bangalore

              S Offline
              S Offline
              Sameer_Thakur
              wrote on last edited by
              #6

              Logically..... You can add that xml file as a resource in a DLL that u are using as a custom action DLL.(No need to call InitCommonControls() in that case.) By doing that ur DLL will get elevated privileges to read/write registry entries on Vista.

              Sameer Thakur

              M 1 Reply Last reply
              0
              • S Sameer_Thakur

                Logically..... You can add that xml file as a resource in a DLL that u are using as a custom action DLL.(No need to call InitCommonControls() in that case.) By doing that ur DLL will get elevated privileges to read/write registry entries on Vista.

                Sameer Thakur

                M Offline
                M Offline
                Manjunath S
                wrote on last edited by
                #7

                Hi sameer Can u tell me what actually done in this XMl... How it helps to edit registry And how Custom Dll Handles it...

                Manjunath S GESL Bangalore

                S 1 Reply Last reply
                0
                • M Manjunath S

                  Hi sameer Can u tell me what actually done in this XMl... How it helps to edit registry And how Custom Dll Handles it...

                  Manjunath S GESL Bangalore

                  S Offline
                  S Offline
                  Sameer_Thakur
                  wrote on last edited by
                  #8

                  In Vista there is a concept of User Account Control (UAC) by which it prevents any major changes in registry (though you are logged in as an Admin). To enable registry changes, we need to provide higher privileges to the application. To do this there is a tag in manifest.xml … Here we are granting the “highestAvailable” privilege to the application/DLL which ultimately grants the permission to ur application/DLL to access (Read/Write) registry. Sameer Thakur

                  M 1 Reply Last reply
                  0
                  • S Sameer_Thakur

                    In Vista there is a concept of User Account Control (UAC) by which it prevents any major changes in registry (though you are logged in as an Admin). To enable registry changes, we need to provide higher privileges to the application. To do this there is a tag in manifest.xml … Here we are granting the “highestAvailable” privilege to the application/DLL which ultimately grants the permission to ur application/DLL to access (Read/Write) registry. Sameer Thakur

                    M Offline
                    M Offline
                    Manjunath S
                    wrote on last edited by
                    #9

                    Thanks sameer I will try this and udapte ...

                    Manjunath S GESL Bangalore

                    1 Reply Last reply
                    0
                    • M Manjunath S

                      Hi all, My Application uses RegCreateKeyEx to create a registry.This appilcation has to work in both windows XP and Vista. In windows XP it create registry successfully ,But in Vista it fails to create registry ... How do i Solve it ....

                      Manjunath S GESL Bangalore

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

                      What happens on Vista? Post your code.

                      --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Dunder-Mifflin, this is Pam.

                      M 1 Reply Last reply
                      0
                      • M Manjunath S

                        Hi all, My Application uses RegCreateKeyEx to create a registry.This appilcation has to work in both windows XP and Vista. In windows XP it create registry successfully ,But in Vista it fails to create registry ... How do i Solve it ....

                        Manjunath S GESL Bangalore

                        P Offline
                        P Offline
                        Paresh Chitte
                        wrote on last edited by
                        #11

                        Please refer this[^]. Regards, Paresh.

                        M 1 Reply Last reply
                        0
                        • M Michael Dunn

                          What happens on Vista? Post your code.

                          --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Dunder-Mifflin, this is Pam.

                          M Offline
                          M Offline
                          Manjunath S
                          wrote on last edited by
                          #12

                          Hi guys, I tried with embedding the manifest.xml in my Dll as posted in the previous reply to write registry entry in windows vista. But this fails to create any effect (my Dll could not create the registry entry)

                          Manjunath S GESL Bangalore

                          M 1 Reply Last reply
                          0
                          • M Manjunath S

                            Hi guys, I tried with embedding the manifest.xml in my Dll as posted in the previous reply to write registry entry in windows vista. But this fails to create any effect (my Dll could not create the registry entry)

                            Manjunath S GESL Bangalore

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

                            The XML that specifies what execution level you want only makes sense for EXEs, not DLLs, since the execution level applies to a process as a whole.

                            --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Dunder-Mifflin, this is Pam.

                            M 1 Reply Last reply
                            0
                            • M Michael Dunn

                              The XML that specifies what execution level you want only makes sense for EXEs, not DLLs, since the execution level applies to a process as a whole.

                              --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Dunder-Mifflin, this is Pam.

                              M Offline
                              M Offline
                              Manjunath S
                              wrote on last edited by
                              #14

                              Hi Mike, How can i achieve ( writing to registry ) In vista using DLL...

                              Manjunath S GESL Bangalore

                              1 Reply Last reply
                              0
                              • P Paresh Chitte

                                Please refer this[^]. Regards, Paresh.

                                M Offline
                                M Offline
                                Manjunath S
                                wrote on last edited by
                                #15

                                HI paresh, Any sample code to writing a registry entry In vista using DLL...

                                Manjunath S GESL Bangalore

                                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