Results 1 to 2 of 2

Thread: Put value in the registry

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    England
    Posts
    94

    Put value in the registry

    Hey Guys

    I have just made an installer for an application i have finished writing. This installer needs to right a value in the registry for a default file type. What would be the quickest way.

    the value has to go into HKEY_LOCAL_MACHINE\SYSTEM\CLASSES\Signedfile\DefaultIcon\

    the location of the icon goes into the default value of the DefaultIcon key.

    Cheers
    Peter
    "Let's all join forces, rule with an iron hand...and prove to all the world, metal rules the land..."
    -- Judas Priest

    My email is [email protected]

  2. #2
    jim mcnamara
    Guest
    Code:
            char *keyvalue;
            long result,ret;
            char *val = "REG_DWORD";
            RegCreateKeyEx (HKEY_LOCAL_MACHINE, keyvalue, 0L,  
              val, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 
               0L, Result, Ret);
            if (Result == 0) {
                printf("Error while creating the Key!!");
                exit(EXIT_FAILURE);
           }
    Use RegCreateKeyEx because it looks up the key, if no key then adds it. This what you need?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width