Jump to content
Sign in to follow this  
Jon

AutoIt v3.3.13.11 Beta

Recommended Posts

Jon

File Name: AutoIt v3.3.13.11 Beta

File Submitter: Jon

File Submitted: 27 Jul 2014

File Category: Beta



3.3.13.11 (27th July, 2014) (Beta)
AutoIt:
- Added #2346: FileSetEnd().

- Fixed #2372: Incorrect line number given on a bad function call. (Still issues with Callback line errors).
- Fixed #2805: FileWriteLine() was not returning a failure when disk was full.
- Fixed #2623: RegDelete() returning 0 rather than 2 when a key exists but no write permissions to delete it.
- Fixed #2813: Accessing "last created control" once GUI deleted caused a hard crash.
- Fixed #2640: Odd conversion of strings containing numbers in expressions.

AutoItX:
- Fixed #2694: ControlListView not finding controls in x64 mode.



Click here to download this file

  • Like 4

Share this post


Link to post
Share on other sites
jchd

Thanks for #2640.

Minor detail:

ConsoleWrite(VarGetType("17" ^ 1) & @CRLF)

converts into an Int64

But I promise not arguing (again) about the case below

ConsoleWrite(VarGetType("17" / 1) & @CRLF)
 


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
FaridAgl

Jon, something is wrong with releasing DllStruct's allocated memory which causes memory leak.

Run the following snippet with the latest Beta and check the memory usage of its process:

#include <WinAPI.au3>

For $i = 1 To 10000
    _WinAPI_GlobalMemoryStatus() ;A function which uses DllStructCreate and STRUCT* in DllCall
Next

MsgBox(0, "", "Finished")

Share this post


Link to post
Share on other sites
mLipok

Thanks for so fast fixed #2813 

mLipok


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-03-17

Share this post


Link to post
Share on other sites
Jon

 

Jon, something is wrong with releasing DllStruct's allocated memory which causes memory leak.

Run the following snippet with the latest Beta and check the memory usage of its process:

#include <WinAPI.au3>

For $i = 1 To 10000
    _WinAPI_GlobalMemoryStatus() ;A function which uses DllStructCreate and STRUCT* in DllCall
Next

MsgBox(0, "", "Finished")

Found it. It's array related, not dll. Thanks.

Share this post


Link to post
Share on other sites
mLipok

Jon 

in my QuickPDF and XZip UDF  I am using this experimental feature:

 

Both UDF files, I use on many of my solutions on at least 40 stations, many of my clients, to the various versions of Windows.

EDIT: So far not noticed any problems.

I would like to ask if or when we can expect the official approval of this functionality, and if that function does not share the fate Plugins - i mean totaly removal.

If in the future You will need to conduct any tests, in this respect, it just PM me.

Edited by mLipok

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-03-17

Share this post


Link to post
Share on other sites
FaridAgl

But the memory leak happens somewhere else too, where I only use DllStructCreate() and not any array.

It seems like when the pointer to the Struct is passed to a DllCall, the Struct's memory won't be released, even if I reassign the Struct variable with 0.

Share this post


Link to post
Share on other sites
FaridAgl

Jon,

I'm not sure if it's a desired report.

The following snippet runs 25% ~ 40% slower in the current Beta when comparing to latest Stable.

Func Foo()
    Local $var = "Bar"

    If $var Then
    Else
    EndIf

    Switch $var
        Case 1
        Case 2
        Case 3
        Case Else
    EndSwitch

    Local $v1 = 1
    Local $v2 = 1.1
    Local $v3 = 0x1234
    Local $v4 = False
    Local $v5 = Null

    Return $var
EndFunc

Global $t = TimerInit()
For $i = 1 To 100000
    Foo()
Next
MsgBox(0, "", TimerDiff($t))
Edited by FaridAgl

Share this post


Link to post
Share on other sites
Jon

But the memory leak happens somewhere else too, where I only use DllStructCreate() and not any array.

It seems like when the pointer to the Struct is passed to a DllCall, the Struct's memory won't be released, even if I reassign the Struct variable with 0.

DllStruct uses arrays internally.

Share this post


Link to post
Share on other sites
DXRW4E

Hi, I know it's not the place, however there is a bug in the registry function (A registry tree can be 512 levels deep. You can create up to 32 levels at a time through a single registry API call.)

#RequireAdmin
Opt("MustDeclareVars",1)
#include <array.au3>
;;#AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7

If Not IsDeclared("arDllCall") Then Global Static $arDllCall

#Region ;**** Global vars for Registry Function ****
Global Const $hKernel32DLL = DllOpen("Kernel32.dll")
Global Const $hAdvapi32Dll = DllOpen("AdvApi32.dll")

;;
;; Reserved Key Handles.
;;
Global Const $HKEY_CLASSES_ROOT                = 0x80000000
Global Const $HKEY_CURRENT_USER                = 0x80000001
Global Const $HKEY_LOCAL_MACHINE               = 0x80000002
Global Const $HKEY_USERS                       = 0x80000003
Global Const $HKEY_PERFORMANCE_DATA            = 0x80000004
Global Const $HKEY_CURRENT_CONFIG              = 0x80000005
Global Const $HKEY_DYN_DATA                    = 0x80000006
Global Const $HKEY_CURRENT_USER_LOCAL_SETTINGS = 0x80000007
Global Const $HKEY_PERFORMANCE_TEXT            = 0x80000050
Global Const $HKEY_PERFORMANCE_NLSTEXT         = 0x80000060

;;
;; Open/Create Options
;;
Global Const $REG_OPTION_RESERVED              = 0x00000000   ;; Parameter is reserved
Global Const $REG_OPTION_NON_VOLATILE          = 0x00000000   ;; Key is preserved when system is rebooted
Global Const $REG_OPTION_VOLATILE              = 0x00000001   ;; Key is not preserved when system is rebooted
Global Const $REG_OPTION_CREATE_LINK           = 0x00000002   ;; Created key is a symbolic link
Global Const $REG_OPTION_BACKUP_RESTORE        = 0x00000004   ;; open for backup or restore special access rules privilege required
Global Const $REG_OPTION_OPEN_LINK             = 0x00000008   ;; Open symbolic link
Global Const $REG_LEGAL_OPTION                 = BitOr($REG_OPTION_RESERVED, $REG_OPTION_NON_VOLATILE, $REG_OPTION_VOLATILE, $REG_OPTION_CREATE_LINK, $REG_OPTION_BACKUP_RESTORE, $REG_OPTION_OPEN_LINK)
Global Const $REG_OPEN_LEGAL_OPTION            = BitOr($REG_OPTION_RESERVED, $REG_OPTION_BACKUP_RESTORE, $REG_OPTION_OPEN_LINK)
Global Const $REG_OPTION_NON_VOLATILE_BACKUP_RESTORE = BitOr($REG_OPTION_NON_VOLATILE, $REG_OPTION_BACKUP_RESTORE)

;;
;; Key creation/open disposition
;;
Global Const $REG_CREATED_NEW_KEY              = 0x00000001     ;; New Registry Key created
Global Const $REG_OPENED_EXISTING_KEY          = 0x00000002     ;; Existing Key opened

Global Const $KEY_QUERY_VALUE                  = 0x0001 ;; $SDDL_CREATE_CHILD = "CC"   - Required to query the values of a registry key.
Global Const $KEY_SET_VALUE                    = 0x0002 ;; $SDDL_DELETE_CHILD = "DC"   - Required to create, delete, or set a registry value.
Global Const $KEY_CREATE_SUB_KEY               = 0x0004 ;; $SDDL_LIST_CHILDREN = "LC"  - Required to create a subkey of a registry key.
Global Const $KEY_ENUMERATE_SUB_KEYS           = 0x0008 ;; $SDDL_SELF_WRITE = "SW"     - Required to enumerate the subkeys of a registry key.
Global Const $KEY_NOTIFY                       = 0x0010 ;; $SDDL_READ_PROPERTY = "RP"  - Required to request change notifications for a registry key or for subkeys of a registry key.
Global Const $KEY_CREATE_LINK                  = 0x0020 ;; $SDDL_WRITE_PROPERTY = "WP" - Reserved for system use.
;~ Global Const $KEY_WOW64_64KEY                  = 0x0100 ;; Indicates that an application on 64-bit Windows should operate on the 64-bit registry view. This flag is ignored by 32-bit Windows. For more information, see Accessing an Alternate Registry View. This flag must be combined using the OR operator with the other flags in this table that either query or access registry values.
;~ Global Const $KEY_WOW64_32KEY                  = 0x0200 ;; Indicates that an application on 64-bit Windows should operate on the 32-bit registry view. This flag is ignored by 32-bit Windows. For more information, see Accessing an Alternate Registry View. This flag must be combined using the OR operator with the other flags in this table that either query or access registry values.
;~ Global Const $KEY_WOW64_RES                    = 0x0300
Global Const $_KEY_ALL_ACCESS                  = 0x003F

Global Const $ACCESS_SYSTEM_SECURITY = 0x01000000

Global Const $KEY_READ                         = 0x00020019 ;; BitOr($STANDARD_RIGHTS_READ, $KEY_QUERY_VALUE, $KEY_ENUMERATE_SUB_KEYS, $KEY_NOTIFY)
Global Const $KEY_READ_EX                      = 0x00120019 ;; BitOr($SYNCHRONIZE,  $STANDARD_RIGHTS_READ, $KEY_QUERY_VALUE, $KEY_ENUMERATE_SUB_KEYS, $KEY_NOTIFY)
Global Const $KEY_WRITE                        = 0x00020006 ;; BitOr($STANDARD_RIGHTS_WRITE, $KEY_SET_VALUE, $KEY_CREATE_SUB_KEY)
Global Const $KEY_WRITE_EX                     = 0x00020006 ;; BitOr($SYNCHRONIZE, $STANDARD_RIGHTS_WRITE, $KEY_SET_VALUE, $KEY_CREATE_SUB_KEY)
Global Const $KEY_READ_WRITE                   = BitOR($KEY_READ, $KEY_WRITE)
Global Const $KEY_READ_WRITE_EX                = BitOR($KEY_READ, $KEY_WRITE, 0x00100000)  ;; $SYNCHRONIZE = 0x00100000
Global Const $KEY_EXECUTE                      = 0x00020019 ;; Equivalent to KEY_READ.
Global Const $KEY_EXECUTE_EX                   = 0x00120019 ;; Equivalent to KEY_READ_EX.
Global Const $KEY_ALL_ACCESS                   = 0x000F003F ;; BitOr($STANDARD_RIGHTS_REQUIRED, $KEY_QUERY_VALUE, $ KEY_SET_VALUE, $KEY_CREATE_SUB_KEY, $KEY_ENUMERATE_SUB_KEYS, $KEY_NOTIFY, $KEY_CREATE_LINK)
Global Const $KEY_ALL_ACCESS_EX                = 0x001F003F ;; BitOr($STANDARD_RIGHTS_ALL, $KEY_QUERY_VALUE, $ KEY_SET_VALUE, $KEY_CREATE_SUB_KEY, $KEY_ENUMERATE_SUB_KEYS, $KEY_NOTIFY, $KEY_CREATE_LINK)
Global Const $KEY_ALL_ACCESS_SYSTEM_SECURITY   = BitOR($KEY_ALL_ACCESS, $ACCESS_SYSTEM_SECURITY)
Global Const $KEY_READ_ACCESS_SYSTEM_SECURITY  = BitOR($KEY_READ, $ACCESS_SYSTEM_SECURITY)
Global Const $KEY_READ_WRITE_ACCESS_SYSTEM_SECURITY = BitOR($KEY_READ_WRITE, $ACCESS_SYSTEM_SECURITY)


