Jump to content

regread "" values


 Share

Recommended Posts

I use this func for the registy writing

Func _Rw($key,$dst="",$type="",$val="")
    $a=RegWrite($key,$dst,$type,$val)
    MsgBox(0,$a,@error);
    Return string($a)
EndFunc

I use it with

Call("_Rw","HKEY_LOCAL_MACHINE\SOFTWARE\aaa")

The key is created but it returns @error=0 and returns 0

I've already written about "" values in some Reg* functions that return unusual values but with no helpful answers....

Link to comment
Share on other sites

$result = _Rw("HKEY_LOCAL_MACHINE\SOFTWARE\aaa","","REG_SZ")
MsgBox(0,"","@ERROR: " & @ERROR & @CRLF & "$Result: " & $Result)

Func _Rw($key,$dst="",$type="",$val="")
    $a=RegWrite($key,$dst,$type,$val)
    Return SetError(@ERROR,0,$a)
EndFunc

Link to comment
Share on other sites

To Write, you always have to specify the type of the value.

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

If you wnat to create a Key without a value, you must not specify any further params!

$result = _Rw("HKEY_LOCAL_MACHINE\SOFTWARE\aaa")
MsgBox(0,"","@ERROR: " & @ERROR & @CRLF & "$Result: " & $Result)
Func _Rw($key,$dst="",$type="",$val="")
    Switch @NumParams
        Case 1
            Local $a=RegWrite($key)
                Return SetError(@ERROR,0,$a)
        Case Else
            Local $a=RegWrite($key,$dst,$type,$val)
                Return SetError(@ERROR,0,$a)
    EndSwitch
EndFunc

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...