<?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 Windows XP]]></title><description><![CDATA[<p>Tag zusammen<br />
Mein Programm erstellt bei einem Buttonklick einen Registry Eintrag. Es tut sich selber in den Autostart(Software\Microsoft\Windows\CurrentVersion\Run). Mein Programm tut wenn ich es starte aber auch schauen ob dort dieser Eintrag schon vorhanden ist. Unter Vista funktioniert das alles ohne Probleme. Unter Xp erkennt er den Eintrag wenn er zufor vom Programm erstellt wurde nicht. Wenn ich ihn aber selber Eintrage dann erkennt er ihn.</p>
<p>Erstellen des Eintrags:</p>
<pre><code class="language-cpp">wchar_t buf[256]; 
GetModuleFileName(NULL, buf, 255);
HKEY hKey; 			RegCreateKeyEx(HKEY_LOCAL_MACHINE,L&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Run&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);
BYTE *cString = (BYTE *) buf;
RegSetValueEx(hKey,L&quot;Bibel-Box&quot;,0,REG_SZ,cString,257);
RegCloseKey(hKey);
</code></pre>
<p>Auslesen ob der Eintrag schon vorhanden ist:</p>
<pre><code class="language-cpp">int bibel1 = 0;
std::string bibel = std::string(&quot;Bibel-Box&quot;,30);

char bibelbox[50];

HKEY hKey; 
			RegCreateKeyEx(HKEY_LOCAL_MACHINE,L&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Run&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);
int i=0; 
int iLastError=0; 
do 
{ 
        wchar_t cValueName[50]; 
	DWORD dwValueName = 256; 
	DWORD ValueType = 0; 
	BYTE cValueData[256] = &quot;\0&quot;; 
	DWORD dwValueData = 256; 
	iLastError  
RegEnumValue(hKey,i,cValueName,&amp;dwValueName,0,&amp;ValueType,cValueData,&amp;dwValueData); 
++i; 
WideCharToMultiByte(CP_ACP,0,cValueName,-1, bibelbox,sizeof(bibelbox),NULL,NULL);
std::string stringw = std::string(bibelbox,30 );
if(stringw.size() == 30)
{
	for(size_t i = 0;i &lt; stringw.size();i++)
	{
		if(i == 29)
		{
			bibel1 = 0;
		}
		if(stringw.at(i) == bibel.at(i))
		    {
			bibel1 += 1;
			if(bibel1&gt;9)
			{
			        iLastError =ERROR_NO_MORE_ITEMS;
				checked = true;
			}
		}
	}
 }
}while(iLastError!=ERROR_NO_MORE_ITEMS);
RegCloseKey(hKey);
</code></pre>
<p>Ich weis, dass ist alles noch nicht besonders schön, aber es soll erstmal tun.</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/238769/registry-windows-xp</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 20:28:45 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/238769.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 15 Apr 2009 11:16:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Registry Windows XP on Wed, 15 Apr 2009 11:16:46 GMT]]></title><description><![CDATA[<p>Tag zusammen<br />
Mein Programm erstellt bei einem Buttonklick einen Registry Eintrag. Es tut sich selber in den Autostart(Software\Microsoft\Windows\CurrentVersion\Run). Mein Programm tut wenn ich es starte aber auch schauen ob dort dieser Eintrag schon vorhanden ist. Unter Vista funktioniert das alles ohne Probleme. Unter Xp erkennt er den Eintrag wenn er zufor vom Programm erstellt wurde nicht. Wenn ich ihn aber selber Eintrage dann erkennt er ihn.</p>
<p>Erstellen des Eintrags:</p>
<pre><code class="language-cpp">wchar_t buf[256]; 
GetModuleFileName(NULL, buf, 255);
HKEY hKey; 			RegCreateKeyEx(HKEY_LOCAL_MACHINE,L&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Run&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);
BYTE *cString = (BYTE *) buf;
RegSetValueEx(hKey,L&quot;Bibel-Box&quot;,0,REG_SZ,cString,257);
RegCloseKey(hKey);
</code></pre>
<p>Auslesen ob der Eintrag schon vorhanden ist:</p>
<pre><code class="language-cpp">int bibel1 = 0;
std::string bibel = std::string(&quot;Bibel-Box&quot;,30);

char bibelbox[50];

HKEY hKey; 
			RegCreateKeyEx(HKEY_LOCAL_MACHINE,L&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Run&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);
int i=0; 
int iLastError=0; 
do 
{ 
        wchar_t cValueName[50]; 
	DWORD dwValueName = 256; 
	DWORD ValueType = 0; 
	BYTE cValueData[256] = &quot;\0&quot;; 
	DWORD dwValueData = 256; 
	iLastError  
RegEnumValue(hKey,i,cValueName,&amp;dwValueName,0,&amp;ValueType,cValueData,&amp;dwValueData); 
++i; 
WideCharToMultiByte(CP_ACP,0,cValueName,-1, bibelbox,sizeof(bibelbox),NULL,NULL);
std::string stringw = std::string(bibelbox,30 );
if(stringw.size() == 30)
{
	for(size_t i = 0;i &lt; stringw.size();i++)
	{
		if(i == 29)
		{
			bibel1 = 0;
		}
		if(stringw.at(i) == bibel.at(i))
		    {
			bibel1 += 1;
			if(bibel1&gt;9)
			{
			        iLastError =ERROR_NO_MORE_ITEMS;
				checked = true;
			}
		}
	}
 }
}while(iLastError!=ERROR_NO_MORE_ITEMS);
RegCloseKey(hKey);
</code></pre>
<p>Ich weis, dass ist alles noch nicht besonders schön, aber es soll erstmal tun.</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696240</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696240</guid><dc:creator><![CDATA[Fatal Error appears]]></dc:creator><pubDate>Wed, 15 Apr 2009 11:16:46 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Wed, 15 Apr 2009 11:50:17 GMT]]></title><description><![CDATA[<p>Die richtigen Rechte, etc. wirst du ja sicher haben oder?<br />
Wenn du den Eintrag mit deinem Programm gesetzt hast und dann von Hand in der Registry nachsiehst ist er auch nicht da?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696255</guid><dc:creator><![CDATA[oneill5000]]></dc:creator><pubDate>Wed, 15 Apr 2009 11:50:17 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Wed, 15 Apr 2009 11:57:31 GMT]]></title><description><![CDATA[<p>Doch er ist da. Er wird beim nächsten Programmstart unter XP nur nicht erkannt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696258</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696258</guid><dc:creator><![CDATA[Fatal Error appears]]></dc:creator><pubDate>Wed, 15 Apr 2009 11:57:31 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Wed, 15 Apr 2009 12:07:29 GMT]]></title><description><![CDATA[<p>Hab mich in deinen Code noch nich so reingeguckt, aber hast du <a href="http://msdn.microsoft.com/en-us/library/ms724256(VS.85).aspx" rel="nofollow">das</a> Beispiel schonmal durchgearbeitet? Und warum wertest du die Rückgabewerte von RegCreateKeyEx und RegEnumValue nicht aus?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696268</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696268</guid><dc:creator><![CDATA[oneill5000]]></dc:creator><pubDate>Wed, 15 Apr 2009 12:07:29 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Wed, 15 Apr 2009 12:15:49 GMT]]></title><description><![CDATA[<p>So hab mal weiter in deinem Code geschaut. RegEnumValue rufst du nur mit dem Index 0 auf, zumindest in dem Code den man sehen kann. Wer sagt aber das dein Wert an Stelle 0 steht?<br />
In der Hilfe steth auch</p>
<blockquote>
<p>dwIndex [in]</p>
<p>The index of the value to be retrieved. This parameter should be zero for the first call to the RegEnumValue function and then be incremented for subsequent calls.</p>
<p><strong>Because values are not ordered, any new value will have an arbitrary index. This means that the function may return values in any order.</strong></p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1696275</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696275</guid><dc:creator><![CDATA[oneill5000]]></dc:creator><pubDate>Wed, 15 Apr 2009 12:15:49 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Wed, 15 Apr 2009 12:25:30 GMT]]></title><description><![CDATA[<p>Auch dein vergleich der Zeichenketten sieht sehr exotisch aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696281</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696281</guid><dc:creator><![CDATA[oneill5000]]></dc:creator><pubDate>Wed, 15 Apr 2009 12:25:30 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Wed, 15 Apr 2009 14:06:13 GMT]]></title><description><![CDATA[<p>oneill5000 schrieb:</p>
<blockquote>
<p>So hab mal weiter in deinem Code geschaut. RegEnumValue rufst du nur mit dem Index 0 auf, zumindest in dem Code den man sehen kann. Wer sagt aber das dein Wert an Stelle 0 steht?<br />
In der Hilfe steth auch</p>
<blockquote>
<p>dwIndex [in]</p>
<p>The index of the value to be retrieved. This parameter should be zero for the first call to the RegEnumValue function and then be incremented for subsequent calls.</p>
<p><strong>Because values are not ordered, any new value will have an arbitrary index. This means that the function may return values in any order.</strong></p>
</blockquote>
</blockquote>
<p>Ich übergebe doch als Index i und i wird bei jedem Schleifendurchgang um 1 erhöht(++i). Das geht solange bis RegEnumValue ERROR_NO_MORE_ITEMS zurückgibt.<br />
Unter Vista funktioniert es ja auch ohne Probleme.</p>
<p>oneill5000 schrieb:</p>
<blockquote>
<p>Auch dein vergleich der Zeichenketten sieht sehr exotisch aus.</p>
</blockquote>
<p>Jo des stimmt. Des wird auch noch geändert.</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696313</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696313</guid><dc:creator><![CDATA[Fatal Error appears]]></dc:creator><pubDate>Wed, 15 Apr 2009 14:06:13 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Wed, 15 Apr 2009 18:53:52 GMT]]></title><description><![CDATA[<p>Dieser Code setzt voraus, dass Dein Programm als Admin läuft. Unter Vista läuft es weil Dein Programm virtualisiert wird. Du hast mit Sicherheit kein Manifest gesetzt. HKLM und KEY_ALL_ACCESS hast Du nur als Admin, oder unter Vista wenn Dein Programm elevated läuft.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696401</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696401</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 15 Apr 2009 18:53:52 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Wed, 15 Apr 2009 19:38:22 GMT]]></title><description><![CDATA[<p>Fatal Error appears schrieb:</p>
<blockquote>
<p>Ich übergebe doch als Index i und i wird bei jedem Schleifendurchgang um 1 erhöht(++i). Das geht solange bis RegEnumValue ERROR_NO_MORE_ITEMS zurückgibt.<br />
MFG</p>
</blockquote>
<p>Sorry, du hast natürlich recht. Sowas übersieht man wenn man nebenbei noch arbeiten 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>
]]></description><link>https://www.c-plusplus.net/forum/post/1696427</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696427</guid><dc:creator><![CDATA[oneill5000]]></dc:creator><pubDate>Wed, 15 Apr 2009 19:38:22 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Wed, 15 Apr 2009 22:35:16 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p>Dieser Code setzt voraus, dass Dein Programm als Admin läuft. Unter Vista läuft es weil Dein Programm virtualisiert wird. Du hast mit Sicherheit kein Manifest gesetzt. HKLM und KEY_ALL_ACCESS hast Du nur als Admin, oder unter Vista wenn Dein Programm elevated läuft.</p>
</blockquote>
<p>Hat da jemand einen Link oder ein Beispiel?</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696468</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696468</guid><dc:creator><![CDATA[Fatal Error appears]]></dc:creator><pubDate>Wed, 15 Apr 2009 22:35:16 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Thu, 16 Apr 2009 07:52:48 GMT]]></title><description><![CDATA[<p>Bitte was für ein Beispiel. Bzgl. Manifest und Vista findest Du genug Futter hier im Forum oder auf meinem Blog:<br />
<a href="http://blog.m-ri.de/index.php/tag/manifest/" rel="nofollow">http://blog.m-ri.de/index.php/tag/manifest/</a></p>
<p>Werde Dir erstmal klar was Virtualisierung bedeutet unter Vista, und dann wundere Dich was wo in der Registry steht <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1696522</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696522</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 16 Apr 2009 07:52:48 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Thu, 16 Apr 2009 10:34:16 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p>Bitte was für ein Beispiel. Bzgl. Manifest und Vista findest Du genug Futter hier im Forum oder auf meinem Blog:<br />
<a href="http://blog.m-ri.de/index.php/tag/manifest/" rel="nofollow">http://blog.m-ri.de/index.php/tag/manifest/</a></p>
<p>Werde Dir erstmal klar was Virtualisierung bedeutet unter Vista, und dann wundere Dich was wo in der Registry steht <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>
</blockquote>
<p>Ich hab jetzt das Manifest so abgeändert, dass als level 'requireAdministrator' da steht. Aber unter Xp erkennt er den zufor geschriebenen Eintrag immer noch nicht..</p>
<p>Manifest:</p>
<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;assembly xmlns=&quot;urn:schemas-microsoft-com:asm.v1&quot; manifestVersion=&quot;1.0&quot;&gt;
  &lt;trustInfo xmlns=&quot;urn:schemas-microsoft-com:asm.v3&quot;&gt;
    &lt;security&gt;
      &lt;requestedPrivileges&gt;
        &lt;requestedExecutionLevel level=&quot;requireAdministrator&quot; uiAccess=&quot;false&quot;&gt;&lt;/requestedExecutionLevel&gt;
      &lt;/requestedPrivileges&gt;
    &lt;/security&gt;
  &lt;/trustInfo&gt;
  &lt;dependency&gt;
    &lt;dependentAssembly&gt;
      &lt;assemblyIdentity type=&quot;win32&quot; name=&quot;Microsoft.Windows.Common-Controls&quot; version=&quot;6.0.0.0&quot; processorArchitecture=&quot;x86&quot; publicKeyToken=&quot;6595b64144ccf1df&quot; language=&quot;*&quot;&gt;&lt;/assemblyIdentity&gt;
    &lt;/dependentAssembly&gt;
  &lt;/dependency&gt;
&lt;/assembly&gt;
</code></pre>
<p>Mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696607</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696607</guid><dc:creator><![CDATA[Fatal Error appears]]></dc:creator><pubDate>Thu, 16 Apr 2009 10:34:16 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Thu, 16 Apr 2009 11:10:57 GMT]]></title><description><![CDATA[<p>Bist du (vollwärtiger) Administrator auf deinem XP Rechner?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696619</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696619</guid><dc:creator><![CDATA[oneill5000]]></dc:creator><pubDate>Thu, 16 Apr 2009 11:10:57 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Thu, 16 Apr 2009 11:27:13 GMT]]></title><description><![CDATA[<p>Ja ich bin der einzigste Benutzer und ich bin Administrator.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696633</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696633</guid><dc:creator><![CDATA[Fatal Error appears]]></dc:creator><pubDate>Thu, 16 Apr 2009 11:27:13 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Thu, 16 Apr 2009 11:38:44 GMT]]></title><description><![CDATA[<p>Hast du denn das Beispiel vom MSDN schonmal ausprobiert, von wo ich dir den link geschickt habe? Den änderst du dann einfach noch ein wenig nach deinen Bedürfnissen ab und dann funktionierts auch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696644</guid><dc:creator><![CDATA[oneill5000]]></dc:creator><pubDate>Thu, 16 Apr 2009 11:38:44 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Thu, 16 Apr 2009 12:14:53 GMT]]></title><description><![CDATA[<p>Vielen Dank jetzt funkts^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696660</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696660</guid><dc:creator><![CDATA[Fatal Error appears]]></dc:creator><pubDate>Thu, 16 Apr 2009 12:14:53 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Thu, 16 Apr 2009 12:39:50 GMT]]></title><description><![CDATA[<p>UNd was hast jetzt gemacht? Das Beispiel mit verwendet?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696667</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696667</guid><dc:creator><![CDATA[oneill5000]]></dc:creator><pubDate>Thu, 16 Apr 2009 12:39:50 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Windows XP on Thu, 16 Apr 2009 14:03:52 GMT]]></title><description><![CDATA[<p>oneill5000 schrieb:</p>
<blockquote>
<p>UNd was hast jetzt gemacht? Das Beispiel mit verwendet?</p>
</blockquote>
<p>Meinen Code komplett gelöscht und nochmal neu nach deinem Beispiel geschrieben.:)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696707</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696707</guid><dc:creator><![CDATA[Fatal Error appears]]></dc:creator><pubDate>Thu, 16 Apr 2009 14:03:52 GMT</pubDate></item></channel></rss>