Global Const $SE_REGISTRY_KEY                  = 4  ;; Indicates a registry key. A registry key object can be in the local registry, such as CLASSES_ROOT\SomePath or in a remote registry, such as \\ComputerName\CLASSES_ROOT\SomePath. The names of registry keys must use the following literal strings to identify the predefined registry keys: "CLASSES_ROOT", "CURRENT_USER", "MACHINE", and "USERS".
Global Const $SE_REGISTRY_WOW64_32KEY          = 12 ;; Indicates an object for a registry entry under WOW64.
Global Const $KEY_WOW64_64KEY                  = 0x0100 ;; Indicates that an application on 64-bit Windows should operate on the 64-bit registry view. This flag is ignored by 32-bit Windows. For more information, see Accessing an Alternate Registry View. This flag must be combined using the OR operator with the other flags in this table that either query or access registry values.
Global Const $KEY_WOW64_32KEY                  = 0x0200 ;; Indicates that an application on 64-bit Windows should operate on the 32-bit registry view. This flag is ignored by 32-bit Windows. For more information, see Accessing an Alternate Registry View. This flag must be combined using the OR operator with the other flags in this table that either query or access registry values.
Global Const $KEY_WOW64_RES                    = 0x0300

;;;;    Global Const $HKEY_PREDEFINED[11][6] = [[0x80000000,"HKCR","CLASSES_ROOT","\Registry\Machine\SOFTWARE\Classes","HKEY_CLASSES_ROOT","HKCR"], _
;;;;    [0x80000001,"HKCU","CURRENT_USER","\Registry\User\CurrentUser","HKEY_CURRENT_USER","HKCU"], _
;;;;    [0x80000002,"HKLM","MACHINE","\Registry\Machine","HKEY_LOCAL_MACHINE","HKLM"], _
;;;;    [0x80000003,"HKU","USERS","\Registry\User","HKEY_USERS","HKU"], _
;;;;    [0x80000005,"HKLM","MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current","\Registry\Machine\SYSTEM\CurrentControlSet\Hardware Profiles\Current","HKEY_CURRENT_CONFIG","HKCC"], _
;;;;    [0x80000007,"HKCU","CURRENT_USER\Software\Classes\Local Settings","\Registry\User\CurrentUser\Software\Classes\Local Settings","HKEY_CURRENT_USER_LOCAL_SETTINGS","HKLS"], _
;;;;    [0x80000004,"HKPD","PERFORMANCE_DATA\","","HKEY_PERFORMANCE_DATA","HKPD"], _
;;;;    [0x80000006,"HKDD","DYN_DATA\","","HKEY_DYN_DATA","HKDD"], _
;;;;    [0x80000050,"HKPT","PERFORMANCE_TEXT\","","HKEY_PERFORMANCE_TEXT","HKPT"], _
;;;;    [0x80000060,"HKPN","PERFORMANCE_NLSTEXT\","","HKEY_PERFORMANCE_NLSTEXT","HKPN"], _
;;;;    [0,";",0,""]]
Global Const $HKEY_PREDEFINED[11][6]           = [[0x80000000,"HKCR","CLASSES_ROOT","\Registry\Machine\SOFTWARE\Classes","HKEY_CLASSES_ROOT","HKCR"],[0x80000001,"HKCU","CURRENT_USER","\Registry\User\CurrentUser","HKEY_CURRENT_USER","HKCU"],[0x80000002,"HKLM","MACHINE","\Registry\Machine","HKEY_LOCAL_MACHINE","HKLM"],[0x80000003,"HKU","USERS","\Registry\User","HKEY_USERS","HKU"],[0x80000005,"HKLM","MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current","\Registry\Machine\SYSTEM\CurrentControlSet\Hardware Profiles\Current","HKEY_CURRENT_CONFIG","HKCC"],[0x80000007,"HKCU","CURRENT_USER\Software\Classes\Local Settings","\Registry\User\CurrentUser\Software\Classes\Local Settings","HKEY_CURRENT_USER_LOCAL_SETTINGS","HKLS"],[0x80000004,"HKPD","PERFORMANCE_DATA\","","HKEY_PERFORMANCE_DATA","HKPD"],[0x80000006,"HKDD","DYN_DATA\","","HKEY_DYN_DATA","HKDD"],[0x80000050,"HKPT","PERFORMANCE_TEXT\","","HKEY_PERFORMANCE_TEXT","HKPT"],[0x80000060,"HKPN","PERFORMANCE_NLSTEXT\","","HKEY_PERFORMANCE_NLSTEXT","HKPN"],[0,";",0,""]]

#EndRegion ;**** Global vars for Registry Function ****

Local $hKey, $fTimerDiff, $iExtended, $sData, $aData, $sBinary
$sBinary = "0x11111111111111111111111111111111111111133333333333333344444444444444444444444444444444444444444446666666666666666666666666666660"
Local $sKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\01\02\03\04\05\06\07\08\09"
For $i = 10 to 111
    $sKeyPath &= "\" & $i
Next

$sData = _WinAPI_RegSetValueEx(Null, $sKeyPath, "Test", "aaaaaaabbbbccc", $REG_SZ)
MsgBox(0, @error & " - " & @extended, $sData)

$sData = _WinAPI_RegQueryValueEx(Null, $sKeyPath, "Test")
MsgBox(0, @error & " - " & @extended, $sData)


$hKey = _WinAPI_RegOpenKeyEx(Null, $sKeyPath)
$sData = _WinAPI_RegSetValueEx(Null, $sKeyPath, "Test", "ccccddddeeeee", $REG_SZ)
MsgBox(0, @error & " - " & @extended, $sData)
$sData = _WinAPI_RegQueryValueEx($hKey, Null, "Test")
MsgBox(0, @error & " - " & @extended, $sData)
_WinAPI_RegCloseKey($hKey)

$fTimerDiff = TimerInit()
$aData = _WinAPI_RegEnumKeyEx(Null, "HKEY_LOCAL_MACHINE\SOFTWARE\01", 0)
;;$iExtended = @Extended
$fTimerDiff = TimerDiff($fTimerDiff)
_ArrayDisplay($aData, $fTimerDiff)

$fTimerDiff = TimerInit()
$aData = _WinAPI_RegEnumValueEx(Null, "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\AutoIt v3\AutoIt")
;;$iExtended = @Extended
$fTimerDiff = TimerDiff($fTimerDiff)
_ArrayDisplay($aData, $fTimerDiff)


$sData = _WinAPI_RegSetValueEx(Null, "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\AutoIt v3\AutoIt", "Test", 10, $REG_DWORD_BIG_ENDIAN)
;$sData = _WinAPI_RegSetValueEx(Null, "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\AutoIt v3\AutoIt", "Test", Binary("0x0000000A"), $REG_DWORD_BIG_ENDIAN)
;$sData = _WinAPI_RegSetValueEx(Null, "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\AutoIt v3\AutoIt", "Test", Binary("0x" & Hex(10, 8), $REG_DWORD_BIG_ENDIAN)
MsgBox(0, @error & " - " & @extended, $sData)

$sData = _WinAPI_RegQueryValueEx(Null, "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\AutoIt v3\AutoIt", "Test")
MsgBox(0, @error & " - " & @extended, $sData)

Exit


; #FUNCTION# ========================================================================================================================
; Name...........: _WinAPI_RegOpenKeyEx
; Description ...: Opens the specified registry key. Note that key names are not case sensitive.
; Syntax.........: _WinAPI_RegOpenKeyEx($hKey[, $sSubKey[, $samDesired[, $dwOptions]]])
; Parameters ....: $hKey         - A handle to an open registry key. This handle is returned by the _WinAPI_RegCreateKeyEx or _WinAPI_RegOpenKeyEx
;                                    or _WinAPI_RegCreateKey or _WinAPI_RegOpenKey function, or it can be one of the following predefined keys:
;                                      $HKEY_CLASSES_ROOT
;                                      $HKEY_CURRENT_CONFIG
;                                      $HKEY_CURRENT_USER
;                                      $HKEY_LOCAL_MACHINE
;                                      $HKEY_USERS
;                                   This parameter can be NULL (use the NULL or 0 to set NULL this parameter, If $hKey is NULL,
;                                    $sSubKey must be contain Full String KeyName, for more see $sSubKey
;                  $sSubKey      - Optional, The name of the registry subkey to be opened. Key names are not case sensitive.
;                                    This key must be a subkey of the key identified by the $hKey parameter.
;                                    if $hKey is Null this parameter must be a Full String KeyName, example
;                                      "HKLM\SOFTWARE\Example" or "HKEY_USERS" or "HKEY_CURRENT_USER\Software"
;                                      "\Registry\Machine\SOFTWARE\Example" or "\Registry\User" or "\Registry\User\CurrentUser"
;                                      "MACHINE\Software\Example" or "USERS" or "CURRENT_USER\Software"
;                                      "CLASSES_ROOT\Example" or in a remote registry such as \\ComputerName\CLASSES_ROOT\Example.
;                                    The $sSubKey parameter can be an empty string. If $sSubKey is an empty string and $hKey is $HKEY_CLASSES_ROOT,
;                                      function return the same $hKey handle passed into the function. Otherwise, return a new handle to the key specified by $hKey.
;                                    The $sSubKey parameter can be NULL only if $hKey is one of the predefined keys. If $sSubKey is NULL and $hKey is
;                                      $HKEY_CLASSES_ROOT, function return a new handle to the key specified by $hKey. Otherwise, retun the same
;                                      $hKey handle passed in to the function.
;                  $samDesired   - Optional, A mask that specifies the desired access rights to the key to be opened. The function fails if
;                  |                 the security descriptor of the key does not permit the requested access for the calling process.
;                  |                 For more information, see Registry Key Security and Access Rights.
;                  |  (add the flags together for multiple operations):
;                  |$KEY_ALL_ACCESS (983103)    - (Default) Combines the STANDARD_RIGHTS_REQUIRED, KEY_QUERY_VALUE, KEY_SET_VALUE, KEY_CREATE_SUB_KEY,
;                  |                                KEY_ENUMERATE_SUB_KEYS, KEY_NOTIFY, and KEY_CREATE_LINK access rights.
;                  |$KEY_QUERY_VALUE (1)        - Required to query the values of a registry key.
;                  |$KEY_SET_VALUE (2)          - Required to create, delete, or set a registry value.
;                  |$KEY_CREATE_SUB_KEY (4)     - Required to create a subkey of a registry key.
;                  |$KEY_ENUMERATE_SUB_KEYS (8) - Required to enumerate the subkeys of a registry key.
;                  |$KEY_NOTIFY (16)            - Required to request change notifications for a registry key or for subkeys of a registry key.
;                  |$KEY_CREATE_LINK (32)       - Reserved for system use.
;                  |$KEY_WOW64_64KEY (256)      - Indicates that an application on 64-bit Windows should operate on the 64-bit registry view.
;                  |                               This flag is ignored by 32-bit Windows. For more information, see Accessing an Alternate Registry View.
;                  |                               This flag must be combined using the OR operator with the other flags in this table that either query or access registry values.
;                  |                               Windows 2000:  This flag is not supported.
;                  |$KEY_WOW64_32KEY (512)      - Indicates that an application on 64-bit Windows should operate on the 32-bit registry view.
;                  |                               This flag is ignored by 32-bit Windows. For more information, see Accessing an Alternate Registry View.
;                  |                               This flag must be combined using the OR operator with the other flags in this table that either query or access registry values.
;                  |                               Windows 2000:  This flag is not supported.
;                  |$KEY_WRITE (131078)         - Combines the STANDARD_RIGHTS_WRITE, KEY_SET_VALUE, and KEY_CREATE_SUB_KEY access rights.
;                  |$KEY_READ (131097)          - Combines the STANDARD_RIGHTS_READ, KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, and KEY_NOTIFY values.
;                  |$KEY_EXECUTE (131097)       - Equivalent to KEY_READ.
;                  $dwOptions  - Optional, This parameter is reserved and must be zero.
;                  | however will have to support flags such as
;                  |$REG_OPTION_BACKUP_RESTORE (4) - If this flag is set, the function ignores the samDesired parameter and attempts to open the key with
;                  |                                  the access required to backup or restore the key. If the calling thread has the SE_BACKUP_NAME
;                  |                                  has the the key is opened with the ACCESS_SYSTEM_SECURITY and KEY_READ access rights. If the calling thread
;                  |                                  privilege enabled, SE_RESTORE_NAME privilege enabled, beginning with Windows Vista, the key is opened with the
;                  |                                  ACCESS_SYSTEM_SECURITY, DELETE and KEY_WRITE access rights. If both privileges are enabled, the key has the
;                  |                                  combined access rights for both privileges. For more information, see Running with Special Privileges.
; Return values .: If the function succeeds, the return value is a handle to the opened key and set ERROR_SUCCESS error code
;                  If the function fails, the return value is a 0, and set nonzero error code, and set Extended error code defined in WinError.h
;                    @EXtended: -1 = unable to use the DLL file,
;                               -2 = unknown "return type",
;                               -3 = "function" not found in the DLL file,
;                               -4 = bad number of parameters,
;                               -5 = bad parameter.
;                               0+ = error code defined in WinError.h
; Author ........: DXRW4E
; Modified.......:
; Remarks .......: Unlike the _WinAPI_RegCreateKeyEx function, the _WinAPI_RegOpenKeyEx function does not create the specified key if
;                    the key does not exist in the registry.
;                  Certain registry operations perform access checks against the security descriptor of the key, not the access mask
;                    specified when the handle to the key was obtained. For example, even if a key is opened with a $samDesired of
;                    $KEY_READ, it can be used to create registry keys if the key's security descriptor permits. In contrast, the
;                    _WinAPI_RegSetValueEx function specifically requires that the key be opened with the $KEY_SET_VALUE access right.
;                  If your service or application impersonates different users, do not use this function with HKEY_CURRENT_USER.
;                    Instead, call the _WinAPI_RegOpenCurrentUser function.
;                  Note that operations that access certain registry keys are redirected. For more information,
;                    see Registry Virtualization http://msdn.microsoft.com/en-us/library/windows/desktop/aa965884%28v=vs.85%29.aspx
;                    and 32-bit and 64-bit Application Data in the Registry http://msdn.microsoft.com/en-us/library/windows/desktop/ms724072(v=vs.85).aspx
;                  If the key is not one of the predefined registry keys you must call the _WinAPI_RegCloseKey()
;                    function after finished using the handle.
; Related .......:
; Link ..........:
; Example .......:
; Example .......: _WinAPI_RegOpenKeyEx(0, "HKLM\Software\KeyName")
;                  _WinAPI_RegOpenKeyEx($HKEY_LOCAL_MACHINE, "Software\KeyName")
; Note ..........:
; ===================================================================================================================================
Func _WinAPI_RegOpenKeyEx($hKey, $sSubKey = "", $samDesired = $KEY_ALL_ACCESS, $ulOptions = $REG_OPTION_RESERVED)
    If Not $hKey Then $hKey = _RegGetPredefinedKeyEx($sSubKey, $samDesired)
    $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegOpenKeyExW", "ULONG_PTR", $hKey, "WSTR", $sSubKey, "DWORD", $ulOptions, "DWORD", $samDesired, "ULONG_PTR*", 0)
    If @Error Then Return SetError(1, -@Error, 0)
    If $arDllCall[0] Then
        If $arDllCall[0] = 206 Then ;; ERROR_FILENAME_EXCED_RANGE - 206 (0xCE) - The filename or extension is too long.
            ;;$sSubKey = StringRegExp($sSubKey, "(?>[^\\]+\\){1,31}(?>[^\\]*)", 3)
            ;;If @Error Or UBound($sSubKey) > 16 Then Return SetError(2, $arDllCall[0], 0)
            ;;error @AutoItx32 in WOW64 if use "SOFTWARE\01\02\03\04\05\06\07\08\09\10\11\12\13\14\15\16\17\18\19\20\21\22\23\24\25\26\27\28\29\30\31"
            ;; so for safety's better to use the '(?>[^\\]+\\){1,29}(?>[^\\]*)' = 30 levels
            $sSubKey = StringRegExp($sSubKey, "(?>[^\\]+\\){1,29}(?>[^\\]*)", 3)
            If @Error Or UBound($sSubKey) > 17 Then Return SetError(2, $arDllCall[0], 0)
            $arDllCall[5] = $arDllCall[1]
            For $i = 0 To UBound($sSubKey) - 1
                $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegOpenKeyExW", "ULONG_PTR", $arDllCall[5], "WSTR", $sSubKey[$i], "DWORD", $arDllCall[3], "DWORD", $samDesired, "ULONG_PTR*", 0)
                If $i Then DllCall($hAdvapi32Dll, "LONG", "RegCloseKey", "ULONG_PTR", $arDllCall[1])
                If $arDllCall[0] Then Return SetError(3, $arDllCall[0], 0)
            Next
        EndIf
    EndIf
    Return SetError($arDllCall[0], $arDllCall[0], $arDllCall[5])
EndFunc



; #FUNCTION# ========================================================================================================================
; Name...........: _WinAPI_RegCreateKeyEx
; Description ...: Creates the specified registry key. If the key already exists in the registry, the function opens it.
; Syntax.........: _WinAPI_RegCreateKeyEx($hKey[, $sSubKey[, $samDesired[, $dwOptions]]])
; Parameters ....: $hKey                - A handle to an open registry key. The calling process must have KEY_CREATE_SUB_KEY access to the key.
;                                           For more information, see Registry Key Security and Access Rights.
;                                         Access for key creation is checked against the security descriptor of the registry key, not the access
;                                           mask specified when the handle was obtained. Therefore, even if hKey was opened with a samDesired of KEY_READ,
;                                           it can be used in operations that modify the registry if allowed by its security descriptor.
;                                         This handle is returned by the _WinAPI_RegCreateKeyEx or _WinAPI_RegOpenKeyEx or _WinAPI_RegCreateKey or _WinAPI_RegOpenKey
;                                           function, or it can be one of the following predefined keys:
;                                             $HKEY_CLASSES_ROOT
;                                             $HKEY_CURRENT_CONFIG
;                                             $HKEY_CURRENT_USER
;                                             $HKEY_LOCAL_MACHINE
;                                             $HKEY_USERS
;                                         This parameter can be NULL (use the NULL or 0 to set NULL this parameter, If $hKey is NULL,
;                                           $sSubKey must be contain Full String KeyName, for more see $sSubKey
;                  $sSubKey             - Optional, The name of a key that this function opens or creates. Key names are not case sensitive.
;                                           This key must be a subkey of the key identified by the $hKey parameter.
;                                           if $hKey is Null this parameter must be a Full String KeyName, example
;                                             "HKLM\SOFTWARE\Example" or "HKEY_USERS" or "HKEY_CURRENT_USER\Software"
;                                             "\Registry\Machine\SOFTWARE\Example" or "\Registry\User" or "\Registry\User\CurrentUser"
;                                             "MACHINE\Software\Example" or "USERS" or "CURRENT_USER\Software"
;                                             "CLASSES_ROOT\Example" or in a remote registry such as \\ComputerName\CLASSES_ROOT\Example.
;                                           If $hKey is one of the predefined keys, $sSubKey may be NULL. In that case, return the same $hKey handle passed in to the function.
;                  $samDesired          - Optional, A mask that specifies the access rights for the key to be created.
;                  |  (add the flags together for multiple operations):
;                  |$KEY_ALL_ACCESS (983103)    - (Default) Combines the STANDARD_RIGHTS_REQUIRED, KEY_QUERY_VALUE, KEY_SET_VALUE, KEY_CREATE_SUB_KEY,
;                  |                                KEY_ENUMERATE_SUB_KEYS, KEY_NOTIFY, and KEY_CREATE_LINK access rights.
;                  |$KEY_QUERY_VALUE (1)        - Required to query the values of a registry key.
;                  |$KEY_SET_VALUE (2)          - Required to create, delete, or set a registry value.
;                  |$KEY_CREATE_SUB_KEY (4)     - Required to create a subkey of a registry key.
;                  |$KEY_ENUMERATE_SUB_KEYS (8) - Required to enumerate the subkeys of a registry key.
;                  |$KEY_NOTIFY (16)            - Required to request change notifications for a registry key or for subkeys of a registry key.
;                  |$KEY_CREATE_LINK (32)       - Reserved for system use.
;                  |$KEY_WOW64_64KEY (256)      - Indicates that an application on 64-bit Windows should operate on the 64-bit registry view.
;                  |                               This flag is ignored by 32-bit Windows. For more information, see Accessing an Alternate Registry View.
;                  |                               This flag must be combined using the OR operator with the other flags in this table that either query or access registry values.
;                  |                               Windows 2000:  This flag is not supported.
;                  |$KEY_WOW64_32KEY (512)      - Indicates that an application on 64-bit Windows should operate on the 32-bit registry view.
;                  |                               This flag is ignored by 32-bit Windows. For more information, see Accessing an Alternate Registry View.
;                  |                               This flag must be combined using the OR operator with the other flags in this table that either query or access registry values.
;                  |                               Windows 2000:  This flag is not supported.
;                  |$KEY_WRITE (131078)         - Combines the STANDARD_RIGHTS_WRITE, KEY_SET_VALUE, and KEY_CREATE_SUB_KEY access rights.
;                  |$KEY_READ (131097)          - Combines the STANDARD_RIGHTS_READ, KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, and KEY_NOTIFY values.
;                  |$KEY_EXECUTE (131097)       - Equivalent to KEY_READ.
;                  $dwOptions           - Optional, This parameter can be one of the following values.
;                  |  (add the flags together for multiple operations):
;                  |$REG_OPTION_NON_VOLATILE (0)   - (Default) This key is not volatile; this is the default. The information is stored in a file and is
;                  |                                   preserved when the system is restarted. The RegSaveKey function saves keys that are not volatile.
;                  |$REG_OPTION_VOLATILE (1)       - All keys created by the function are volatile. The information is stored in memory and is not preserved
;                  |                                  when the corresponding registry hive is unloaded. For HKEY_LOCAL_MACHINE, this occurs only when the system
;                  |                                  initiates a full shutdown. For registry keys loaded by the RegLoadKey function, this occurs when the
;                  |                                  corresponding RegUnLoadKey is performed. The RegSaveKey function does not save volatile keys. This flag
;                  |                                  is ignored for keys that already exist.
;                  |                                 Note  On a user selected shutdown, a fast startup shutdown is the default behavior for the system.
;                  |$REG_OPTION_CREATE_LINK (2)    - Note Registry symbolic links should only be used for for application compatibility when absolutely necessary.
;                  |                                  This key is a symbolic link. The target path is assigned to the L"SymbolicLinkValue" value of the key.
;                  |                                  The target path must be an absolute registry path.
;                  |$REG_OPTION_BACKUP_RESTORE (4) - If this flag is set, the function ignores the samDesired parameter and attempts to open the key with
;                  |                                  the access required to backup or restore the key. If the calling thread has the SE_BACKUP_NAME
;                  |                                  has the the key is opened with the ACCESS_SYSTEM_SECURITY and KEY_READ access rights. If the calling thread
;                  |                                  privilege enabled, SE_RESTORE_NAME privilege enabled, beginning with Windows Vista, the key is opened with the
;                  |                                  ACCESS_SYSTEM_SECURITY, DELETE and KEY_WRITE access rights. If both privileges are enabled, the key has the
;                  |                                  combined access rights for both privileges. For more information, see Running with Special Privileges.
;                  $pSecurityAttributes - (Default is Null) A pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle can be
;                                           inherited by child processes. If $pSecurityAttributes is NULL, the handle cannot be inherited.
;                                         The $pSecurityAttributes member of the structure specifies a security descriptor for the new key. If $pSecurityAttributes
;                                           is NULL, the key gets a default security descriptor. The ACLs in a default security descriptor for a key are inherited
;                                           from its direct parent key.
;                                         for more see _WinAPI_RegGetKeySecurity & _WinAPI_RegSetKeySecurity
; Return values .: If the function succeeds, the return value is a handle to the opened or created key and set ERROR_SUCCESS error code, and set Extended
;                    @EXtended: $REG_CREATED_NEW_KEY (1)     = The key did not exist and was created.
;                               $REG_OPENED_EXISTING_KEY (2) = The key existed and was simply opened without being changed.
;                  If the function fails, the return value is a 0, and set nonzero error code, and set Extended error code defined in WinError.h
;                    @EXtended: -1 = unable to use the DLL file,
;                               -2 = unknown "return type",
;                               -3 = "function" not found in the DLL file,
;                               -4 = bad number of parameters,
;                               -5 = bad parameter.
;                               0+ = error code defined in WinError.h
; Author ........: DXRW4E
; Modified.......:
; Remarks .......: The key that the _WinAPI_RegCreateKeyEx function creates has no values. An application can use the
;                    _WinAPI_RegSetValueEx function to set key values.
;                  The _WinAPI_RegCreateKeyEx function creates all missing keys in the specified path. An application can take advantage
;                    of this behavior to create several keys at once. For example, an application can create a subkey four levels deep
;                    at the same time as the three preceding subkeys by specifying a string of the following form for the $sSubKey parameter:
;                      "subkey1\subkey2\subkey3\subkey4"
;                  Note that this behavior will result in creation of unwanted keys if an existing key in the path is spelled incorrectly.
;                  An application cannot create a key that is a direct child of HKEY_USERS or HKEY_LOCAL_MACHINE. An application can create
;                    subkeys in lower levels of the HKEY_USERS or HKEY_LOCAL_MACHINE trees.
;                  If your service or application impersonates different users, do not use this function with HKEY_CURRENT_USER. Instead,
;                    call the _WinAPI_RegOpenCurrentUser function.
;                  Note that operations that access certain registry keys are redirected. For more information,
;                    see Registry Virtualization http://msdn.microsoft.com/en-us/library/windows/desktop/aa965884%28v=vs.85%29.aspx
;                    and 32-bit and 64-bit Application Data in the Registry http://msdn.microsoft.com/en-us/library/windows/desktop/ms724072(v=vs.85).aspx
;                  If the key is not one of the predefined registry keys you must call the _WinAPI_RegCloseKey()
;                    function after finished using the handle.
; Related .......:
; Link ..........:
; Example .......:
; Example .......: _WinAPI_RegCreateKeyEx(0, "HKLM\Software\KeyName")
;                  _WinAPI_RegCreateKeyEx(0, "HKLM\Software\KeyName", $KEY_READ)
;                  _WinAPI_RegCreateKeyEx($HKEY_LOCAL_MACHINE, "Software\KeyName")
;                  _WinAPI_RegCreateKeyEx($HKEY_LOCAL_MACHINE, "Software\KeyName", $KEY_WRITE)
; Note ..........:
; ===================================================================================================================================
Func _WinAPI_RegCreateKeyEx($hKey, $sSubKey = "", $samDesired = $KEY_ALL_ACCESS, $dwOptions = $REG_OPTION_NON_VOLATILE, $pSecurityAttributes = Null)
    If Not $hKey Then $hKey = _RegGetPredefinedKeyEx($sSubKey, $samDesired)
    $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegCreateKeyExW", "ULONG_PTR", $hKey, "WSTR", $sSubKey, "DWORD", $REG_OPTION_RESERVED, "WSTR", Null, "DWORD", $dwOptions, "DWORD", $samDesired, "PTR", $pSecurityAttributes, "ULONG_PTR*", 0, "DWORD*", 0)
    If @Error Then Return SetError(1, -@Error, 0)
    If $arDllCall[0] Then
        If $arDllCall[0] = 206 Then ;; ERROR_FILENAME_EXCED_RANGE - 206 (0xCE) - The filename or extension is too long.
            $sSubKey = StringRegExp($sSubKey, "(?>[^\\]+\\){1,29}(?>[^\\]*)", 3)
            If @Error Or UBound($sSubKey) > 17 Then Return SetError(2, $arDllCall[0], 0)
            $arDllCall[8] = $arDllCall[1]
            For $i = 0 To UBound($sSubKey) - 1
                $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegCreateKeyExW", "ULONG_PTR", $arDllCall[8], "WSTR", $sSubKey[$i], "DWORD", $REG_OPTION_RESERVED, "WSTR", Null, "DWORD", $arDllCall[5], "DWORD", $samDesired, "PTR", $pSecurityAttributes, "ULONG_PTR*", 0, "DWORD*", 0)
                If $i Then DllCall($hAdvapi32Dll, "LONG", "RegCloseKey", "ULONG_PTR", $arDllCall[1])
                If $arDllCall[0] Then Return SetError(3, $arDllCall[0], 0)
            Next
        EndIf
    EndIf
    Return SetError($arDllCall[0], $arDllCall[9], $arDllCall[8])
EndFunc


; #FUNCTION# ========================================================================================================================
; Name...........: __WinAPI_RegEnumKeyEx
; Description ...: Enumerates the subkeys of the specified open registry key. The function retrieves information about one subkey each time it is called.
; Syntax.........: __WinAPI_RegEnumKeyEx($hKey[, $sSubKey[, $iFlags[, $sFilter]]])
; Parameters ....: $hKey   - A handle to an open registry key. The key must have been opened with the KEY_ENUMERATE_SUB_KEYS access right.
;                              For more information, see Registry Key Security and Access Rights.
;                            This handle is returned by the _WinAPI_RegCreateKeyEx or _WinAPI_RegOpenKeyEx or _WinAPI_RegCreateKey or _WinAPI_RegOpenKey
;                              function, or it can be one of the following predefined keys:
;                                $HKEY_CLASSES_ROOT
;                                $HKEY_CURRENT_CONFIG
;                                $HKEY_CURRENT_USER
;                                $HKEY_LOCAL_MACHINE
;                                $HKEY_PERFORMANCE_DATA
;                                $HKEY_USERS
;                            This parameter can be NULL (use the NULL or 0 to set NULL this parameter, If $hKey is NULL,
;                              $sSubKey must be contain Full String KeyName, for more see $sSubKey
;                  $sSubKey - Optional, The name of a key that this function opens or creates. Key names are not case sensitive.
;                               This key must be a subkey of the key identified by the $hKey parameter.
;                               if $hKey is Null this parameter must be a Full String KeyName, example
;                                 "HKLM\SOFTWARE\Example" or "HKEY_USERS" or "HKEY_CURRENT_USER\Software"
;                                 "\Registry\Machine\SOFTWARE\Example" or "\Registry\User" or "\Registry\User\CurrentUser"
;                                 "MACHINE\Software\Example" or "USERS" or "CURRENT_USER\Software"
;                                 "CLASSES_ROOT\Example" or in a remote registry such as \\ComputerName\CLASSES_ROOT\Example.
;                               If $hKey is one of the predefined keys, $sSubKey may be NULL. In that case, return the same $hKey handle passed in to the function.
;                  $iFlags  - Optional specifies Recursion (add the flags together for multiple operations):
;                  |$iFlags = 0 (Default) All Key-SubKeys Recursive Mod
;                  |$iFlags = 1 All SubKeys Not Recursive Mod
;                  |$iFlags = 2 Disable the return the count in the first element - effectively makes the array 0-based (must use UBound()
;                  |              to get the size in this case). By Default the first element ($array[0]) contains the number of
;                  |              keys\subkeys\values returned, the remaining elements ($array[1], $array[2], etc.)
;                  |$iFlags = 4 $REG_OPTION_BACKUP_RESTORE (4) - If this flag is set, the function ignores the samDesired parameter and
;                  |              attempts to open the key with the access required to backup or restore the key. If the calling thread has
;                  |              the SE_BACKUP_NAME has the the key is opened with the ACCESS_SYSTEM_SECURITY and KEY_READ access rights.
;                  |              If the calling thread privilege enabled, SE_RESTORE_NAME privilege enabled, beginning with Windows Vista, the key
;                  |              is opened with the ACCESS_SYSTEM_SECURITY, DELETE and KEY_WRITE access rights. If both privileges are enabled,
;                  |              the key has the combined access rights for both privileges. For more information, see Running with Special Privileges.
;                  |  These flags are ignored by 32-bit Windows
;                  |$iFlags = 256 operate on the 64-bit registry view, $KEY_WOW64_64KEY (256)
;                  |$iFlags = 512 operate on the 32-bit registry view, $KEY_WOW64_32KEY (512)
;                  $sFilter - Optional the filter to use, default is ".*", $sFilter is REGEXP Mod, See Pattern Parameters in StringRegExp
; Return values .: return value is Array, If the function succeeds set ERROR_SUCCESS error code
;                  If the function fails set nonzero error code, and set Extended error code defined in WinError.h
;                    @EXtended: -1 = unable to use the DLL file,
;                               -2 = unknown "return type",
;                               -3 = "function" not found in the DLL file,
;                               -4 = bad number of parameters,
;                               -5 = bad parameter.
;                               0+ = error code defined in WinError.h
; Author ........: DXRW4E
; Modified.......:
; Remarks .......: While an application is using the __WinAPI_RegEnumKeyEx function, it should not make calls to any registration
;                    functions that might change the key being enumerated.
; Related .......:
; Link ..........:
; Example .......:
; Example .......:  __WinAPI_RegEnumKeyEx($HKEY_LOCAL_MACHINE, "SOFTWARE\KeyName")
;                   __WinAPI_RegEnumKeyEx(Null, "HKEY_LOCAL_MACHINE\SOFTWARE\KeyName")
; Note ..........:
; ===================================================================================================================================
Func _WinAPI_RegEnumKeyEx($hKey, $sSubKey = "", $iFlags = 0, $sFilter = ".*")
    Local $IndexSubKey[515][3] = [[512]], $I = 1, $dwOptions = BitAND($iFlags, 4), $samDesired = 8 + BitAND($iFlags, 768) ;; $KEY_WOW64_* + $KEY_ENUMERATE_SUB_KEYS = 0x0008
    Local $sKeyList, $iNoRecursive = BitAND($iFlags, 1), $iFilter = ($sFilter == ".*" ? 0 : 1), $aArray[1] = [0]
    $IndexSubKey[$I][1] = _WinAPI_RegOpenKeyEx($hKey, $sSubKey, $samDesired, $dwOptions)
    If @Error Then Return SetError(1, @Extended, $aArray)
    $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegEnumKeyExW", "ULONG_PTR", $IndexSubKey[$I][1], "DWORD", 0, "WSTR", "", "DWORD*", 256, "DWORD", Null, "WSTR", Null, "DWORD*", Null, "PTR", Null)
    If @Error Or $arDllCall[0] Then Return SetError(2, (@Error ? -@Error : $arDllCall[0]) + DllCall($hAdvapi32Dll, "LONG", "RegCloseKey", "ULONG_PTR", $IndexSubKey[$I][1]), $aArray)
    While $I
        $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegEnumKeyExW", "ULONG_PTR", $IndexSubKey[$I][1], "DWORD", $IndexSubKey[$I][0], "WSTR", "", "DWORD*", 256, "DWORD", Null, "WSTR", Null, "DWORD*", Null, "PTR", Null)
        If $arDllCall[0] Then
            DllCall($hAdvapi32Dll, "LONG", "RegCloseKey", "ULONG_PTR", $arDllCall[1])
            $IndexSubKey[$I][0] = 0
            $IndexSubKey[$I][1] = 0
            $IndexSubKey[$I][2] = ""
            $I -= 1
            ContinueLoop
        EndIf
        $IndexSubKey[$I][0] += 1
        $IndexSubKey[$I+1][2] = $IndexSubKey[$I][2] & "\" & $arDllCall[3]
        $sKeyList &= Not $iFilter ? @LF & $IndexSubKey[$I+1][2] : (StringRegExp($arDllCall[3], $sFilter) ? @LF & $IndexSubKey[$I+1][2] : "")
        If $iNoRecursive Then ContinueLoop
        $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegOpenKeyExW", "ULONG_PTR", $IndexSubKey[$I][1], "WSTR", $arDllCall[3], "DWORD", $dwOptions, "DWORD", $samDesired, "ULONG_PTR*", 0)
        If $arDllCall[0] Then ContinueLoop
        $I += 1
        ;;If $I > $IndexSubKey[0][0] Then ;; (will not have to ever happen) Error Registry Element Size Limits (A registry tree can be 512 levels deep) - http://msdn.microsoft.com/en-us/library/windows/desktop/ms724872%28v=vs.85%29.aspx
        ;;  $IndexSubKey[0][0] *= 2
        ;;  ReDim $IndexSubKey[$IndexSubKey[0][0] + 1]
        ;;EndIf
        $IndexSubKey[$I][1] = $arDllCall[5]
    WEnd
    If Not $sKeyList Then Return SetError(3, 259, $aArray) ;; $ERROR_NO_MORE_ITEMS - 259 (0x103) - No more data is available.
    Return StringSplit(StringTrimLeft($sKeyList, 2), @LF & "\", 1 + BitAND($iFlags, 2))
EndFunc   ;==>_WinAPI_RegEnumKeyEx


; #FUNCTION# ========================================================================================================================
; Name...........: _WinAPI_RegEnumValueEx
; Description ...: Enumerates the values for the specified open registry key. The function copies one indexed value name and data block
;                    for the key each time it is called.
; Syntax.........: _WinAPI_RegEnumValueEx($hKey[, $iFlags, $sFilter]])
; Parameters ....: $hKey    - A handle to an open registry key. The key must have been opened with the KEY_QUERY_VALUE access right.
;                               For more information, see Registry Key Security and Access Rights.
;                               This handle is returned by the _WinAPI_RegCreateKeyEx or _WinAPI_RegOpenKeyEx or _WinAPI_RegCreateKey or _WinAPI_RegOpenKey
;                                 function, or it can be one of the following predefined keys:
;                                     $HKEY_CLASSES_ROOT
;                                     $HKEY_CURRENT_CONFIG
;                                     $HKEY_CURRENT_USER
;                                     $HKEY_LOCAL_MACHINE
;                                     $HKEY_PERFORMANCE_DATA
;                                     $HKEY_USERS
;                  $iFlags  - Optional, (add the flags together for multiple operations):
;                  |$iFlags = 4 $REG_OPTION_BACKUP_RESTORE (4) - If this flag is set, the function ignores the samDesired parameter and
;                  |              attempts to open the key with the access required to backup or restore the key. If the calling thread has
;                  |              the SE_BACKUP_NAME has the the key is opened with the ACCESS_SYSTEM_SECURITY and KEY_READ access rights.
;                  |              If the calling thread privilege enabled, SE_RESTORE_NAME privilege enabled, beginning with Windows Vista, the key
;                  |              is opened with the ACCESS_SYSTEM_SECURITY, DELETE and KEY_WRITE access rights. If both privileges are enabled,
;                  |              the key has the combined access rights for both privileges. For more information, see Running with Special Privileges.
;                  |  These flags are ignored by 32-bit Windows
;                  |$iFlags = 256 operate on the 64-bit registry view, $KEY_WOW64_64KEY (256)
;                  |$iFlags = 512 operate on the 32-bit registry view, $KEY_WOW64_32KEY (512)
;                  $sFilter - Optional the filter to use, default is ".*", $sFilter is REGEXP Mod, See Pattern Parameters in StringRegExp
; Return values .: return value is 2D Array, If the function succeeds set ERROR_SUCCESS error code
;                  If the function fails set nonzero error code, and set Extended error code defined in WinError.h
;                    @EXtended: -1 = unable to use the DLL file,
;                               -2 = unknown "return type",
;                               -3 = "function" not found in the DLL file,
;                               -4 = bad number of parameters,
;                               -5 = bad parameter.
;                               0+ = error code defined in WinError.h
; Author ........: DXRW4E
; Modified.......:
; Remarks .......: To enumerate values, an application should initially call the _WinAPI_RegEnumValueEx function with the dwIndex
;                    parameter set to zero. The application should then increment dwIndex and call the _WinAPI_RegEnumValueEx function
;                    until there are no more values (until the function returns ERROR_NO_MORE_ITEMS).
;                  The application can also set dwIndex to the index of the last value on the first call to the function
;                    and decrement the index until the value with index 0 is enumerated. To retrieve the index of the last value,
;                    use the RegQueryInfoKey function.
;                  While using _WinAPI_RegEnumValueEx, an application should not call any registry functions that might change the key being queried.
;                  If the data has the REG_SZ, REG_MULTI_SZ or REG_EXPAND_SZ type, the string may not have been stored with
;                    the proper null-terminating characters. Therefore, even if the function returns ERROR_SUCCESS, the
;                    application should ensure that the string is properly terminated before using it; otherwise, it may
;                    overwrite a buffer. (Note that REG_MULTI_SZ strings should have two null-terminating characters.)
;                  To determine the maximum size of the name and data buffers, use the RegQueryInfoKey function.
; Related .......:
; Link ..........:
; Example .......:
; Example .......:  _WinAPI_RegEnumValueEx($hKey)
;                   _WinAPI_RegEnumValueEx(Null, "HKLM\Software\KeyName")
;                   _WinAPI_RegEnumValueEx(Null, "HKLM\Software\KeyName", $KEY_WOW64_64KEY)
;                   _WinAPI_RegEnumValueEx(Null, "HKLM\Software\KeyName", 0, ".*ValueName.*")
; Note ..........:
; ===================================================================================================================================
Func _WinAPI_RegEnumValueEx($hKey, $sSubKey = "", $iFlags = 0, $sFilter = ".*")
;~  Static $dwIndex = 0
;~  $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegEnumValueW", "ULONG_PTR", $hKey, "DWORD", $dwIndex, "WSTR", "", "DWORD*", 16384, "DWORD", Null, "DWORD*", 0, "PTR", Null, "PTR", Null)
;~  If @Error Or $arDllCall[0] Then
;~      $dwIndex = 0
;~      Return SetError((@Error ? -@Error : $arDllCall[0]), 0, "")
;~  EndIf
;~  $dwIndex += 1
;~  Return SetExtended($arDllCall[6], $arDllCall[3])
    Local $dwIndex = 0, $pData = DllStructCreate("BYTE[4096]"), $aRegEnumValue[11][3] = [[0,10,0]], $iFilter = ($sFilter == ".*" ? 0 : 1), $samDesired = 1 + BitAND($iFlags, 768) ;; ;; $KEY_QUERY_VALUE = 0x0001
    If $sSubKey Then
        If Not $hKey Then $hKey = _RegGetPredefinedKeyEx($sSubKey, $samDesired)
        $hKey = _WinAPI_RegOpenKeyEx($hKey, $sSubKey, $samDesired, BitAND($iFlags, 4))
        If @Error Then Return SetError(1, @Extended, $aRegEnumValue)
    EndIf
    While 1
        $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegEnumValueW", "ULONG_PTR", $hKey, "DWORD", $dwIndex, "WSTR", "", "DWORD*", 16384, "DWORD", Null, "DWORD*", 0, "STRUCT*", $pData, "DWORD*", 4096)
        If @Error Then ExitLoop
        If $arDllCall[8] > 4096 Then
            $pData = DllStructCreate("BYTE[" & $arDllCall[8] & "]")
            $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegEnumValueW", "ULONG_PTR", $hKey, "DWORD", $dwIndex, "WSTR", "", "DWORD*", 16384, "DWORD", Null, "DWORD*", 0, "STRUCT*", $pData, "DWORD*", 4096)
        EndIf
        If $arDllCall[0] Then ExitLoop
        If $iFilter And StringRegExp($arDllCall[3], $sFilter) = 0 Then ContinueLoop
        $dwIndex += 1
        If $dwIndex > $aRegEnumValue[0][1] Then
            $aRegEnumValue[0][1] *= 2
            ReDim $aRegEnumValue[$aRegEnumValue[0][1] + 1][3]
        EndIf
        $aRegEnumValue[$dwIndex][0] = $arDllCall[3]
        $aRegEnumValue[$dwIndex][1] = $arDllCall[6]
        Switch $arDllCall[6]
            Case 1, 2, 6  ;; $REG_SZ, $REG_EXPAND_SZ, $REG_LINK
                $aRegEnumValue[$dwIndex][2] = BinaryToString(BinaryMid(DllStructGetData($pData, 1), 1, $arDllCall[8]), 2)
            Case 7  ;; $REG_MULTI_SZ
                $aRegEnumValue[$dwIndex][2] = StringRegExpReplace(BinaryToString(BinaryMid(DllStructGetData($pData, 1), 1, $arDllCall[8]), 2), "\x00+", @LF)
            Case 4  ;; $REG_DWORD, $REG_DWORD_LITTLE_ENDIAN
                $aRegEnumValue[$dwIndex][2] = DllStructGetData(DllStructCreate("DWORD", DllStructGetPtr($pData, 1)), 1) ;; Or Dec(StringRegExpReplace(BinaryMid(DllStructGetData($pData, 1), 1, 4), "^..(..)(..)(..)(..)","$4$3$2$1"), 1)
            Case 5  ;; $REG_DWORD_BIG_ENDIAN
                $aRegEnumValue[$dwIndex][2] = Dec(StringMid(BinaryMid(DllStructGetData($pData, 1), 1, $arDllCall[8]), 3, 8), 1) ;; Or Number(StringLeft(DllStructGetData($pData, 1), 10), 3)
            Case 11  ;; $REG_QWORD, $REG_QWORD_LITTLE_ENDIAN
                $aRegEnumValue[$dwIndex][2] = DllStructGetData(DllStructCreate("UINT64", DllStructGetPtr($pData, 1)), 1) ;; Or Dec(StringRegExpReplace(BinaryMid(DllStructGetData($pData, 1), 1, 8), "^..(..)(..)(..)(..)(..)(..)(..)(..)","0x$8$7$6$5$4$3$2$1"), 2)
            Case Else ;; 0 To 11 ;; 0, 3, 8, 9, 10 ;; $REG_NONE, $REG_BINARY, $REG_RESOURCE_LIST, $REG_FULL_RESOURCE_DESCRIPTOR, $REG_RESOURCE_REQUIREMENTS_LIST
                $aRegEnumValue[$dwIndex][2] = BinaryMid(DllStructGetData($pData, 1), 1, $arDllCall[8])
        EndSwitch
    WEnd
    If $sSubKey Then SetError(@Error + DllCall($hAdvapi32Dll, "LONG", "RegCloseKey", "ULONG_PTR", $hKey))
    If Not $dwIndex Then Return SetError(2, (@Error ? -@Error : $arDllCall[0]), $aRegEnumValue)
    $aRegEnumValue[0][0] = $dwIndex + 1
    Return $aRegEnumValue
EndFunc   ;==>_WinAPI_RegEnumValueEx


; #FUNCTION# ========================================================================================================================
; Name...........: _WinAPI_RegSetValueEx
; Description ...: Sets the data and type of a specified value under a registry key.
; Syntax.........: _WinAPI_RegSetValueEx($hKey[, $sSubKey[, $sValueName[, $bData[, $dwType]]]])
; Parameters ....: $hKey       - A handle to an open registry key. The key must have been opened with the KEY_SET_VALUE access right.
;                                  For more information, see Registry Key Security and Access Rights.
;                                This handle is returned by the _WinAPI_RegCreateKey, _WinAPI_RegCreateKeyEx, _WinAPI_RegOpenKey, _WinAPI_RegOpenKeyEx,
;                                  or RegOpenKeyTransacted function. It can also be one of the following predefined keys:
;                                    $HKEY_CLASSES_ROOT
;                                    $HKEY_CURRENT_CONFIG
;                                    $HKEY_CURRENT_USER
;                                    $HKEY_LOCAL_MACHINE
;                                    $HKEY_USERS
;                                The Unicode version of this function supports the following additional predefined keys:
;                                    $HKEY_PERFORMANCE_TEXT
;                                    $HKEY_PERFORMANCE_NLSTEXT
;                                This parameter can be NULL (use the NULL or 0 to set NULL this parameter, If $hKey is NULL,
;                                  $sSubKey must be contain Full String KeyName, for more see $sSubKey
;                  $sSubKey    - Optional, The name of the registry key to be opened. Key names are not case sensitive.
;                                  This key must be a subkey of the key identified by the $hKey parameter.
;                                  if $hKey is Null this key must be a Full String KeyName, example
;                                    "HKLM\SOFTWARE\Example" or "HKEY_USERS" or "HKEY_CURRENT_USER\Software"
;                                    "\Registry\Machine\SOFTWARE\Example" or "\Registry\User" or "\Registry\User\CurrentUser"
;                                    "MACHINE\Software\Example" or "USERS" or "CURRENT_USER\Software"
;                                    "CLASSES_ROOT\Example" or in a remote registry such as \\ComputerName\CLASSES_ROOT\Example.
;                                  If this parameter is NULL or an empty string, the function returns the same handle that was passed in.
;                  $sValueName - Optional, The name of the value to be set. If a value with this name is not already present in the key, the function adds it to the key.
;                                If $sValueName is NULL or an empty string, "", the function sets the type and data for the key's unnamed or default value.
;                                For more information, see Registry Element Size Limits.
;                                Registry keys do not have default values, but they can have one unnamed value, which can be of any type.
;                  $dwType     - Optional, The type of data pointed to by the lpData parameter. For a list of the possible types, see Registry Value Types.
;                  |$REG_NONE (0)                - No defined value type.
;                  |$REG_SZ (1)                  - (Default) A null-terminated string. This will be either a Unicode or an ANSI string, depending on whether
;                  |                                you use the Unicode or ANSI functions.
;                  |$REG_EXPAND_SZ (2)           - A null-terminated string that contains unexpanded references to environment variables (for example,
;                  |                                "%PATH%"). It will be a Unicode or ANSI string depending on whether you use the Unicode or ANSI functions.
;                  |                                To expand the environment variable references, use the ExpandEnvironmentStrings function.
;                  |$REG_BINARY (3)              - Binary data in any form.
;                  |$REG_DWORD (4)               - A 32-bit number.
;                  |$REG_DWORD_LITTLE_ENDIAN (4) - A 32-bit number in little-endian format.
;                  |                               Windows is designed to run on little-endian computer architectures. Therefore, this value is defined
;                  |                                as REG_DWORD in the Windows header files.
;                  |$REG_DWORD_BIG_ENDIAN (5)    - A 32-bit number in big-endian format. Some UNIX systems support big-endian architectures.
;                  |$REG_LINK (6)                - A null-terminated Unicode string that contains the target path of a symbolic link that was
;                  |                                created by calling the RegCreateKeyEx function with REG_OPTION_CREATE_LINK.
;                  |$REG_MULTI_SZ (7)            - A sequence of null-terminated strings, terminated by an empty string (\0).
;                  |                               The following is an example:
;                  |                                 String1\0String2\0String3\0LastString\0\0
;                  |                                 The first \0 terminates the first string, the second to the last \0 terminates the last string, and the
;                  |                                  final \0 terminates the sequence. Note that the final terminator must be factored into the length of the string.
;                  |$REG_RESOURCE_LIST (8)               - Resource list in the resource map
;                  |$REG_FULL_RESOURCE_DESCRIPTOR (9)    - Resource list in the hardware description
;                  |$REG_RESOURCE_REQUIREMENTS_LIST (10) - Resource list in the hardware description
;                  |$REG_QWORD (11)               - A 64-bit number.
;                  |$REG_QWORD_LITTLE_ENDIAN (11) - A 64-bit number in little-endian format.
;                  |                                Windows is designed to run on little-endian computer architectures. Therefore, this value is defined
;                  |                                 as REG_QWORD in the Windows header files.
; Return values .: If the function succeeds, the return value is ERROR_SUCCESS. If the function fails, the return value is a nonzero error code defined in Winerror.h
; Author ........: DXRW4E
; Modified.......:
; Remarks .......: Calling _WinAPI_RegSetValueEx is an expensive operation that significantly affects system-wide performance as
;                    it consumes disk bandwidth and blocks modifications to all keys by all processes in the registry hive that
;                    is being flushed until the flush operation completes. _WinAPI_RegSetValueEx should only be called xplicitly
;                    ewhen an application must guarantee that registry changes are persisted to disk immediately after modification.
;                    All modifications made to keys are visible to other processes without the need to flush them to disk.
;                  Alternatively, the registry has a 'lazy flush' mechanism that flushes registry modifications to disk at regular
;                    intervals of time. In addition to this regular flush operation, registry changes are also flushed to disk at
;                    system shutdown. Allowing the 'lazy flush' to flush registry changes is the most efficient way to manage registry
;                    writes to the registry store on disk.
;                  The _WinAPI_RegSetValueEx function returns only when all the data for the hive that contains the specified key
;                    has been written to the registry store on disk.
;                  The _WinAPI_RegSetValueEx function writes out the data for other keys in the hive that have been modified since
;                    the last lazy flush or system start.
;                  After _WinAPI_RegSetValueEx returns, use RegCloseKey to close the handle to the registry key.
; Related .......:
; Link ..........:
; Example .......:
; Example .......: _WinAPI_RegSetValue($hKey, Null, "Test", "This is Test", $REG_SZ)
;                  _WinAPI_RegSetValue($HKEY_LOCAL_MACHINE, "SOFTWARE\KeyName", "Test", "This is Test", $REG_SZ)
; Note ..........:
; ===================================================================================================================================
Func _WinAPI_RegSetValueEx(Const ByRef $hKey, $sSubKey = "", $sValueName = "", $bData = "", $dwType = $REG_SZ)
    Switch $dwType
        Case 1, 2, 6  ;; $REG_SZ, $REG_EXPAND_SZ, $REG_LINK
            If Not IsBinary($bData) Then $bData = StringToBinary(StringRegExpReplace(StringRegExpReplace($bData, "\\", "\\\\"), "\x00*+$", "") & Chr(0), 2)
        Case 5  ;; $REG_DWORD_BIG_ENDIAN
            If Not IsBinary($bData) Then $bData = Binary("0x" & Hex($bData, 8))
        Case 7  ;; $REG_MULTI_SZ
            If Not IsBinary($bData) Then $bData = StringToBinary(StringRegExpReplace(StringRegExpReplace(StringRegExpReplace($bData, "\n", Chr(0)), "\\", "\\\\"), "\x00*+$", "") & Chr(0) & Chr(0), 2)
        Case 0 To 11  ;; 0, 3, 4, 8, 9, 10, 11  ;; $REG_NONE, $REG_BINARY, $REG_DWORD, $REG_RESOURCE_LIST, $REG_FULL_RESOURCE_DESCRIPTOR, $REG_RESOURCE_REQUIREMENTS_LIST, $REG_QWORD
            ;;
        Case Else
            Return SetError(2, 0, 87)
    EndSwitch
    Local $cbData = ($dwType = 11 ? 8 : BinaryLen($bData)), $pData = DllStructCreate("BYTE[" & $cbData & "]")
    DllStructSetData($pData, 1, $bData)
    If $sSubKey Then
        Local $_hKey = _WinAPI_RegCreateKeyEx($hKey, $sSubKey, 2, 0) ;; $dwOptions = (IsDeclared("iTokenPrivilegesState") ? 4 : 0), $samDesired = 2 ;; $KEY_SET_VALUE = 0x0002
        If @Error Then Return SetError(@Error, @Extended, "")
        $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegSetValueExW", "ULONG_PTR", $_hKey, "WSTR", $sValueName, "DWORD", 0, "DWORD", $dwType, "STRUCT*", $pData, "DWORD", $cbData)
        SetError(@Error + DllCall($hAdvapi32Dll, "LONG", "RegCloseKey", "ULONG_PTR", $_hKey))
    Else
        $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegSetValueExW", "ULONG_PTR", $hKey, "WSTR", $sValueName, "DWORD", 0, "DWORD", $dwType, "STRUCT*", $pData, "DWORD", $cbData)
    EndIf
    If @Error Then Return SetError(1, 0, -@Error)
    ;;_ArrayDisplay($arDllCall, "_WinAPI_RegSetValueEx")
    Return SetError($arDllCall[0], 0, $arDllCall[0])
EndFunc


; #FUNCTION# ========================================================================================================================
; Name...........: _WinAPI_RegQueryValueEx
; Description ...: Retrieves the type and data for the specified value name associated with an open registry key.
; Syntax.........: _WinAPI_RegQueryValueEx($hKey[, $sSubKey[, $sValueName[, $samDesired]]])
; Parameters ....: $hKey       - A handle to an open registry key. The key must have been opened with the KEY_QUERY_VALUE access right.
;                                  For more information, see Registry Key Security and Access Rights.
;                                This handle is returned by the _WinAPI_RegCreateKey, _WinAPI_RegCreateKeyEx, _WinAPI_RegOpenKey, _WinAPI_RegOpenKeyEx,
;                                  It can also be one of the following predefined keys:
;                                        $HKEY_CLASSES_ROOT
;                                        $HKEY_CURRENT_CONFIG
;                                        $HKEY_CURRENT_USER
;                                        $HKEY_LOCAL_MACHINE
;                                        $HKEY_PERFORMANCE_DATA
;                                        $HKEY_PERFORMANCE_NLSTEXT
;                                        $HKEY_PERFORMANCE_TEXT
;                                        $HKEY_USERS
;                                This parameter can be NULL (use the NULL or 0 to set NULL this parameter, If $hKey is NULL,
;                                  $sSubKey must be contain Full String KeyName, for more see $sSubKey
;                  $sSubKey    - Optional, The name of the registry key to be opened. Key names are not case sensitive.
;                                  This key must be a subkey of the key identified by the $hKey parameter.
;                                  if $hKey is Null this key must be a Full String KeyName, example
;                                    "HKLM\SOFTWARE\Example" or "HKEY_USERS" or "HKEY_CURRENT_USER\Software"
;                                    "\Registry\Machine\SOFTWARE\Example" or "\Registry\User" or "\Registry\User\CurrentUser"
;                                    "MACHINE\Software\Example" or "USERS" or "CURRENT_USER\Software"
;                                    "CLASSES_ROOT\Example" or in a remote registry such as \\ComputerName\CLASSES_ROOT\Example.
;                                  If this parameter is NULL or an empty string, the function returns the same handle that was passed in.
;                  $sValueName - Optional, The name of the registry value.
;                                  If $sValueName is NULL or an empty string, "", the function retrieves the type and data for the key's
;                                    unnamed or default value, if any.
;                                  If $sValueName specifies a value that is not in the registry, the function returns ERROR_FILE_NOT_FOUND.
;                                  Keys do not automatically have an unnamed or default value. Unnamed values can be of any type. For more information,
;                                    see Registry Element Size Limits http://msdn.microsoft.com/en-us/library/windows/desktop/ms724872(v=vs.85).aspx
;                  $samDesired - Optional, An access mask the specifies the platform-specific view of the registry.
;                  |  These flags are ignored by 32-bit Windows
;                  |$KEY_WOW64_64KEY (256) - operate on the 64-bit registry view
;                  |$KEY_WOW64_32KEY (512) - operate on the 32-bit registry view
; Return values .: If the function succeeds, the return value is String or INT or Binary, and set error code ERROR_SUCCESS
;                    and set Extended code dwValueType
;                    @Extended: $REG_NONE (0)
;                               $REG_SZ (1)
;                               $REG_EXPAND_SZ (2)
;                               $REG_BINARY (3)
;                               $REG_DWORD (4) - $REG_DWORD_LITTLE_ENDIAN (4)
;                               $REG_DWORD_BIG_ENDIAN (5)
;                               $REG_LINK (6)
;                               $REG_MULTI_SZ (7)
;                               $REG_RESOURCE_LIST (8)
;                               $REG_FULL_RESOURCE_DESCRIPTOR (9)
;                               $REG_RESOURCE_REQUIREMENTS_LIST (10)
;                               $REG_QWORD (11) - $REG_QWORD_LITTLE_ENDIAN (11)
;                  If the function fails, the return value is a None '', and set nonzero error code
;                    @Error: -1 = unable to use the DLL file,
;                            -2 = unknown "return type",
;                            -3 = "function" not found in the DLL file,
;                            -4 = bad number of parameters,
;                            -5 = bad parameter.
;                            0+ = error code defined in WinError.h
; Author ........: DXRW4E
; Modified.......:
; Remarks .......: An application typically calls _WinAPI_RegEnumValue to determine the value names and then
;                    _WinAPI_RegQueryValueEx to retrieve the data for the names.
;                  If the data has the REG_SZ, REG_MULTI_SZ or REG_EXPAND_SZ type, the string may not have been stored
;                    with the proper terminating null characters. Therefore, even if the function returns ERROR_SUCCESS,
;                    the application should ensure that the string is properly terminated before using it; otherwise, it
;                    may overwrite a buffer. (Note that REG_MULTI_SZ strings should have two terminating null characters.)
;                    One way an application can ensure that the string is properly terminated is to use RegGetValue, which
;                    adds terminating null characters if needed.
;                  When calling the _WinAPI_RegQueryValueEx function with $hKey set to the HKEY_PERFORMANCE_DATA handle and
;                    a value string of a specified object, the returned data structure sometimes has unrequested objects.
;                    Do not be surprised; this is normal behavior. When calling the _WinAPI_RegQueryValueEx function, you
;                    should always expect to walk the returned data structure to look for the requested object.
;                  Note that operations that access certain registry keys are redirected. For more information,
;                    see Registry Virtualization and 32-bit and 64-bit Application Data in the Registry.
; Related .......:
; Link ..........:
; Example .......:
; Example .......: _WinAPI_RegQueryValueEx($hKey, Null, "Test")
;                  _WinAPI_RegQueryValueEx($HKEY_LOCAL_MACHINE, "SOFTWARE\KeyName", "Test")
; Note ..........:
; ===================================================================================================================================
Func _WinAPI_RegQueryValueEx($hKey, $sSubKey = "", $sValueName = "", $samDesired = 0)
    Local $pData = DllStructCreate("BYTE[4096]")
    If $sSubKey Then
        If Not $hKey Then $hKey = _RegGetPredefinedKeyEx($sSubKey, $samDesired)
        $hKey = _WinAPI_RegOpenKeyEx($hKey, $sSubKey, 1 + BitAND($samDesired, 768)) ;; $KEY_QUERY_VALUE = 0x0001
        If @Error Then Return SetError(1, @Extended, "")
    EndIf
    $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegQueryValueExW", "ULONG_PTR", $hKey, "WSTR", $sValueName, "DWORD", 0, "DWORD*", 0, "STRUCT*", $pData, "DWORD*", 4096)
    If @Error Then Return SetError(3, -@Error + ($sSubKey ? DllCall($hAdvapi32Dll, "LONG", "RegCloseKey", "ULONG_PTR", $hKey) : 0), "")
    If $arDllCall[6] > 4096 Then
        $pData = DllStructCreate("BYTE[" & $arDllCall[6] & "]")
        $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegQueryValueExW", "ULONG_PTR", $hKey, "WSTR", $sValueName, "DWORD", 0, "DWORD*", 0, "STRUCT*", $pData, "DWORD*", $arDllCall[6])
    EndIf
    If $sSubKey Then DllCall($hAdvapi32Dll, "LONG", "RegCloseKey", "ULONG_PTR", $hKey)
    ;;_ArrayDisplay($arDllCall, "_WinAPI_RegQueryValueEx")
    If $arDllCall[0] Then Return SetError(2, $arDllCall[0], "")
    Switch $arDllCall[4]
        Case 1, 2, 6  ;; $REG_SZ, $REG_EXPAND_SZ, $REG_LINK
            Return SetExtended($arDllCall[4], BinaryToString(BinaryMid(DllStructGetData($pData, 1), 1, $arDllCall[6]), 2))
        Case 7  ;; $REG_MULTI_SZ
            Return SetExtended($arDllCall[4], StringRegExpReplace(BinaryToString(BinaryMid(DllStructGetData($pData, 1), 1, $arDllCall[6]), 2), "\x00+", @LF))
        Case 4  ;; $REG_DWORD, $REG_DWORD_LITTLE_ENDIAN
            Return SetExtended($arDllCall[4], DllStructGetData(DllStructCreate("DWORD", DllStructGetPtr($pData, 1)), 1)) ;; Or Dec(StringRegExpReplace(BinaryMid(DllStructGetData($pData, 1), 1, 4), "^..(..)(..)(..)(..)","$4$3$2$1"), 1)
        Case 5  ;; $REG_DWORD_BIG_ENDIAN
            Return SetExtended($arDllCall[4], Dec(StringMid(BinaryMid(DllStructGetData($pData, 1), 1, $arDllCall[6]), 3, 8), 1)) ;; Or Number(StringLeft(DllStructGetData($pData, 1), 10), 3)
        Case 11  ;; $REG_QWORD, $REG_QWORD_LITTLE_ENDIAN
            Return SetExtended($arDllCall[4], DllStructGetData(DllStructCreate("UINT64", DllStructGetPtr($pData, 1)), 1))  ;; Or Dec(StringRegExpReplace(BinaryMid(DllStructGetData($pData, 1), 1, 8), "^..(..)(..)(..)(..)(..)(..)(..)(..)","0x$8$7$6$5$4$3$2$1"), 2)
        Case Else ;; 0 To 11 ;; 0, 3, 8, 9, 10 ;; $REG_NONE, $REG_BINARY, $REG_RESOURCE_LIST, $REG_FULL_RESOURCE_DESCRIPTOR, $REG_RESOURCE_REQUIREMENTS_LIST
            Return SetExtended($arDllCall[4], BinaryMid(DllStructGetData($pData, 1), 1, $arDllCall[6]))
    EndSwitch

;~  Local $pData
;~  If $sSubKey Then
;~      If Not $hKey Then $hKey = _RegGetPredefinedKeyEx($sSubKey, $samDesired)
;~      $hKey = _WinAPI_RegOpenKeyEx($hKey, $sSubKey, 1 + BitAND($samDesired, 768), (IsDeclared("iTokenPrivilegesState") ? 4 : 0)) ;; $KEY_QUERY_VALUE = 0x0001
;~      If @Error Then Return SetError(1, @Extended, "")
;~  EndIf
;~  $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegQueryValueExW", "ULONG_PTR", $hKey, "WSTR", $sValueName, "DWORD", 0, "DWORD*", 0, "PTR", Null, "DWORD*", 0)
;~  If @Error Then Return SetError(-@Error, ($sSubKey ? DllCall($hAdvapi32Dll, "LONG", "RegCloseKey", "ULONG_PTR", $hKey) : 0), "")
;~  Switch $arDllCall[4]
;~      Case 1, 2, 6  ;; $REG_SZ, $REG_EXPAND_SZ, $REG_LINK
;~          $pData = DllStructCreate("WCHAR[" & $arDllCall[6] & "]")
;~      Case 4  ;; $REG_DWORD, $REG_DWORD_LITTLE_ENDIAN
;~          $pData = DllStructCreate("DWORD")
;~      Case 11  ;; $REG_QWORD, $REG_QWORD_LITTLE_ENDIAN
;~          $pData = DllStructCreate("UINT64")
;~      Case Else ;; 0 To 11 ;; 0, 3, 8, 9, 10 ;; $REG_NONE, $REG_BINARY, $REG_RESOURCE_LIST, $REG_FULL_RESOURCE_DESCRIPTOR, $REG_RESOURCE_REQUIREMENTS_LIST
;~          $pData = DllStructCreate("BYTE[" & $arDllCall[6] & "]")
;~  EndSwitch
;~  $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegQueryValueExW", "ULONG_PTR", $hKey, "WSTR", $sValueName, "DWORD", 0, "DWORD*", 0, "STRUCT*", $pData, "DWORD*", $arDllCall[6])
;~  If $sSubKey Then DllCall($hAdvapi32Dll, "LONG", "RegCloseKey", "ULONG_PTR", $hKey)
;~  If $arDllCall[0] Then Return SetError($arDllCall[0], 0, "")
;~  If $arDllCall[4] = 7 Then Return SetError($arDllCall[0], 0, StringRegExpReplace(BinaryToString(DllStructGetData($pData, 1), 2), "\x00+", @LF))
;~  If $arDllCall[4] = 5 Then Return SetError($arDllCall[0], $arDllCall[4], Dec(StringMid(BinaryMid(DllStructGetData($pData, 1), 1, $arDllCall[6]), 3, 8), 1))
;~  Return DllStructGetData($pData, 1)
EndFunc   ;==>_WinAPI_RegQueryValueEx


Func _WinAPI_RegCloseKey(Const ByRef $hKey)
    $arDllCall = DllCall($hAdvapi32Dll, "LONG", "RegCloseKey", "ULONG_PTR", $hKey)
    If @Error Then Return SetError(@Error, 1, 0)
    Return SetError($arDllCall[0], 0, 0)
EndFunc


; #FUNCTION# ====================================================================================================================
; Name...........: _RegGetPredefinedKeyEx
; Description ...: Get HKEY Handle\KeyName\ObjectName
; Syntax.........: _RegGetPredefinedKeyEx(ByRef $szKey, ByRef $iType[, $iFlags])
; Parameters ....: $szKey  - HKEY Name
;                  $iType  - A mask that specifies the access rights for the key
;                  $iFlags - Optional
;                  |0 - (Default) Return $iPredefinedKey
;                  |1 - Return HKEY String for Inf File (AddReg\DelReg Directive)
;                  |2 - Return SE_REGISTRY_KEY String for SDDL (StringSecurityDescriptorEx)
;                  |3 - Return KEY ObjectName String (Registry Key Object Routines)
; Return values .: HKEY Handle\KeyName\ObjectName
; Author ........: DXRW4E
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......:
; ===============================================================================================================================
Func _RegGetPredefinedKeyEx(ByRef $szKey, ByRef $iType, $iFlags = 0)
    ;;Static Local $HKEY_PREDEFINED[11][6] = [[0x80000000,"HKCR","CLASSES_ROOT","\Registry\Machine\SOFTWARE\Classes","HKEY_CLASSES_ROOT","HKCR"],[0x80000001,"HKCU","CURRENT_USER","\Registry\User\CurrentUser","HKEY_CURRENT_USER","HKCU"],[0x80000002,"HKLM","MACHINE","\Registry\Machine","HKEY_LOCAL_MACHINE","HKLM"],[0x80000003,"HKU","USERS","\Registry\User","HKEY_USERS","HKU"],[0x80000005,"HKLM","MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current","\Registry\Machine\SYSTEM\CurrentControlSet\Hardware Profiles\Current","HKEY_CURRENT_CONFIG","HKCC"],[0x80000007,"HKCU","CURRENT_USER\Software\Classes\Local Settings","\Registry\User\CurrentUser\Software\Classes\Local Settings","HKEY_CURRENT_USER_LOCAL_SETTINGS","HKLS"],[0x80000004,"HKPD","PERFORMANCE_DATA\","","HKEY_PERFORMANCE_DATA","HKPD"],[0x80000006,"HKDD","DYN_DATA\","","HKEY_DYN_DATA","HKDD"],[0x80000050,"HKPT","PERFORMANCE_TEXT\","","HKEY_PERFORMANCE_TEXT","HKPT"],[0x80000060,"HKPN","PERFORMANCE_NLSTEXT\","","HKEY_PERFORMANCE_NLSTEXT","HKPN"],[0,";",0,""]]
    $iFlags = BitAND($iFlags, 3)
    Local $ahKey = StringRegExp($szKey, "^[\h\\]*+([^\W\d]*+)((?:32|64)?+(?!\w))\\*+(.*)", 1)
    If @Error Then Return SetError(1, 0, $HKEY_PREDEFINED[10][$iFlags])
    Switch $ahKey[0]
        Case "HKCR","HKEY_CLASSES_ROOT", "CLASSES_ROOT";, "MACHINE\SOFTWARE\Classes"
            $ahKey[0] = 0
        Case "HKCU", "HKEY_CURRENT_USER", "CURRENT_USER"
            $ahKey[0] = 1
        Case "HKLM", "HKEY_LOCAL_MACHINE", "MACHINE"
            $ahKey[0] = 2
        Case "HKU", "HKEY_USERS", "USERS"
            $ahKey[0] = 3
        Case "HKCC", "HKEY_CURRENT_CONFIG";, "MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current"
            $ahKey[0] = 4
            If $iFlags = 1 Then $ahKey[2] = "SYSTEM\CurrentControlSet\Hardware Profiles\Current" & StringRegExpReplace($ahKey[2], "^.", "\\$0")
        Case "HKLS", "HKEY_CURRENT_USER_LOCAL_SETTINGS";, "CURRENT_USER\Software\Classes\Local Settings"
            $ahKey[0] = 5
            If $iFlags = 1 Then $ahKey[2] = "Software\Classes\Local Settings" & StringRegExpReplace($ahKey[2], "^.", "\\$0")
        Case "HKPD", "HKEY_PERFORMANCE_DATA"
            $ahKey[0] = 6
        Case "HKDD", "HKEY_DYN_DATA"
            $ahKey[0] = 7
        Case "HKPT", "HKEY_PERFORMANCE_TEXT"
            $ahKey[0] = 8
        Case "HKPN", "HKEY_PERFORMANCE_NLSTEXT"
            $ahKey[0] = 9
        Case "Registry"
            $ahKey = StringRegExp($ahKey[2], "(?i)^(?|(Machine)((?:\\+SYSTEM\\+CurrentControlSet\\+Hardware Profiles\\+Current(?!\w)|\\+SOFTWARE\\+Classes(?!\w))?+)|User((?:\\+CurrentUser(?!\w)|\\+S-1-5-\d+-\d+-\d+-\d+-\d+)?+)((?:\\+Software\\+Classes\\+Local Settings(?!\w)|\\+_CLASSES\\+Local Settings(?!\w)|\\+_CLASSES(?!\w))?+))\\*(.*)", 1)
            If @Error Then Return SetError(1, 0, $HKEY_PREDEFINED[10][$iFlags])
            If $ahKey[0] = "Machine" Then
                $ahKey[0] = Not $ahKey[1] ? 2 : (StringRegExp($ahKey[1], "(?i)^\\+SO") ? 0 : 4)
                If $ahKey[0] = 4 And $iFlags = 1  Then $ahKey[2] = "SYSTEM\CurrentControlSet\Hardware Profiles\Current" & StringRegExpReplace($ahKey[2], "^.", "\\$0")
            Else
                $ahKey[0] = Not $ahKey[0] ? 3 : (StringRight($ahKey[1], 2) = "gs" ? 5 : 1)
                If ($ahKey[0] = 5 And $iFlags = 1) Or ($ahKey[1] And $ahKey[0] = 3) Then $ahKey[2] = "Software\Classes" & ($ahKey[0] = 5 ? "\Local Settings" : "") & StringRegExpReplace($ahKey[2], "^.", "\\$0")
            EndIf
        Case Else
            If $iFlags = 2 Then $iType = ($iType = 12) ? $SE_REGISTRY_WOW64_32KEY : $SE_REGISTRY_KEY
            If $iFlags = 2 Or Not StringRegExp($szKey, "^\h*\\+[^\\]+\\+") Then Return SetError(1, 0, $HKEY_PREDEFINED[10][$iFlags])
            $ahKey[0] = StringRegExpReplace($szKey, "^\h*\\+[^\\]+\\+", "")
            $ahKey[1] = _RegGetPredefinedKeyEx($ahKey[0], $iType, $iFlags)
            If Not @Error Then $szKey = $ahKey[0]
            Return SetError(@Error, 0, $ahKey[1])
    EndSwitch
    If $iFlags = 2 Then
        $iType = ($ahKey[1] == "32") ? $SE_REGISTRY_WOW64_32KEY : $SE_REGISTRY_KEY
        $szKey = $HKEY_PREDEFINED[$ahKey[0]][$iFlags] & StringRegExpReplace($ahKey[2], "^.", "\\$0")
        Return $szKey
    ElseIf $iFlags = 3 Then
        If $ahKey[0] > 5 Then Return SetError(1, 0, "")
        Return $HKEY_PREDEFINED[$ahKey[0]][$iFlags] & StringRegExpReplace($ahKey[2], "^.", "\\$0")
    Else
        ;;If $ahKey[1] Then $iType = BitOR($iType, ($ahKey[1] == "32" ? $KEY_WOW64_32KEY : $KEY_WOW64_64KEY))
        If $ahKey[1] Then $iType = BitXOR(BitOR($iType, $KEY_WOW64_RES), ($ahKey[1] == "32" ? $KEY_WOW64_64KEY : $KEY_WOW64_32KEY))
        $szKey = Not $ahKey[2] ? Null : $ahKey[2]
        Return $HKEY_PREDEFINED[$ahKey[0]][$iFlags]
    EndIf
EndFunc

and I do not understand why the REG_DWORD_BIG_ENDIAN is not enabled, and all other RegType are just binary, I think it would be good autoit know them all, and return the Binary for all other, and users if they want will  use structure as http://msdn.microsoft.com/en-us/library/windows/hardware/ff541994%28v=vs.85%29.aspx or whoever it is etc etc, autoit need only return binary nothing else

XP now is dead, why not set that autoit work by default as a backup application, I mean to set the default SE_RESTORE_NAME, SE_BACKUP_NAME, SE_SECURITY_NAME, SE_TAKE_OWNERSHIP_NAME, SE_DEBUG_NAME, SE_CREATE_SYMBOLIC_LINK_NAME, and all native files and registry function using the Backup flag option (FILE_FLAG_BACKUP_SEMANTICS & REG_OPTION_BACKUP_RESTORE), after those who use the #RequireAdmin do not need more to check for file or registry permisson etc etc

Sorry for my english

Ciao.

Edited by DXRW4E

apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

Share this post


Link to post
Share on other sites
Jon

Jon,

I'm not sure if it's a desired report.

 

The following snippet runs 25% ~ 40% slower in the current Beta when comparing to latest Stable.

Found the regression, and also an improvement, so the next beta will be faster than stable.

Share this post


Link to post
Share on other sites
czardas

But I promise not arguing (again) about the case below

ConsoleWrite(VarGetType("17" / 1) & @CRLF)

 

I haven't tested this, but I am of the opinion that the minimum prerequisite really ought to take precedence. I have previously attempted to argue this case in spite of serious opposition. To me it seems that treating division as being any different from multiplication is plain wrong. The two could be considered juxtaposed, but in reality they are exactly the same function. 17/1 is an integer, and the minimum data type prerequisite would be int-32.

Edited by czardas

Share this post


Link to post
Share on other sites
jchd

I (partly) agree but please Shhhhh!

Edited by jchd
  • Like 1

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
jpm

Not sure if it is a regression as math on keyword have change

Local $e = default - true

use to set $e to -2

now it is -1

Cheers

Share this post


Link to post
Share on other sites
guinness

I thought Jon changed Default to 0 and not -1 anymore when parsed using Int? So that result of -1 is correct.

$e = Int(Default) - Int(True)
ConsoleWrite($e & @CRLF) ; I don't see this as a regression as it's present in the stable version.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
czardas

Does anyone do maths with the Default keyword? It is neither True nor False. Perhaps the value ought to be something between 0 and 1. ==> Default -True =  - 0.5

Edited by czardas

Share this post


Link to post
Share on other sites
guinness

Does anyone do maths with the Default keyword? It is neither True nor False. Perhaps the value ought to be something between 0 and 1.

Default and False are 0 and True is 1. So they are between 0 and 1.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
czardas

guinness I didn't understand that, or perhaps you misundertood what I said. I added an example to my post.

Edited by czardas

Share this post


Link to post
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
Sign in to follow this  

×