<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[RegEnumValue liest nicht alle Werte]]></title><description><![CDATA[<p>sodele jetzt meld ich mich nach einer ganzen weile mal wieder zurück.<br />
folgenden Code habe ich geschrieben:</p>
<pre><code class="language-cpp">//------------------------------------------------------------------------------
#pragma hdrstop
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;windows.h&gt;
#include &lt;conio.h&gt;
//------------------------------------------------------------------------------
const HKEY HLM = HKEY_LOCAL_MACHINE;
const HKEY HCR = HKEY_CLASSES_ROOT;
const HKEY HCU = HKEY_CURRENT_USER;
const HKEY HU  = HKEY_USERS;
const MAX_PATH_ME = 500;

struct my_datatype
	{
	char Pfad[MAX_PATH_ME];
	};
//------------------------------------------------------------------------------
void scan_reg(HKEY section,char *key);
//------------------------------------------------------------------------------
int main(int argc, char* argv[])
{
	scan_reg(HLM,&quot;\0&quot;);

     getch();
	return 0;
}
//------------------------------------------------------------------------------
void scan_reg(HKEY section,char *key)
{
	HKEY hKey;
	char keyName[MAX_PATH];

     my_datatype *pfad=new my_datatype[5000];

	if( RegOpenKeyEx(section, key, 0, KEY_ALL_ACCESS, &amp;hKey ) == ERROR_SUCCESS )
	{
		for(long i=0; RegEnumKey(hKey, i, keyName, MAX_PATH) == ERROR_SUCCESS; i++)
		{
			char key_long[MAX_PATH]=&quot;&quot;;
			char val[500]=&quot;&quot;;
			char val_val[500]=&quot;&quot;;

			strcat(key_long,key);  //alten string anhängen

			if(strcmp(key,&quot;\0&quot;)!=0)strcat(key_long,&quot;\\&quot;);  // backslash hinzufügen wenn der key nicht 0 ist (Stammkey)

			strcat(key_long,keyName);  //neuen string anhängen

			//printf(&quot;%s\n&quot;,key_long);

			HKEY subKey;
			DWORD length=500;
			DWORD typ=REG_BINARY;

			if(RegOpenKeyEx(section, key_long, 0, KEY_ALL_ACCESS, &amp;subKey) == ERROR_SUCCESS)
			{

				for(long b=0; RegEnumValue(subKey, b, val, &amp;length, 0, 0, val_val, &amp;length) == ERROR_SUCCESS; b++)
				{
					printf(&quot;%s - %s\n&quot;,val,val_val);

				}

			}
			scan_reg(section,key_long); // mit neuem string ausführen
		}

	    RegCloseKey(hKey);
	}
	delete[] pfad;
}
//------------------------------------------------------------------------------
</code></pre>
<p>allerdings liest der mir nicht alle reg schlüssel, sondern nur bestimmte, was ja nicht sein kann, da REG_BINARY gesetzt ist. (auch andere werte bringen keine besseren ergebnisse) lasst euch nicht von bestimmten sachen beinflussen, das programm ist noch net fertig und unnötiges zeug is auch drinne. bin ja noch ein nap, der zeug testen muss <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>MfG Radiation2k5</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/107271/regenumvalue-liest-nicht-alle-werte</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 00:58:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/107271.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Apr 2005 09:16:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to RegEnumValue liest nicht alle Werte on Mon, 18 Apr 2005 09:16:39 GMT]]></title><description><![CDATA[<p>sodele jetzt meld ich mich nach einer ganzen weile mal wieder zurück.<br />
folgenden Code habe ich geschrieben:</p>
<pre><code class="language-cpp">//------------------------------------------------------------------------------
#pragma hdrstop
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;windows.h&gt;
#include &lt;conio.h&gt;
//------------------------------------------------------------------------------
const HKEY HLM = HKEY_LOCAL_MACHINE;
const HKEY HCR = HKEY_CLASSES_ROOT;
const HKEY HCU = HKEY_CURRENT_USER;
const HKEY HU  = HKEY_USERS;
const MAX_PATH_ME = 500;

struct my_datatype
	{
	char Pfad[MAX_PATH_ME];
	};
//------------------------------------------------------------------------------
void scan_reg(HKEY section,char *key);
//------------------------------------------------------------------------------
int main(int argc, char* argv[])
{
	scan_reg(HLM,&quot;\0&quot;);

     getch();
	return 0;
}
//------------------------------------------------------------------------------
void scan_reg(HKEY section,char *key)
{
	HKEY hKey;
	char keyName[MAX_PATH];

     my_datatype *pfad=new my_datatype[5000];

	if( RegOpenKeyEx(section, key, 0, KEY_ALL_ACCESS, &amp;hKey ) == ERROR_SUCCESS )
	{
		for(long i=0; RegEnumKey(hKey, i, keyName, MAX_PATH) == ERROR_SUCCESS; i++)
		{
			char key_long[MAX_PATH]=&quot;&quot;;
			char val[500]=&quot;&quot;;
			char val_val[500]=&quot;&quot;;

			strcat(key_long,key);  //alten string anhängen

			if(strcmp(key,&quot;\0&quot;)!=0)strcat(key_long,&quot;\\&quot;);  // backslash hinzufügen wenn der key nicht 0 ist (Stammkey)

			strcat(key_long,keyName);  //neuen string anhängen

			//printf(&quot;%s\n&quot;,key_long);

			HKEY subKey;
			DWORD length=500;
			DWORD typ=REG_BINARY;

			if(RegOpenKeyEx(section, key_long, 0, KEY_ALL_ACCESS, &amp;subKey) == ERROR_SUCCESS)
			{

				for(long b=0; RegEnumValue(subKey, b, val, &amp;length, 0, 0, val_val, &amp;length) == ERROR_SUCCESS; b++)
				{
					printf(&quot;%s - %s\n&quot;,val,val_val);

				}

			}
			scan_reg(section,key_long); // mit neuem string ausführen
		}

	    RegCloseKey(hKey);
	}
	delete[] pfad;
}
//------------------------------------------------------------------------------
</code></pre>
<p>allerdings liest der mir nicht alle reg schlüssel, sondern nur bestimmte, was ja nicht sein kann, da REG_BINARY gesetzt ist. (auch andere werte bringen keine besseren ergebnisse) lasst euch nicht von bestimmten sachen beinflussen, das programm ist noch net fertig und unnötiges zeug is auch drinne. bin ja noch ein nap, der zeug testen muss <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>MfG Radiation2k5</p>
]]></description><link>https://www.c-plusplus.net/forum/post/769281</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/769281</guid><dc:creator><![CDATA[Radiation2K5]]></dc:creator><pubDate>Mon, 18 Apr 2005 09:16:39 GMT</pubDate></item><item><title><![CDATA[Reply to RegEnumValue liest nicht alle Werte on Mon, 18 Apr 2005 09:36:12 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>so gehört das wohl ins WinAPI-Forum.<br />
Im BCB verwendet man TRegistry.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/769297</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/769297</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 18 Apr 2005 09:36:12 GMT</pubDate></item><item><title><![CDATA[Reply to RegEnumValue liest nicht alle Werte on Mon, 18 Apr 2005 09:38:06 GMT]]></title><description><![CDATA[<p>1. Du erzeugst Variablen in einer For-Schleife! Das ist nicht besonders clever.<br />
2. Ich finde 2x RegKeyOpenEx, aber nur einmal RegCloseKey<br />
3. Was heißt &quot;nur bestimmte Keys&quot;. Kann man da eine Regel ableiten, die einem weiter hilft?<br />
4. Ich sag nur Debugger! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Phips!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/769298</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/769298</guid><dc:creator><![CDATA[Phips!]]></dc:creator><pubDate>Mon, 18 Apr 2005 09:38:06 GMT</pubDate></item><item><title><![CDATA[Reply to RegEnumValue liest nicht alle Werte on Mon, 18 Apr 2005 11:35:48 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=2974" rel="nofollow">junix</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=2" rel="nofollow">Borland C++ Builder (VCL/CLX)</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/769361</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/769361</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 18 Apr 2005 11:35:48 GMT</pubDate></item><item><title><![CDATA[Reply to RegEnumValue liest nicht alle Werte on Tue, 19 Apr 2005 05:38:26 GMT]]></title><description><![CDATA[<p>ok ich hab jetzt auf eure antworten den code einmal nachbearbeitet, er sieht jetzt so aus:</p>
<pre><code class="language-cpp">//------------------------------------------------------------------------------
#pragma hdrstop
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;windows.h&gt;
#include &lt;conio.h&gt;
//------------------------------------------------------------------------------
const HKEY HLM = HKEY_LOCAL_MACHINE;
const HKEY HCR = HKEY_CLASSES_ROOT;
const HKEY HCU = HKEY_CURRENT_USER;
const HKEY HU  = HKEY_USERS;
const MAX_PATH_ME = 500;

//------------------------------------------------------------------------------
void scan_reg(HKEY section, char *key);
//------------------------------------------------------------------------------
int main(int argc, char* argv[])
{
	scan_reg(HCU,&quot;\0&quot;);

	getch();
	return 0;
}
//------------------------------------------------------------------------------
void scan_reg(HKEY section, char *key)
{
	HKEY hKey;
	HKEY subKey;

	char keyName[MAX_PATH];
	char val[1500]=&quot;&quot;;
	char val_val[1500]=&quot;&quot;;
	char key_long[1500]=&quot;&quot;;

	DWORD typ=REG_MULTI_SZ;
	DWORD length=1500;
	DWORD length_val=1500;

	if( RegOpenKeyEx(section, key, 0, KEY_ALL_ACCESS, &amp;hKey ) == ERROR_SUCCESS )
	{
		for(long i=0; RegEnumKey(hKey, i, keyName, MAX_PATH) == ERROR_SUCCESS; i++)
		{
			strcpy(key_long,&quot;\0&quot;);
			strcat(key_long,key);  //alten string anhängen

			if(strcmp(key,&quot;\0&quot;)!=0)strcat(key_long,&quot;\\&quot;);  // backslash hinzufügen wenn der key nicht 0 ist (Stammkey)
			strcat(key_long,keyName);  //neuen string anhängen
			printf(&quot;%s\n&quot;,key_long);

			if(RegOpenKeyEx(section, key_long, 0, KEY_ALL_ACCESS, &amp;subKey) == ERROR_SUCCESS)
			{
				for(long b=0; RegEnumValue(subKey, b, val, &amp;length, 0, &amp;typ, val_val, &amp;length_val) == ERROR_SUCCESS; b++)
				{
					printf(&quot;%s - %s - %i\n&quot;,val,val_val,b);
					getch();
					//printf(&quot;&quot;);
				}
			}
			RegCloseKey(subKey);
			scan_reg(section,key_long); // mit neuem string ausführen
		}
		RegCloseKey(hKey);
	}
}
//------------------------------------------------------------------------------
</code></pre>
<p>allerdings kommt die schleife für RegEnumValue nie weiter als 0, an was liegt das? findet ihr noch rigendwelche fehler?<br />
also ich hab nichts mehr gefunden, auch nicht im debug mode. (hab gestern 3 1/2 stunden daran rumgemacht)</p>
<p>[EDIT] ach und die regel zum ableiten ist einfach, das er immer nur den index 0 ausführt [/EDIT]</p>
<p>MfG Radiation2k5</p>
]]></description><link>https://www.c-plusplus.net/forum/post/769997</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/769997</guid><dc:creator><![CDATA[Radiation2K5]]></dc:creator><pubDate>Tue, 19 Apr 2005 05:38:26 GMT</pubDate></item><item><title><![CDATA[Reply to RegEnumValue liest nicht alle Werte on Tue, 19 Apr 2005 10:07:22 GMT]]></title><description><![CDATA[<p>Lies dir nochmal die Hilfe zu <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/regenumvalue.asp" rel="nofollow">RegEnumValue</a> durch.<br />
Die Funktion liefert dir nie die Anzahl der gefundenen Werte zurück, sondern versucht im angegebenen Registry-Zweig bei jedem Aufruf immer den nächsten Wert zu lesen. Im Rückgabewert kannst Du dann erkennen, ob noch ein Wert gefunden wurde (ERROR_SUCCESS) oder nicht (ERROR_NO_MORE_ITEMS). Also nicht mit einer For-Schleife arbeiten, sondern mit while.</p>
<p>Grüße,<br />
Phips!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/770178</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/770178</guid><dc:creator><![CDATA[Phips!]]></dc:creator><pubDate>Tue, 19 Apr 2005 10:07:22 GMT</pubDate></item></channel></rss>