Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Posts
    57

    Registry DoesValueExist

    Hi. I've been searching for about a day to find how i could tell my program to look for a specific Value in the registry and do an action when it finds it.

    But i have a problem. the function DoesKeyExist is working well with keys, but i don't know what to do for values. I don't want to look for a value's value, but only the name of the value.

    I thought i could then use GetValueNames, but i'd like to know how to search for one specific value in the table it returns.

    Thank you.

  2. #2
    Join Date
    Jul 2006
    Posts
    57
    Ok... i've worked that out, but i suggest a new registry option that would allow such search.

    Here's what i did:

    names = Registry.GetValueNames(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run ");

    names_str = Table.Concat(names, "-", 1, TABLE_ALL);

    result = String.Find(names_str, "Ange", 1, true);

    if result >= 0 then

    Dialog.Message("Notice", "oui", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

    else

    Dialog.Message("Notice", "non", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

    end

    Could i have it done it differently ?

  3. #3
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    Try this...


    Code:
    Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Specific Value", true);
    if Application.GetLastError() == 0 then
      Dialog.Message("Notice", "Registry value 'Specific Value' does exist", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    else
      Dialog.Message("Notice", "Registry value 'Specific Value' does NOT exist", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    end

Similar Threads

  1. Using registry for bookmarking
    By AXXESS in forum AutoPlay Media Studio 5.0
    Replies: 12
    Last Post: 11-01-2004, 09:22 AM
  2. HOWTO: Merge Registry Keys
    By Desmond in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-17-2003, 09:31 AM
  3. Registry Features
    By Dwayne in forum Setup Factory 6.0
    Replies: 1
    Last Post: 02-21-2003, 03:30 AM
  4. INFO: Finding Shell Folders in the Registry
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-10-2002, 03:52 PM
  5. HOWTO: Merge REG Files with the Registry
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 09-23-2002, 02:48 PM

Posting Permissions

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