<?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[Windows Registry Fehler]]></title><description><![CDATA[<p>mein programm soll sich in den autostart schreiben, das klappt auch, allerding setzt das programm hinter den Wert drei punkte (link):<br />
<a href="http://dercoder.de.ohost.de/reg.jpg" rel="nofollow">dercoder.de.ohost.de/reg.jpg</a><br />
hier der code:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
using namespace std;

char MyApp[MAX_PATH];
char SysDir[MAX_PATH];
HMODULE HMod;
HKEY hKey;

int main() {
    //HMod = GetModuleHandle(NULL);
    GetModuleFileName(HMod, MyApp, sizeof(MyApp));
    GetSystemDirectory(SysDir, sizeof(SysDir));
    strcat(SysDir, &quot;\\MyApp.exe&quot;);
    CopyFile(MyApp, SysDir, 0);

	RegOpenKeyEx(HKEY_LOCAL_MACHINE, &quot;SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run&quot;, 0, KEY_SET_VALUE, &amp;hKey);
	RegSetValueEx(hKey, &quot;MyApp&quot;, 0, REG_SZ, (const unsigned char*)SysDir, MAX_PATH);
	RegCloseKey(hKey);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/244767/windows-registry-fehler</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Apr 2026 20:01:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/244767.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 05 Jul 2009 13:50:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Windows Registry Fehler on Sun, 05 Jul 2009 13:53:10 GMT]]></title><description><![CDATA[<p>mein programm soll sich in den autostart schreiben, das klappt auch, allerding setzt das programm hinter den Wert drei punkte (link):<br />
<a href="http://dercoder.de.ohost.de/reg.jpg" rel="nofollow">dercoder.de.ohost.de/reg.jpg</a><br />
hier der code:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
using namespace std;

char MyApp[MAX_PATH];
char SysDir[MAX_PATH];
HMODULE HMod;
HKEY hKey;

int main() {
    //HMod = GetModuleHandle(NULL);
    GetModuleFileName(HMod, MyApp, sizeof(MyApp));
    GetSystemDirectory(SysDir, sizeof(SysDir));
    strcat(SysDir, &quot;\\MyApp.exe&quot;);
    CopyFile(MyApp, SysDir, 0);

	RegOpenKeyEx(HKEY_LOCAL_MACHINE, &quot;SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run&quot;, 0, KEY_SET_VALUE, &amp;hKey);
	RegSetValueEx(hKey, &quot;MyApp&quot;, 0, REG_SZ, (const unsigned char*)SysDir, MAX_PATH);
	RegCloseKey(hKey);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1737448</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1737448</guid><dc:creator><![CDATA[DerCoder]]></dc:creator><pubDate>Sun, 05 Jul 2009 13:53:10 GMT</pubDate></item><item><title><![CDATA[Reply to Windows Registry Fehler on Sun, 05 Jul 2009 14:15:24 GMT]]></title><description><![CDATA[<p>MSDN schrieb:</p>
<blockquote>
<p>If the function succeeds, the return value is the length, in TCHARs, of the string copied to the buffer, <strong>not including the terminating null character</strong></p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1737456</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1737456</guid><dc:creator><![CDATA[KönnteSein]]></dc:creator><pubDate>Sun, 05 Jul 2009 14:15:24 GMT</pubDate></item><item><title><![CDATA[Reply to Windows Registry Fehler on Sun, 05 Jul 2009 14:50:43 GMT]]></title><description><![CDATA[<p>und das heißt auf deutsch?<br />
sry bin nicht so gut in englisch<br />
google translate sagt &quot;Wenn die Funktion erfolgreich ist, der Rückgabewert ist die Länge, in TCHARs, der String in den Puffer kopiert, ohne die Einstellung Null-Zeichen&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1737467</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1737467</guid><dc:creator><![CDATA[DerCoder]]></dc:creator><pubDate>Sun, 05 Jul 2009 14:50:43 GMT</pubDate></item><item><title><![CDATA[Reply to Windows Registry Fehler on Sun, 05 Jul 2009 14:52:02 GMT]]></title><description><![CDATA[<p>Sorry, das war für GetSystemDirectory().<br />
Ich hab jetzt aber keine Lust zu schauen was da genau gemacht werden muss.<br />
Lies die Doku für alle Funktionen die du nutzt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1737468</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1737468</guid><dc:creator><![CDATA[KönnteSein]]></dc:creator><pubDate>Sun, 05 Jul 2009 14:52:02 GMT</pubDate></item><item><title><![CDATA[Reply to Windows Registry Fehler on Sun, 05 Jul 2009 16:04:35 GMT]]></title><description><![CDATA[<p>niemand anders ne idee?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1737491</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1737491</guid><dc:creator><![CDATA[DerCoder]]></dc:creator><pubDate>Sun, 05 Jul 2009 16:04:35 GMT</pubDate></item><item><title><![CDATA[Reply to Windows Registry Fehler on Sun, 05 Jul 2009 16:13:30 GMT]]></title><description><![CDATA[<p>Ja! Der Tipp wirkt bei fast 90% der Anfragen in diesem Forum:</p>
<p>Lies einfachmal die Doku:<br />
RegSetValueEx<br />
<a href="http://msdn.microsoft.com/en-us/library/ms724923(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms724923(VS.85).aspx</a></p>
<blockquote>
<p>cbData [in]<br />
The size of the information pointed to by the lpData parameter, in bytes. If the data is of type REG_SZ, REG_EXPAND_SZ, or REG_MULTI_SZ, cbData must include the size of the terminating null character or characters.</p>
</blockquote>
<p>Anmerkung: Dein Programm wird unter Vista nicht funktionieren, sofern es nicht elevated läuft. Dein programm wird unter XP und Windows 2000 nicht funktionieren wenn es ncht als Admin läuft.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1737494</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1737494</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sun, 05 Jul 2009 16:13:30 GMT</pubDate></item><item><title><![CDATA[Reply to Windows Registry Fehler on Sun, 05 Jul 2009 16:44:42 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p>Anmerkung: Dein Programm wird unter Vista nicht funktionieren, sofern es nicht elevated läuft. Dein programm wird unter XP und Windows 2000 nicht funktionieren wenn es ncht als Admin läuft.</p>
</blockquote>
<p>Dagegen kann man aber auch nix tun, oder? Was meinst du genau mit &quot;elevated&quot;? &quot;Run as administrator&quot;?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1737502</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1737502</guid><dc:creator><![CDATA[KönnteSein]]></dc:creator><pubDate>Sun, 05 Jul 2009 16:44:42 GMT</pubDate></item><item><title><![CDATA[Reply to Windows Registry Fehler on Sun, 05 Jul 2009 17:11:23 GMT]]></title><description><![CDATA[<p>kannste mir den iwie am code etwas umschreiben, wie das gehen würd mit den nullstellen? bin noch kein Pr0 in c++</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1737516</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1737516</guid><dc:creator><![CDATA[DerCoder]]></dc:creator><pubDate>Sun, 05 Jul 2009 17:11:23 GMT</pubDate></item></channel></rss>