get registry value - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

get registry value

right - I have the directory to my app stored in

HKEY_CURRENT_USER/ Software/myAppName


name= (default)


how do I read it? I've tried searching the RegGetValue but couldn't get it to work/ understand how it works.

Comments

  • carlycarly Posts: 46Member

    : how do I read it? I've tried searching the RegGetValue but couldn't
    : get it to work/ understand how it works.

    Just copy MSDN samples and it works in 2 seconds
    or see adv. win32 api forum,
    news://194.177.96.26/comp.os.ms-windows.programmer.win32
    where it has been given hundreds of times...


  • BitByBit_ThorBitByBit_Thor Posts: 2,444Member
    :
    : : how do I read it? I've tried searching the RegGetValue but couldn't
    : : get it to work/ understand how it works.
    :
    : Just copy MSDN samples and it works in 2 seconds
    : or see adv. win32 api forum,
    : news://194.177.96.26/comp.os.ms-windows.programmer.win32
    : where it has been given hundreds of times...
    :
    :
    :

    To add a little bit of descriptive text to help you oversee how the registry works:
    You need to Open the keys first. Then you can modify the Values of an open key, enumerate them, and also enumerate the sub-keys of your open key.
    Don't forget to close all the open handles (open keys) when you're done with them.
    MSDN is your friend. Look for RegOpenKeyEx and/or RegCreateKeyEx for opening the key (http://msdn.microsoft.com/en-us/library/ms724897(VS.85).aspx)
    RegCloseKey is used to close the key
    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • FlamingkatFlamingkat Posts: 5Member
    :
    : : how do I read it? I've tried searching the RegGetValue but couldn't
    : : get it to work/ understand how it works.
    :
    : Just copy MSDN samples and it works in 2 seconds
    : or see adv. win32 api forum,
    : news://194.177.96.26/comp.os.ms-windows.programmer.win32
    : where it has been given hundreds of times...
    :
    :
    :
    HKEY key;
    RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\Microsoft\Windows\CurrentVersion\Run",0,KEY_QUERY_VALUE,&hKey );

    After reading the key, put it into a variable to hold.

  • meghapmeghap Posts: 2Member
    Hi,
    How can I call below function for remote machine?

    HKEY key;
    RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\Microsoft\Windows\CurrentVersion\Run",0,KEY_QUERY_VALUE,&hKey );

    Thanks,
    Megha
    : :
    : : : how do I read it? I've tried searching the RegGetValue but couldn't
    : : : get it to work/ understand how it works.
    : :
    : : Just copy MSDN samples and it works in 2 seconds
    : : or see adv. win32 api forum,
    : : news://194.177.96.26/comp.os.ms-windows.programmer.win32
    : : where it has been given hundreds of times...
    : :
    : :
    : :
    : HKEY key;
    : RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\Microsoft\Windows\Curren
    : tVersion\Run",0,KEY_QUERY_VALUE,&hKey );
    :
    : After reading the key, put it into a variable to hold.
    :
    :

Sign In or Register to comment.