Jump to content

Recommended Posts

Posted

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....

Posted

$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

Posted

result=0

and at the same time error=0

but only when it's called with 1 argument,

so, by default, the other values are ""

In the help file:

To access the (Default) value use "" (a blank string) for the valuename.

but it returns 0 and error 0 :P
Posted

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

Posted

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

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
×
×
  • Create New...