1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) INRIA - Allan CORNET
6 * This file must be used under the terms of the CeCILL.
7 * This source file is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at
10 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
13 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="winqueryreg">
15 <refname>winqueryreg</refname>
16 <refpurpose>Get item from Microsoft Windows
17 registry (Windows only)
21 <title>Calling Sequence</title>
23 value = winqueryreg('name', 'rootkey','subkey')
24 value = winqueryreg('key', 'rootkey','subkey')
25 value = winqueryreg('rootkey', 'subkey','valname')
26 value = winqueryreg('rootkey','subkey')
30 <title>Description</title>
32 value = winqueryreg('name', 'rootkey', 'subkey') returns the values names
33 in <literal>rootkey\subkey</literal> in a matrix of strings. The first argument
34 is the literal quoted string, 'name'.
36 <para>If the data retrieved from the registry is a string, winqueryreg
37 returns a string. If the data is a 32-bit integer, winqueryreg returns
38 the data as an integer (int32).
41 value = winqueryreg('key', 'rootkey', 'subkey') returns the keys names
42 in <literal>rootkey\subkey</literal> in a matrix of strings. The first argument
43 is the literal quoted string, 'key'.
45 <para>value = winqueryreg('rootkey', 'subkey', 'valname') returns the data
46 for value valname in <literal>rootkey\subkey</literal>.
48 <para>value = winqueryreg('rootkey', 'subkey') returns a data in
49 <literal>rootkey\subkey</literal> that has no value name property.
52 <literal>Note</literal>The literal name argument, key argument and the rootkey argument
53 are case-sensitive. The subkey and valname arguments are not.
55 <para>supported root keys are: 'HKEY_CLASSES_ROOT', 'HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE', 'HKEY_USERS', 'HKEY_DYN_DATA' and 'HKEY_CURRENT_CONFIG'.</para>
56 <para>and shortcut names: 'HKCR', 'HKCU', 'HKLM', 'HKU', 'HKDD' and 'HKCC'.</para>
59 <title>Examples</title>
60 <programlisting role="example">
62 if getos() == 'Windows' then
63 winqueryreg 'HKEY_LOCAL_MACHINE' 'HARDWARE\DESCRIPTION\System\CentralProcessor\0\' 'ProcessorNameString'
65 mousechar = winqueryreg('name', 'HKEY_CURRENT_USER','control panel\mouse');
68 setting = winqueryreg('HKEY_CURRENT_USER','control panel\mouse', mousechar(k));
69 if (mousechar(k)=='') then mousechar(k)='default';,end
70 str = msprintf('%s = %s', mousechar(k), string(setting));
74 winqueryreg('HKEY_CURRENT_CONFIG', 'Software\Fonts\','LogPixels')
75 winqueryreg('key' ,'HKLM', 'Software\Microsoft\.NETFramework')
81 <title>History</title>
84 <revnumber>5.4.0</revnumber>
85 <revremark>This function also manages 'HKEY_CURRENT_CONFIG' key.</revremark>
88 <revnumber>5.4.1</revnumber>
89 <revremark>Manage shorcut root names.</revremark>
90 <revremark>Can retrieve key list names.</revremark>