Size: 2355
Comment:
|
Size: 2699
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= Dealing with the Windows Registry = {{{WinReg}}} is part of the CategoryAplApl project. |
= WinReg: dealing with the Windows Registry = {{{WinReg}}} is part of the CategoryAplTree project. |
Line 8: | Line 7: |
This class offers methods useful to deal with the Windows Registry without using .NET. It uses `⎕NA` calls to the appropriate Windows API. | |
Line 9: | Line 9: |
This class offers methods useful to deal with the Windows Registry without using .NET. | `WinReg` is a powerful class that offers plenty of methods. If you just want to read, write and/or delete values from the Windows Registry then the much smaller class [[WinRegSimple]] might be sufficient. |
Line 12: | Line 12: |
To understand the names of the methods you need to understand the terminology. If you find the terminology strange: so do I, but it was invented by Microsoft and got widely accepted. That is the reason why I decided to go for it: it makes it easier to understand others while talking about the Windows Registry. |
To understand the names of the methods you need to understand the terminology. If you find the terminology strange: so do I, but it was invented by Microsoft and therefore defines the standard. That is the reason why I decided to go for it: it makes it easier to understand the Microsoft documentation but also to understand others while talking about the Windows Registry. |
Line 17: | Line 16: |
[[attachment:EditReg.jpg|{{attachment:EditReg.jpg}}]] | [[attachment:EditReg.jpg|{{attachment:EditReg.jpg|attachment:EditReg.jpg}}]] |
Line 19: | Line 18: |
you can see that this string is visible in the top of the window: | you can see this string: |
Line 23: | Line 22: |
at the top of the window. |
|
Line 24: | Line 25: |
This is called a "Main key". There is a particular number of pre-defined main keys available you can choose from. For the most important one from an application programmers view there is also a shortcut available: Instead of '''HKEY_CURRENT_USER''' you can use '''HKCU'''. |
This is called a "Main key". There are a number of pre-defined main keys available you can choose from. There is also a shortcut available: instead of '''HKEY_CURRENT_USER''' you can use '''HKCU'''. |
Line 28: | Line 28: |
This is called a '''sub key'''. | |
Line 29: | Line 30: |
This is called a '''subkey'''. | On the right side you see a list. The entries in this list are called "values". Therefore '''!CancelKey1''' is a value. |
Line 31: | Line 32: |
On the right side you see a list. The entries in this list are called "value". '''!CancelKey1''' is there a value. The actual data saved under this value is called "data". | Note that the '''''names''''' are called values; the actual data saved under a value is called "data". |
Line 34: | Line 36: |
Line 36: | Line 37: |
Close CopyTree |
|
Line 37: | Line 40: |
DeleteSubKeyTree | |
Line 40: | Line 44: |
Close CopyTree Copyright DeleteSubKey DeleteSubKeyTree DeleteValue DoesKeyExist DoesValueExist GetAllSubKeyNames GetAllValueNames GetAllValues GetDyalogRegPath GetErrorAsStringFrom |
|
Line 41: | Line 58: |
GetTree GetTreeWithValues GetTypeAsStringFrom |
|
Line 42: | Line 62: |
History KeyInfo ListError ListReg OpenAndCreateKey OpenKey PutBinary |
|
Line 44: | Line 71: |
Version | ReadByte |
Line 47: | Line 74: |
== History == | == Restrictions == |
Line 49: | Line 76: |
For a full version history: [[WinReg/History| History]] | Note the following restrictions: |
Line 51: | Line 78: |
== Version Information == | * `PutValue` supports DWORDs (REG_DWORD) * `PutBinary` supports REG_BINARY * `PutString` and `GetString` support strings (REG_SZ), nested strings (REG_MULTI_SZ) and expanded strings (REG_EXPAND_SZ) * `GetValue` supports all data types. |
Line 53: | Line 83: |
||Original author:||KaiJaeger|| ||Responsible:||KaiJaeger|| ||Email:||kai@aplteam.com|| ||Current state:||1.0|| |
Other data types can be requested via `GetValue`; however, writing them is not supported. |
Line 58: | Line 85: |
== Download == You have two options: you can either download the script for usage: [[http://aplteam2.com/aplwiki/WinReg?action=AttachFile&do=get&target=WinReg.ZIP | Download WinReg script right now]] or get the whole thing from the AplWikiRepository, including the development workspace and the script and maybe more for any development or for running the test cases: {{{ svn list svn://aplteam2.com/os/dyalog/WinReg/tags }}} If you plan to contribute please note that all stuff published as part of the APLAPL project must follow certain [[AplAplStandards|APLAPL-specific standards]]. |
<<Include(APLTreeDownloads)>> |
Line 74: | Line 88: |
CategoryAplApl | CategoryAplTree |
WinReg: dealing with the Windows Registry
WinReg is part of the CategoryAplTree project.
Contents
Overview
This class offers methods useful to deal with the Windows Registry without using .NET. It uses ⎕NA calls to the appropriate Windows API.
WinReg is a powerful class that offers plenty of methods. If you just want to read, write and/or delete values from the Windows Registry then the much smaller class WinRegSimple might be sufficient.
Terminology
To understand the names of the methods you need to understand the terminology. If you find the terminology strange: so do I, but it was invented by Microsoft and therefore defines the standard. That is the reason why I decided to go for it: it makes it easier to understand the Microsoft documentation but also to understand others while talking about the Windows Registry.
In this picture:
you can see this string:
HKEY_CURRENT_USER\Software\Dyalog\Dyalog APL/W 12.0 Unicode\AutoComplete
at the top of the window.
HKEY_CURRENT_USER
This is called a "Main key". There are a number of pre-defined main keys available you can choose from. There is also a shortcut available: instead of HKEY_CURRENT_USER you can use HKCU.
SOFTWARE\Dyalog\Dyalog APL/W 12.0 Unicode
This is called a sub key.
On the right side you see a list. The entries in this list are called "values". Therefore CancelKey1 is a value.
Note that the names are called values; the actual data saved under a value is called "data".
Shared Methods
Close CopyTree DeleteSubKey DeleteSubKeyTree DeleteValue DoesKeyExist DoesValueExist Close CopyTree Copyright DeleteSubKey DeleteSubKeyTree DeleteValue DoesKeyExist DoesValueExist GetAllSubKeyNames GetAllValueNames GetAllValues GetDyalogRegPath GetErrorAsStringFrom GetString GetTree GetTreeWithValues GetTypeAsStringFrom GetValue History KeyInfo ListError ListReg OpenAndCreateKey OpenKey PutBinary PutString PutValue ReadByte
Restrictions
Note the following restrictions:
PutValue supports DWORDs (REG_DWORD)
PutBinary supports REG_BINARY
PutString and GetString support strings (REG_SZ), nested strings (REG_MULTI_SZ) and expanded strings (REG_EXPAND_SZ)
GetValue supports all data types.
Other data types can be requested via GetValue; however, writing them is not supported.