<?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[Registry Problem]]></title><description><![CDATA[<p>Hi,<br />
ich habe folgenden Code:</p>
<pre><code class="language-cpp">case 0: break;
                 case 1: HKEY hKey;
                         RegCreateKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);	
                         dwNumber=1;
                         RegSetValueEx(hKey,&quot;DisableTaskMgr&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Task Manager disabled&quot;;
                         Sleep (2000);
                         break;
                 case 2: HKEY hKey0;
                         RegOpenKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,KEY_ALL_ACCESS, &amp;hKey);
                         dwNumber=0;
                         RegSetValueEx(hKey,&quot;DisableTaskMgr&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Task Manager enabled&quot;;
                         Sleep (2000);
                         break;
                 case 3: HKEY hKey1;
                         RegCreateKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\Curre ntVersion\\Policies\\System&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);	
                         dwNumber=1;
                         RegSetValueEx(hKey1,&quot;DisableRegistryTools&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey1);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Registry disabled&quot;;
                         break;
                 case 4: HKEY hKey2;
                         RegOpenKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,KEY_ALL_ACCESS, &amp;hKey);	
                         dwNumber=0;
                         RegSetValueEx(hKey2,&quot;DisableRegistryTools&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey2);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Registry enabled&quot;;
                         break;
                 case 5: HKEY hKey3;
                         RegCreateKeyEx(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\Policies\\Microsoft\\Int ernet Explorer\\Restrictions&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);	
                         dwNumber=1;
                         RegSetValueEx(hKey3,&quot;NoBrowserClose&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey3);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Browser Close disabled&quot;;
                         break;
                 case 6: HKEY hKey4;
                         RegOpenKeyEx(HKEY_CURRENT_USER,&quot;SOFTWARE\\Policies\\Microsoft\\Int ernet Explorer\\Restrictions&quot;,0,KEY_ALL_ACCESS, &amp;hKey);	
                         dwNumber=0;
                         RegSetValueEx(hKey4,&quot;NoBrowserClose&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey4);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Browser Close enabled&quot;;
                         break;
                 case 7: HKEY hKey5;
                         RegCreateKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\Curre ntVersion\\Policies\\System&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);	
                         dwNumber=1;
                         RegSetValueEx(hKey5,&quot;NoDispSettingsPage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey5);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Display changes disabled&quot;;
                         break;
                 case 8: HKEY hKey6;
                         RegOpenKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,KEY_ALL_ACCESS, &amp;hKey);
                         dwNumber=0;
                         RegSetValueEx(hKey6,&quot;NoDispSettingsPage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey6);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Display changes enabled&quot;;
                         break;
                 case 9: HKEY hKey7;
                         RegCreateKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\Curre ntVersion\\Policies\\System&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);	
                         dwNumber=1;
                         RegSetValueEx(hKey7,&quot;NoDispScrSavPage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey7);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Display changes disabled&quot;;
                         break;
                 case 10: HKEY hKey8;
                          RegOpenKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,KEY_ALL_ACCESS, &amp;hKey);
                          dwNumber=0;
                          RegSetValueEx(hKey8,&quot;NoDispScrSavPage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                          RegCloseKey(hKey8);
                          cout &lt;&lt; endl;
                          cout &lt;&lt; &quot;  Display changes enabled&quot;;
                          break;
                 case 11: HKEY hKey9;
                          RegCreateKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\Curre ntVersion\\Policies\\System&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);	
                          dwNumber=1;
                          RegSetValueEx(hKey9,&quot;NoDispAppearancePage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                          RegCloseKey(hKey9);
                          cout &lt;&lt; endl;
                          cout &lt;&lt; &quot;  Apperance changes disabled&quot;;
                          break;
                 case 12: HKEY hKey10;
                          RegOpenKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,KEY_ALL_ACCESS, &amp;hKey);
                          dwNumber=0;
                          RegSetValueEx(hKey10,&quot;NoDispAppearancePage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                          RegCloseKey(hKey10);
                          cout &lt;&lt; endl;
                          cout &lt;&lt; &quot;  Apperance changes enabled&quot;;
                          break;
                 case 13: HKEY hKey11;
                          RegCreateKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);	
                          dwNumber=1;
                          RegSetValueEx(hKey11,&quot;NoDispBackgroundPage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                          RegCloseKey(hKey11);
                          cout &lt;&lt; endl;
                          cout &lt;&lt; &quot;  Background changes disabled&quot;;
                          Sleep (2000);
                          break;
                 case 14: HKEY hKey12;
                          RegOpenKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,KEY_ALL_ACCESS, &amp;hKey);
                          dwNumber=0;
                          RegSetValueEx(hKey12,&quot;NoDispBackgroundPage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                          RegCloseKey(hKey12);
                          cout &lt;&lt; endl;
                          cout &lt;&lt; &quot;  Background changes disabled&quot;;
                          break;
</code></pre>
<p>wenn ich schon einmal z.b. case 1 ausgefuehrt habe kann ich nicht mehr case 13 ausfuehren bzw. er erstellt das Value von case 13 nicht.</p>
<p>Ich vermute mal da der Key schon vorhanden ist, aber bei msdn steht, dass wenn der key schon vorhanden ist er ihn mit RegCreateKeyEx oeffnet.</p>
<p>Ich habe es dann auch mal mit RegOpenKeyEx + RegSetValueEx probiert, dies hat auch nicht funktioniert, was wahrscheinlich daran liegt, dass das Value noch nicht erstellt wurde.</p>
<p>Hoffe auf Hilfe</p>
<p>MfG<br />
Coda</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/177469/registry-problem</link><generator>RSS for Node</generator><lastBuildDate>Sat, 27 Jun 2026 15:42:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/177469.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 31 Mar 2007 19:51:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Registry Problem on Sat, 31 Mar 2007 19:52:01 GMT]]></title><description><![CDATA[<p>Hi,<br />
ich habe folgenden Code:</p>
<pre><code class="language-cpp">case 0: break;
                 case 1: HKEY hKey;
                         RegCreateKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);	
                         dwNumber=1;
                         RegSetValueEx(hKey,&quot;DisableTaskMgr&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Task Manager disabled&quot;;
                         Sleep (2000);
                         break;
                 case 2: HKEY hKey0;
                         RegOpenKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,KEY_ALL_ACCESS, &amp;hKey);
                         dwNumber=0;
                         RegSetValueEx(hKey,&quot;DisableTaskMgr&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Task Manager enabled&quot;;
                         Sleep (2000);
                         break;
                 case 3: HKEY hKey1;
                         RegCreateKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\Curre ntVersion\\Policies\\System&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);	
                         dwNumber=1;
                         RegSetValueEx(hKey1,&quot;DisableRegistryTools&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey1);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Registry disabled&quot;;
                         break;
                 case 4: HKEY hKey2;
                         RegOpenKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,KEY_ALL_ACCESS, &amp;hKey);	
                         dwNumber=0;
                         RegSetValueEx(hKey2,&quot;DisableRegistryTools&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey2);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Registry enabled&quot;;
                         break;
                 case 5: HKEY hKey3;
                         RegCreateKeyEx(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\Policies\\Microsoft\\Int ernet Explorer\\Restrictions&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);	
                         dwNumber=1;
                         RegSetValueEx(hKey3,&quot;NoBrowserClose&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey3);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Browser Close disabled&quot;;
                         break;
                 case 6: HKEY hKey4;
                         RegOpenKeyEx(HKEY_CURRENT_USER,&quot;SOFTWARE\\Policies\\Microsoft\\Int ernet Explorer\\Restrictions&quot;,0,KEY_ALL_ACCESS, &amp;hKey);	
                         dwNumber=0;
                         RegSetValueEx(hKey4,&quot;NoBrowserClose&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey4);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Browser Close enabled&quot;;
                         break;
                 case 7: HKEY hKey5;
                         RegCreateKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\Curre ntVersion\\Policies\\System&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);	
                         dwNumber=1;
                         RegSetValueEx(hKey5,&quot;NoDispSettingsPage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey5);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Display changes disabled&quot;;
                         break;
                 case 8: HKEY hKey6;
                         RegOpenKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,KEY_ALL_ACCESS, &amp;hKey);
                         dwNumber=0;
                         RegSetValueEx(hKey6,&quot;NoDispSettingsPage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey6);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Display changes enabled&quot;;
                         break;
                 case 9: HKEY hKey7;
                         RegCreateKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\Curre ntVersion\\Policies\\System&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);	
                         dwNumber=1;
                         RegSetValueEx(hKey7,&quot;NoDispScrSavPage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                         RegCloseKey(hKey7);
                         cout &lt;&lt; endl;
                         cout &lt;&lt; &quot;  Display changes disabled&quot;;
                         break;
                 case 10: HKEY hKey8;
                          RegOpenKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,KEY_ALL_ACCESS, &amp;hKey);
                          dwNumber=0;
                          RegSetValueEx(hKey8,&quot;NoDispScrSavPage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                          RegCloseKey(hKey8);
                          cout &lt;&lt; endl;
                          cout &lt;&lt; &quot;  Display changes enabled&quot;;
                          break;
                 case 11: HKEY hKey9;
                          RegCreateKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\Curre ntVersion\\Policies\\System&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);	
                          dwNumber=1;
                          RegSetValueEx(hKey9,&quot;NoDispAppearancePage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                          RegCloseKey(hKey9);
                          cout &lt;&lt; endl;
                          cout &lt;&lt; &quot;  Apperance changes disabled&quot;;
                          break;
                 case 12: HKEY hKey10;
                          RegOpenKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,KEY_ALL_ACCESS, &amp;hKey);
                          dwNumber=0;
                          RegSetValueEx(hKey10,&quot;NoDispAppearancePage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                          RegCloseKey(hKey10);
                          cout &lt;&lt; endl;
                          cout &lt;&lt; &quot;  Apperance changes enabled&quot;;
                          break;
                 case 13: HKEY hKey11;
                          RegCreateKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);	
                          dwNumber=1;
                          RegSetValueEx(hKey11,&quot;NoDispBackgroundPage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                          RegCloseKey(hKey11);
                          cout &lt;&lt; endl;
                          cout &lt;&lt; &quot;  Background changes disabled&quot;;
                          Sleep (2000);
                          break;
                 case 14: HKEY hKey12;
                          RegOpenKeyEx(HKEY_CURRENT_USER,&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System&quot;,0,KEY_ALL_ACCESS, &amp;hKey);
                          dwNumber=0;
                          RegSetValueEx(hKey12,&quot;NoDispBackgroundPage&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
                          RegCloseKey(hKey12);
                          cout &lt;&lt; endl;
                          cout &lt;&lt; &quot;  Background changes disabled&quot;;
                          break;
</code></pre>
<p>wenn ich schon einmal z.b. case 1 ausgefuehrt habe kann ich nicht mehr case 13 ausfuehren bzw. er erstellt das Value von case 13 nicht.</p>
<p>Ich vermute mal da der Key schon vorhanden ist, aber bei msdn steht, dass wenn der key schon vorhanden ist er ihn mit RegCreateKeyEx oeffnet.</p>
<p>Ich habe es dann auch mal mit RegOpenKeyEx + RegSetValueEx probiert, dies hat auch nicht funktioniert, was wahrscheinlich daran liegt, dass das Value noch nicht erstellt wurde.</p>
<p>Hoffe auf Hilfe</p>
<p>MfG<br />
Coda</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1256823</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1256823</guid><dc:creator><![CDATA[Coda*linux.PrayLoad]]></dc:creator><pubDate>Sat, 31 Mar 2007 19:52:01 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Problem on Sat, 31 Mar 2007 20:08:32 GMT]]></title><description><![CDATA[<p>Na hey, immernoch fit am Taskmanager - Deaktivieren ? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> Ich gebe dir mal einen Tipp: verpacke 'RegCreateKeyEx' und 'RegOpenKeyEx' in jeweils eine Funktion, denn dein Code ist sehr unübersichtlich und schlecht. Als Funktionsparameter übergibst du einfach die gewünschten Werte, die eingetragen werden sollen, etwa so:</p>
<pre><code class="language-cpp">void _RegCreateKeyEx (HKEY Key,
                      LPCTSTR KeyPath,
                      DWORD res,
                      LPTSTR lpCl,
                      DWORD Options,
                      REGSAM sam,
                      LPSECURITY_ATTRIBUTES sAttr,
                      PHKEY res,
                      LPDWORD Dispo)

HKEY hKey;
RegCreateKeyEx (Key,KeyPath,res,lpCl,Options,sam,sAttr,&amp;res,Dispo);
dwNumber=1;
RegSetValueEx(hKey,&quot;DisableTaskMgr&quot;,0,REG_DWORD,(BYTE*)&amp;dwNumber,sizeof(DWORD));
RegCloseKey(hKey);
</code></pre>
<p>Und das machst du für <strong>jede</strong> Funktion so, denn nur so wird dein Code etwas schlanker. Eine Hilfe bietet dir dafür die MSDN, dort kannst du die jeweiligen Datentypen der Funktionsparameter entnehmen, um sie dann in den Funktionskopf deiner Funktionen zu setzen. Wenn du das gemacht hast, und den neuen Code hier reinstellst, werde ich dir gerne helfen können, denn jetzt sehe ich nur ein wirres Durcheinander und kenne mich nicht aus, sorry.</p>
<p>MfG mikey.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1256830</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1256830</guid><dc:creator><![CDATA[mikey]]></dc:creator><pubDate>Sat, 31 Mar 2007 20:08:32 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Problem on Sat, 31 Mar 2007 20:38:28 GMT]]></title><description><![CDATA[<p>Stinkt aber nach PayLoad/Virus etc. hier...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1256845</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1256845</guid><dc:creator><![CDATA[Öhm....]]></dc:creator><pubDate>Sat, 31 Mar 2007 20:38:28 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Problem on Mon, 02 Apr 2007 10:01:36 GMT]]></title><description><![CDATA[<p>Hallo Coda@linux.PrayLoad,</p>
<p>mikey hat auf jeden Fall recht. Der Code ist zwar nicht schwer zu verstehen, aber nicht optimal geschrieben.</p>
<p>Ein Tipp von mir wäre, nicht in jedem Case-Zweig einen Handle für einen Registry-Key zu deklarieren. Da du den Handle ja sowieso in jedem Case-Zweig neu initialisierst, ist das also uneffektiv und hat auch keinen Nutzen.</p>
<p>Wenn du die Handles doch noch brauchst, dann löse das ganze mit einem Array vom Typ HKEY.</p>
<pre><code class="language-cpp">//...

HKEY hKey[13] ;

//...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1257811</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257811</guid><dc:creator><![CDATA[WilMen]]></dc:creator><pubDate>Mon, 02 Apr 2007 10:01:36 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Problem on Mon, 02 Apr 2007 10:05:48 GMT]]></title><description><![CDATA[<p>Achso und zum Öffnen eines schon vorhandenen Keys musst du die Funktion RegOpenKeyEx nutzen. Die Syntax dieser Fuktion kannst du dir ja in der MSDN Library anschauen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257814</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257814</guid><dc:creator><![CDATA[WilMen]]></dc:creator><pubDate>Mon, 02 Apr 2007 10:05:48 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Problem on Mon, 02 Apr 2007 10:38:25 GMT]]></title><description><![CDATA[<p>Vielleicht möchtest du ja auch meine Klasse CRegistry verwenden, die du auf <a href="http://www.webfritzi.de.vu" rel="nofollow">www.webfritzi.de.vu</a> findest. Damit geht sowas:</p>
<pre><code class="language-cpp">CRegistry reg;
reg.SetRoot(HKEY_LOCAL_MACHINE);
reg.OpenPath( TEXT(&quot;Software\\MyCompany\\MyProg&quot;) );
reg.WriteDWORD( TEXT(&quot;MyValueName&quot;), 12 );
reg.ClosePath();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1257825</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257825</guid><dc:creator><![CDATA[WebFritzi]]></dc:creator><pubDate>Mon, 02 Apr 2007 10:38:25 GMT</pubDate></item></channel></rss>