<?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[Mal wieder IActiveDesktop]]></title><description><![CDATA[<p>Servus ihr Programmierer,</p>
<p>ich bin nach langem Suchen, wie ich ein JPG-Bild als Hintergrundbild einstellen kann, auf diesen Sourcecode gekommen:</p>
<pre><code>#define _WIN32_IE 0x400 
#include &lt;windows.h&gt; 
#include &lt;tchar.h&gt; 
#include &lt;wininet.h&gt; 
#include &lt;shlobj.h&gt; 

long changeWallpaper(char *strPicPath, DWORD flags) 
{ 
 WCHAR tempstr[MAX_PATH]; 
 MultiByteToWideChar(CP_ACP, 0, strPicPath, -1, tempstr, sizeof(tempstr) ); 

 HRESULT hr; 
 IActiveDesktop *pActiveDesktop; 

 CoInitialize(NULL); 
 hr = CoCreateInstance(CLSID_ActiveDesktop, NULL,CLSCTX_INPROC_SERVER,IID_IActiveDesktop, (void**)&amp;pActiveDesktop); 
 if(hr == S_OK ) 
 { 
       pActiveDesktop-&gt;SetWallpaper(tempstr, 0); 
       WALLPAPEROPT wpo; 
       wpo.dwSize = sizeof(WALLPAPEROPT); 
       wpo.dwStyle = flags; 
       pActiveDesktop-&gt;SetWallpaperOptions(&amp;wpo,0); 
       pActiveDesktop-&gt;ApplyChanges(AD_APPLY_ALL); 
       pActiveDesktop-&gt;Release(); 
       return TRUE; 
 } 
 else return FALSE; 
}
</code></pre>
<p>Ich arbeite mit dev c++. Der bringt folgende Fehler:</p>
<pre><code>desctop.c: In function `changeWallpaper':
desctop.c:14: error: `IActiveDesktop' undeclared (first use in this function)
desctop.c:14: error: (Each undeclared identifier is reported only once
desctop.c:14: error: for each function it appears in.)
desctop.c:14: error: `pActiveDesktop' undeclared (first use in this function)
desctop.c:17: error: `CLSID_ActiveDesktop' undeclared (first use in this function)
desctop.c:17: error: `IID_IActiveDesktop' undeclared (first use in this function)

desctop.c:21: error: `WALLPAPEROPT' undeclared (first use in this function)
desctop.c:21: error: syntax error before &quot;wpo&quot;
desctop.c:22: error: `wpo' undeclared (first use in this function)
desctop.c:25: error: `AD_APPLY_ALL' undeclared (first use in this function)

C:\Dev-cpp\bin\make.exe: *** [desctop.o] Error 1
</code></pre>
<p>Er findet also IActiveDesktop... nicht. Aber in welcher Bibliothek ist die Funktion definiert? Was hab ich falsch gemacht?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/206862/mal-wieder-iactivedesktop</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 03:55:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/206862.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 Feb 2008 20:09:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Fri, 29 Feb 2008 20:09:41 GMT]]></title><description><![CDATA[<p>Servus ihr Programmierer,</p>
<p>ich bin nach langem Suchen, wie ich ein JPG-Bild als Hintergrundbild einstellen kann, auf diesen Sourcecode gekommen:</p>
<pre><code>#define _WIN32_IE 0x400 
#include &lt;windows.h&gt; 
#include &lt;tchar.h&gt; 
#include &lt;wininet.h&gt; 
#include &lt;shlobj.h&gt; 

long changeWallpaper(char *strPicPath, DWORD flags) 
{ 
 WCHAR tempstr[MAX_PATH]; 
 MultiByteToWideChar(CP_ACP, 0, strPicPath, -1, tempstr, sizeof(tempstr) ); 

 HRESULT hr; 
 IActiveDesktop *pActiveDesktop; 

 CoInitialize(NULL); 
 hr = CoCreateInstance(CLSID_ActiveDesktop, NULL,CLSCTX_INPROC_SERVER,IID_IActiveDesktop, (void**)&amp;pActiveDesktop); 
 if(hr == S_OK ) 
 { 
       pActiveDesktop-&gt;SetWallpaper(tempstr, 0); 
       WALLPAPEROPT wpo; 
       wpo.dwSize = sizeof(WALLPAPEROPT); 
       wpo.dwStyle = flags; 
       pActiveDesktop-&gt;SetWallpaperOptions(&amp;wpo,0); 
       pActiveDesktop-&gt;ApplyChanges(AD_APPLY_ALL); 
       pActiveDesktop-&gt;Release(); 
       return TRUE; 
 } 
 else return FALSE; 
}
</code></pre>
<p>Ich arbeite mit dev c++. Der bringt folgende Fehler:</p>
<pre><code>desctop.c: In function `changeWallpaper':
desctop.c:14: error: `IActiveDesktop' undeclared (first use in this function)
desctop.c:14: error: (Each undeclared identifier is reported only once
desctop.c:14: error: for each function it appears in.)
desctop.c:14: error: `pActiveDesktop' undeclared (first use in this function)
desctop.c:17: error: `CLSID_ActiveDesktop' undeclared (first use in this function)
desctop.c:17: error: `IID_IActiveDesktop' undeclared (first use in this function)

desctop.c:21: error: `WALLPAPEROPT' undeclared (first use in this function)
desctop.c:21: error: syntax error before &quot;wpo&quot;
desctop.c:22: error: `wpo' undeclared (first use in this function)
desctop.c:25: error: `AD_APPLY_ALL' undeclared (first use in this function)

C:\Dev-cpp\bin\make.exe: *** [desctop.o] Error 1
</code></pre>
<p>Er findet also IActiveDesktop... nicht. Aber in welcher Bibliothek ist die Funktion definiert? Was hab ich falsch gemacht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1465786</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1465786</guid><dc:creator><![CDATA[Felix15]]></dc:creator><pubDate>Fri, 29 Feb 2008 20:09:41 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Fri, 29 Feb 2008 20:18:17 GMT]]></title><description><![CDATA[<p>Nimm Visual C++</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1465788</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1465788</guid><dc:creator><![CDATA[tipp]]></dc:creator><pubDate>Fri, 29 Feb 2008 20:18:17 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Fri, 29 Feb 2008 20:46:53 GMT]]></title><description><![CDATA[<p>Geht das auch mit Dev c++?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1465799</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1465799</guid><dc:creator><![CDATA[Felix15]]></dc:creator><pubDate>Fri, 29 Feb 2008 20:46:53 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Fri, 29 Feb 2008 21:52:58 GMT]]></title><description><![CDATA[<p><a href="http://www.c-plusplus.net/forum/viewtopic-var-p-is-92348.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-p-is-92348.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1465826</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1465826</guid><dc:creator><![CDATA[Ramsis]]></dc:creator><pubDate>Fri, 29 Feb 2008 21:52:58 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 08:36:59 GMT]]></title><description><![CDATA[<p>Danke für den Link, aber da war ich auch schon. Das Problem ist die Lösung, die bei diesem Thema herauskam:</p>
<blockquote>
<p>Ich habe es jetzt endlich geschafft. Danke für die Hinweise.<br />
Entscheidend ist offenbar folgende Sequenz:</p>
<p>#define _WIN32_IE 0x0400 // IE 4+<br />
#include &lt;afx.h&gt;<br />
#include &lt;wininet.h&gt;</p>
<p>die auch noch an der richtigen Stelle eingebunden werden muß.</p>
</blockquote>
<p>Aber ich habe keine Bibliothek, die afx.h heißt. Jetzt hab ich mal gegooglet und bin auf folgende Adresse gestoßen:<br />
<a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3019&amp;SiteID=1" rel="nofollow">http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3019&amp;SiteID=1</a><br />
Da steht, dass die Bibliothek in der Platform SDK enthalten ist. Kann man die Bibliothek auch allein ohne SDK downloaden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1465907</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1465907</guid><dc:creator><![CDATA[Felix15]]></dc:creator><pubDate>Sat, 01 Mar 2008 08:36:59 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 09:54:23 GMT]]></title><description><![CDATA[<p>Ein afx.h Header hat bei einem Dev++ Projekt nichts zu suchen, zumal du es wahrscheinlich gar nicht hinbekommen solltest, diesen gescheit/vollständig zu implementieren. Hast du denn schon dieses Define drinnen? Das muss ganz oben hin vor deinen Headern!</p>
<pre><code class="language-cpp">#define _WIN32_IE 0x0400 // IE 4+
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1465928</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1465928</guid><dc:creator><![CDATA[yogle_]]></dc:creator><pubDate>Sat, 01 Mar 2008 09:54:23 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 10:03:12 GMT]]></title><description><![CDATA[<p>Verwende VC2008EE, da ist das PSDK schon dabei...<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-143003.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-143003.html</a></p>
<p>Für Dev C++ musst Du Dich an den Hersteller wenden!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1465932</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1465932</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sat, 01 Mar 2008 10:03:12 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 10:03:49 GMT]]></title><description><![CDATA[<p>Ja, hab ich. Siehe oben^^.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1465933</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1465933</guid><dc:creator><![CDATA[Felix15]]></dc:creator><pubDate>Sat, 01 Mar 2008 10:03:49 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 10:05:26 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/5675">@Jochen</a>: Also hat man das bisher noch nie mit Dev c++ gemacht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1465935</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1465935</guid><dc:creator><![CDATA[Felix15]]></dc:creator><pubDate>Sat, 01 Mar 2008 10:05:26 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 10:08:14 GMT]]></title><description><![CDATA[<p>In der Doku steht dass Du shlobj.h includen musst!<br />
<a href="http://msdn2.microsoft.com/en-us/library/bb776357.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/bb776357.aspx</a></p>
<p>Hast Du das gemacht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1465938</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1465938</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sat, 01 Mar 2008 10:08:14 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 10:10:43 GMT]]></title><description><![CDATA[<p>Oha, okay jetzt habe ich es auch gesehen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /><br />
Habe es gerade geprüft, das hier funktioniert als Konsolenprogramm mit VS05 auch ohne afx.h</p>
<pre><code class="language-cpp">#define _WIN32_IE 0x400

#include &lt;windows.h&gt;
#include &lt;tchar.h&gt;
#include &lt;wininet.h&gt;
#include &lt;shlobj.h&gt;

long changeWallpaper (char *strPicPath, DWORD flags)
{
	WCHAR tempstr[MAX_PATH];
	MultiByteToWideChar (CP_ACP, 0, strPicPath, -1, tempstr, sizeof(tempstr) );

	HRESULT hr;
	IActiveDesktop *pActiveDesktop;

	CoInitialize(NULL);
	hr = CoCreateInstance (CLSID_ActiveDesktop, NULL,CLSCTX_INPROC_SERVER,IID_IActiveDesktop, (void**)&amp;pActiveDesktop);
	if(hr == S_OK )
	{
		pActiveDesktop-&gt;SetWallpaper(tempstr, 0);
		WALLPAPEROPT wpo;
		wpo.dwSize = sizeof(WALLPAPEROPT);
		wpo.dwStyle = flags;
		pActiveDesktop-&gt;SetWallpaperOptions(&amp;wpo,0);
		pActiveDesktop-&gt;ApplyChanges(AD_APPLY_ALL);
		pActiveDesktop-&gt;Release();
		return TRUE;
	}
	else return FALSE;
}

int main ()
{
	changeWallpaper (&quot;C:\\Dokumente und Einstellungen\\Sebastian\\Eigene Dateien\\Eigene Bilder\\Jessica_Alba.jpg&quot;, 0);
	return 0;
}
</code></pre>
<p>Raten würde ich dir auch zu VS. Dev++ ist nicht wirklich das Wahre.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1465939</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1465939</guid><dc:creator><![CDATA[yogle_]]></dc:creator><pubDate>Sat, 01 Mar 2008 10:10:43 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 10:11:57 GMT]]></title><description><![CDATA[<p>Felix15 schrieb:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/5675">@Jochen</a>: Also hat man das bisher noch nie mit Dev c++ gemacht?</p>
</blockquote>
<p>Ich kenn mich mit Dev C++ nicht aus... weiss nur, dass man da das PSDK nicht einbinden kann, sondern das nehmen muss was mitkommt... und das ist in unserer schnelllebigen Zeit leider schlecht...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1465940</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1465940</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sat, 01 Mar 2008 10:11:57 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 10:22:00 GMT]]></title><description><![CDATA[<p>Ok, danke für eure Antworten. Ich probiers dann mal mit Visual Studio. Wenn ihr doch einmal herausfinden solltet, wie das mit dev c++ geht, schreibt mir bitte ne Mail.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1465942</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1465942</guid><dc:creator><![CDATA[Felix15]]></dc:creator><pubDate>Sat, 01 Mar 2008 10:22:00 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 11:51:53 GMT]]></title><description><![CDATA[<p>Dev-C++ wird seit Februar 2005 nicht mehr weiterentwickelt.<br />
Alternative (außer VisualStudio): <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-206784-and-start-is-0-and-postdays-is-0-and-postorder-is-asc-and-highlight-is-.html" rel="nofollow">Code:Blocks</a></p>
<p>greetz, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1465995</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1465995</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Sat, 01 Mar 2008 11:51:53 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 12:28:14 GMT]]></title><description><![CDATA[<p>Swordfish schrieb:</p>
<blockquote>
<p>Code:Blocks</p>
</blockquote>
<p>Aber das Problem mit dem PSDK bleibt dabei das gleiche, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1466011</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1466011</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sat, 01 Mar 2008 12:28:14 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 12:36:58 GMT]]></title><description><![CDATA[<p>Jochen Kalmbach schrieb:</p>
<blockquote>
<p>Swordfish schrieb:</p>
<blockquote>
<p>Code:Blocks</p>
</blockquote>
<p>Aber das Problem mit dem PSDK bleibt dabei das gleiche, oder?</p>
</blockquote>
<p>Das Problem bleibt das gleiche wenn der MinGW verwendet wird. Code::Blocks ist nur eine IDE!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1466014</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1466014</guid><dc:creator><![CDATA[yogle_]]></dc:creator><pubDate>Sat, 01 Mar 2008 12:36:58 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 13:08:59 GMT]]></title><description><![CDATA[<p>Fazit: Code:Blocks ist nicht verwendbar...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1466026</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1466026</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sat, 01 Mar 2008 13:08:59 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 13:26:22 GMT]]></title><description><![CDATA[<p>MinGW ist nicht verwendbar <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>greetz, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1466028</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1466028</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Sat, 01 Mar 2008 13:26:22 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 14:00:13 GMT]]></title><description><![CDATA[<p>kann man sich nicht die nötigen definitionen aus dem windows sdk klauen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1466046</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1466046</guid><dc:creator><![CDATA[´´]]></dc:creator><pubDate>Sat, 01 Mar 2008 14:00:13 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder IActiveDesktop on Sat, 01 Mar 2008 14:13:51 GMT]]></title><description><![CDATA[<p>Und woher die a-Dateien nehmen?<br />
Wenn Du zu viel Zeit hast, mag das ja der Weg sein...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1466055</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1466055</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sat, 01 Mar 2008 14:13:51 GMT</pubDate></item></channel></rss>