<?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[Zugriff auf die Registry]]></title><description><![CDATA[<p>Hallo ich steh vor einem Problem. Hauptsächlich bin ich c# Programmierer und etwas mit c und c++ bewandert. Allerdings hab ich nie Zugriffe auf die Registry gelernt. Deshalb frage ich, wie das Möglich ist.</p>
<p>Also genauer:<br />
Ich möchte Prüfen ob ein bestimmter schlüssel vorhanden ist. Wenn ja dann den Wert des Schlüssels auslesen.</p>
<p>Das wars eigentlich schon. Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/132366/zugriff-auf-die-registry</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 17:28:15 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/132366.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Jan 2006 12:46:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zugriff auf die Registry on Tue, 10 Jan 2006 12:46:47 GMT]]></title><description><![CDATA[<p>Hallo ich steh vor einem Problem. Hauptsächlich bin ich c# Programmierer und etwas mit c und c++ bewandert. Allerdings hab ich nie Zugriffe auf die Registry gelernt. Deshalb frage ich, wie das Möglich ist.</p>
<p>Also genauer:<br />
Ich möchte Prüfen ob ein bestimmter schlüssel vorhanden ist. Wenn ja dann den Wert des Schlüssels auslesen.</p>
<p>Das wars eigentlich schon. Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/962593</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962593</guid><dc:creator><![CDATA[GastFromC#]]></dc:creator><pubDate>Tue, 10 Jan 2006 12:46:47 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Tue, 10 Jan 2006 12:53:37 GMT]]></title><description><![CDATA[<p>Mit ANSI C(++) geht das nicht, aber die WinAPI hat ein paar Funktionen dafür, z.B. GetPrivateProfileString()</p>
]]></description><link>https://www.c-plusplus.net/forum/post/962598</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962598</guid><dc:creator><![CDATA[CStoll (off)]]></dc:creator><pubDate>Tue, 10 Jan 2006 12:53:37 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Tue, 10 Jan 2006 12:53:56 GMT]]></title><description><![CDATA[<p>Das geht mit der WinAPI. Du bist im falschen Forum.</p>
<p><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/registry_functions.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/registry_functions.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/962599</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962599</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 10 Jan 2006 12:53:56 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Tue, 10 Jan 2006 13:13:37 GMT]]></title><description><![CDATA[<p>Naja kenn mich nicht so gut aus. Jedenfalls hab ich bis jetzt das:</p>
<pre><code class="language-cpp">HKEY hKey = HKEY_LOCAL_MACHINE;
	LPCTSTR lpSubKey = &quot;Software\\MyCompany\\MyProduct&quot;;
	DWORD ulOptions = 0;
	REGSAM samDesired = KEY_READ;
	PHKEY phkResult = 0;
	long bla = RegOpenKeyEx(hKey, lpSubKey, ulOptions, samDesired, phkResult);
</code></pre>
<p>Wie bekomme ich jetzt da den Path?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/962617</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962617</guid><dc:creator><![CDATA[GastFromC#]]></dc:creator><pubDate>Tue, 10 Jan 2006 13:13:37 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Tue, 10 Jan 2006 13:21:56 GMT]]></title><description><![CDATA[<p>Im letzten Parameter bekommst du doch den Handle auf deinen Registry-Eintrag zurück. Den kannst du verwenden, um weiter durch die Registry zu navigieren.</p>
<p>Btw würde ich dort eher die Adresse eines exisiterenden HKEY angeben als einen NULL-Pointer:</p>
<pre><code class="language-cpp">...
HKEY key;
RegOpenKeyEx(...,&amp;key);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/962630</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962630</guid><dc:creator><![CDATA[CStoll (off)]]></dc:creator><pubDate>Tue, 10 Jan 2006 13:21:56 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Tue, 10 Jan 2006 13:37:10 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=403" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</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/962648</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962648</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Tue, 10 Jan 2006 13:37:10 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Tue, 10 Jan 2006 13:42:12 GMT]]></title><description><![CDATA[<p>Habs jetzt geändert anhand eines Beispiels, das ich hier im Forum gefunden habe. Sieht jetzt so aus:</p>
<pre><code class="language-cpp">LONG lnResult; 
    HKEY hKey; 
	bool bla;
	bla = false;
            lnResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, 
                &quot;Software\\Mycompany\\MyProduct\\Path&quot;, 
                0, 
                KEY_READ, 
                &amp;hKey); 
            if ( ERROR_SUCCESS != lnResult ) { 
				bla = true;
            }
</code></pre>
<p>hKey bleibt aber immer leer bzw es steht ????? drin. Warum? Ist die RegistryPfad-Angabe falsch?</p>
<p>Übrigens, warum kann ich auf bla keinen quickWatch machen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/962653</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962653</guid><dc:creator><![CDATA[GastFromC#]]></dc:creator><pubDate>Tue, 10 Jan 2006 13:42:12 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Tue, 10 Jan 2006 14:29:27 GMT]]></title><description><![CDATA[<p>Damit öffnest Du ja nur den Key... lesen musst Du noch separat: RegQueryValueEx</p>
<p>PS: Warum nimmst Du nicht die Funktionen aus dem .NET-Framework (Microsoft.Win32.Registry)?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/962725</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962725</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 10 Jan 2006 14:29:27 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Tue, 10 Jan 2006 15:12:57 GMT]]></title><description><![CDATA[<p>Das Programm muss ohne der .net Umgebung lauffähig sein deshalb.</p>
<p>Ich blick da einfach nicht durch. Hat denn keiner nen Schnipsel in der er z. B. einen Installpath eines Programms in einen String einliest?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/962777</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962777</guid><dc:creator><![CDATA[GastFromC#]]></dc:creator><pubDate>Tue, 10 Jan 2006 15:12:57 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Tue, 10 Jan 2006 15:20:43 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">DWORD dwType;
  TCHAR szValue[100];
  DWORD dwSize = sizeof(szValue)*sizeof(TCHAR);
  LONG lRet = RegQueryValueEx(hk, _T(&quot;ValueName&quot;), NULL, &amp;dwType, (LPBYTE) szValue, &amp;dwSize);
  if ( (lRet == ERROR_SUCCESS) &amp;&amp; ( (dwType == REG_SZ) || (dwType == REG_EXPAND_SZ)) )
  {
    // Wert erfogreich gelesen...
  }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/962783</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962783</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 10 Jan 2006 15:20:43 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Tue, 10 Jan 2006 15:52:29 GMT]]></title><description><![CDATA[<p>Funzt bei mir nicht.<br />
dwType enthält immer 2147483650<br />
szValue immer ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ</p>
]]></description><link>https://www.c-plusplus.net/forum/post/962815</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962815</guid><dc:creator><![CDATA[GastFromC#]]></dc:creator><pubDate>Tue, 10 Jan 2006 15:52:29 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Tue, 10 Jan 2006 16:28:09 GMT]]></title><description><![CDATA[<p>Und was enthält &quot;lRet&quot; ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/962845</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962845</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 10 Jan 2006 16:28:09 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Tue, 10 Jan 2006 16:43:34 GMT]]></title><description><![CDATA[<p>Da passt der Wert. Der ist 2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/962862</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/962862</guid><dc:creator><![CDATA[GastFromC#]]></dc:creator><pubDate>Tue, 10 Jan 2006 16:43:34 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Fri, 13 Jan 2006 13:55:12 GMT]]></title><description><![CDATA[<p>Ich wollte das Thema nochmal aufgreifen weils ziemlich wichtig ist, dass ich da eine Lösung find.</p>
<p>Hat denn keiner einen Rat?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/965556</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/965556</guid><dc:creator><![CDATA[GuestFromC#]]></dc:creator><pubDate>Fri, 13 Jan 2006 13:55:12 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Fri, 13 Jan 2006 17:43:54 GMT]]></title><description><![CDATA[<p>hier suche ich nach dem standardwert für die dateierweiterung &quot;.c&quot;, wenn du einen speziellen key suchst, ersetze &quot;&quot; durch &quot;blablub&quot;. das war mein erster versuch, aus der reg zu lesen, und dank eurer snippets kein problem. thx.<br />
vielleicht läuft das ja bei dir bzw hilft weiter.</p>
<pre><code>//---------------------------------------------------------------------------
//.....('`-''-/').?_..--'''`-._
//.....`6_.6..)...`-...(.....).`-.?.-`)
//.....(_Y_.)'..._...)..`._.`..``-..--'
//..._..`--'_..-_/../--'_.'.,'
//..(il),-''..(li),'..((!.-
//---------------------------------------------------------------------------
#include&lt;windows.h&gt;
#include&lt;stdio.h&gt; // für printf, 
#include&lt;conio.h&gt;
//---------------------------------------------------------------------------
int main(int argc, char* argv[])
{
  int long lnResult;
  HKEY hKey=NULL;
  lnResult=RegOpenKeyEx(HKEY_CLASSES_ROOT,&quot;.c&quot;,
                0,KEY_READ,&amp;hKey);
  if(!hKey){MessageBox(NULL,&quot;RegOpenKeyEx failed&quot;,&quot;&quot;,MB_OK);return -1;}
  DWORD dwType;
  TCHAR szValue[100];
  DWORD dwSize = sizeof(szValue)*sizeof(TCHAR);
  LONG lRet = RegQueryValueEx(hKey, &quot;&quot;, NULL, &amp;dwType, (LPBYTE) szValue, &amp;dwSize); // ersetze &quot;&quot; durch &quot;blablub&quot;
  if ( (lRet == ERROR_SUCCESS) &amp;&amp; ( (dwType == REG_SZ) || (dwType == REG_EXPAND_SZ)) )
  {
    printf(&quot;%s&quot;,szValue);
  }
  else {MessageBox(NULL,&quot;RegQueryValueEx failed&quot;,&quot;&quot;,MB_OK);return -1;}
  getch();
  return 0;
}
//---------------------------------------------------------------------------
</code></pre>
<p>grüße, die katz</p>
]]></description><link>https://www.c-plusplus.net/forum/post/965880</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/965880</guid><dc:creator><![CDATA[plapperkatz]]></dc:creator><pubDate>Fri, 13 Jan 2006 17:43:54 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf die Registry on Mon, 16 Jan 2006 10:48:24 GMT]]></title><description><![CDATA[<p>Jetzt gehts. Vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/967820</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/967820</guid><dc:creator><![CDATA[GastFromC#]]></dc:creator><pubDate>Mon, 16 Jan 2006 10:48:24 GMT</pubDate></item></channel></rss>