#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    5
    Rep Power
    0

    Lightbulb Problem\ add value As a Type [reg_dword]


    Hi all

    i need know how can add value to registry
    as type
    [reg_expand_sz] and [reg_dword]

    var R :TRegistry;
    begin
    R := TRegistry.Create;
    r.RootKey := HKEY_LOCAL_MACHINE;
    try
    if not R.OpenKey('Software\Myvalue', True) then
    RaiseLastOSError;
    R.WriteString('ValueName', 'value');
    R.WriteString('ther Value Name' ,'Some other value');
    finally R.Free;
    end;
    end.



    i swear by God two days from search I want a solution
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    5
    Rep Power
    0
    please any teacher!!!
    how can add value as a reg_dword .!!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    5
    Rep Power
    0
    can help me please
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    355
    Rep Power
    7
    Originally Posted by delphi-kid
    Hi all

    i need know how can add value to registry
    as type
    [reg_expand_sz] and [reg_dword]

    var R :TRegistry;
    begin
    R := TRegistry.Create;
    r.RootKey := HKEY_LOCAL_MACHINE;
    try
    if not R.OpenKey('Software\Myvalue', True) then
    RaiseLastOSError;
    R.WriteString('ValueName', 'value');
    R.WriteString('ther Value Name' ,'Some other value');
    finally R.Free;
    end;
    end.



    i swear by God two days from search I want a solution
    Instead of using WriteString, you should be using WriteInteger

    see here

    Comments on this post

    • delphi-kid agrees : all thanks for you , love you: all love is you.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    5
    Rep Power
    0
    Instead of using WriteString, you should be using WriteInteger see here

    thank you
    what about REG_EXPAND_SZ !!
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    355
    Rep Power
    7
    Originally Posted by delphi-kid
    thank you
    what about REG_EXPAND_SZ !!
    Sorry, missed that one,

    I believe you use

    WriteExpandString
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    5
    Rep Power
    0
    thanks again brother

    Be okay brother


IMN logo majestic logo threadwatch logo seochat tools logo