<?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[Bild in einem Fenster anzeigen&#x2F;laden]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich möchte in einem Fenster ein Bild anzeigen. Ich habe allerdings bei der Forensuche nur beiträge gesehen in dennen das über WM_PAINT gemacht wird gesehen. In dem Fenster in dem das Bild angezeigt werden soll gibt es aber ncoh andere Fenster die nicht mehr gezeichnet werden wenn ich WM_PAINT benutzte. Hat jemmand ne Idee wie ich das machen kann oder wo ich ein gutes Tut zu Bilden in Fenstern finde?</p>
<p>PS: Das bild liegt als bmp vor.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/91903/bild-in-einem-fenster-anzeigen-laden</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 10:35:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/91903.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 13 Nov 2004 15:42:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bild in einem Fenster anzeigen&#x2F;laden on Sat, 13 Nov 2004 15:42:09 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich möchte in einem Fenster ein Bild anzeigen. Ich habe allerdings bei der Forensuche nur beiträge gesehen in dennen das über WM_PAINT gemacht wird gesehen. In dem Fenster in dem das Bild angezeigt werden soll gibt es aber ncoh andere Fenster die nicht mehr gezeichnet werden wenn ich WM_PAINT benutzte. Hat jemmand ne Idee wie ich das machen kann oder wo ich ein gutes Tut zu Bilden in Fenstern finde?</p>
<p>PS: Das bild liegt als bmp vor.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/650945</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/650945</guid><dc:creator><![CDATA[flammenvogel]]></dc:creator><pubDate>Sat, 13 Nov 2004 15:42:09 GMT</pubDate></item><item><title><![CDATA[Reply to Bild in einem Fenster anzeigen&#x2F;laden on Sat, 13 Nov 2004 16:10:46 GMT]]></title><description><![CDATA[<p>Dann ist entweder dein WM_PAINT-Zweig falsch oder die anderen Fenster sind falsch designed. Zeig doch mal deinen Versuch.</p>
<p>Prinzipiell wird immer alles in (&quot;irgendeinem&quot;) WM_PAINT gezeichnet!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/650966</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/650966</guid><dc:creator><![CDATA[D*niel *chumann]]></dc:creator><pubDate>Sat, 13 Nov 2004 16:10:46 GMT</pubDate></item><item><title><![CDATA[Reply to Bild in einem Fenster anzeigen&#x2F;laden on Sat, 13 Nov 2004 16:18:39 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">case WM_CREATE:
        	//Intialiesierungen
        	static HINSTANCE hinstance = (HINSTANCE) GetWindowLong(hwnd,GWL_HINSTANCE);

       		CreateWindow(&quot;static&quot;, &quot;Latein:&quot;, WS_VISIBLE | WS_CHILD, 60,100,100,20, hwnd, NULL, hinstance, NULL);
       		CreateWindow(&quot;static&quot;, &quot;Deutsch:&quot;, WS_VISIBLE | WS_CHILD, 60,140,100,20, hwnd, NULL, hinstance, NULL);
       		CreateWindow(&quot;static&quot;, &quot;Zusätze:&quot;, WS_VISIBLE | WS_CHILD, 60,180,100,20, hwnd, NULL, hinstance, NULL);
         	CreateWindow(&quot;edit&quot;, &quot;&quot;, WS_VISIBLE | WS_CHILD | WS_BORDER, 140,100,160,20, hwnd, (HMENU) EDIT_LATEIN, hinstance, NULL);
       		CreateWindow(&quot;edit&quot;, &quot;&quot;, WS_VISIBLE | WS_CHILD | WS_BORDER, 140,140,160,20, hwnd, (HMENU) EDIT_DEUTSCH, hinstance, NULL);
       		CreateWindow(&quot;edit&quot;, &quot;&quot;, WS_VISIBLE | WS_CHILD | WS_BORDER, 140,180,160,20, hwnd, (HMENU) EDIT_ZUSATZ, hinstance, NULL);
       		CreateWindow(&quot;button&quot;, &quot;Weiter&quot;, WS_VISIBLE | WS_CHILD, 220,220,100,30, hwnd, (HMENU) BU_WEITER, hinstance, NULL);
       		CreateWindow(&quot;button&quot;, &quot;Lösung&quot;, WS_VISIBLE | WS_CHILD, 100,220,100,30, hwnd, (HMENU) BU_LOSUNG, hinstance, NULL);

       		EnumChildWindows(hwnd, EnumChildProc, 0);
  		case WM_COMMAND:
  			switch(LOWORD(wParam))
  			{
				case BU_WEITER:
    				MessageBox(0, &quot;Weiter&quot;, 0,0);   				  			        			    		
					break;
				case BU_LOSUNG:
					MessageBox(0, &quot;Lösung&quot;, 0,0); 
					break;
				case MENU_OFFNEN:
					MessageBox(0, &quot;Öffnen&quot;, 0,0);
					break;
				case MENU_SPEICHERN:
					MessageBox(0, &quot;Speichern&quot;,0,0);
					break;
				case MENU_DRUCKEN:
					MessageBox(0,&quot;Drucken&quot;,0,0);
					break;
        	}
    	case WM_PAINT:
break;
</code></pre>
<p>Hier werden die einzelnen Elemente des Fensters die bei WM_CREATE stehen nicht gezeichnet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/650970</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/650970</guid><dc:creator><![CDATA[flammenvogel]]></dc:creator><pubDate>Sat, 13 Nov 2004 16:18:39 GMT</pubDate></item><item><title><![CDATA[Reply to Bild in einem Fenster anzeigen&#x2F;laden on Sat, 13 Nov 2004 16:24:22 GMT]]></title><description><![CDATA[<p>WM_PAINT ist ja leer <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> Ich meinte mit dem Bild zeichnen.</p>
<p>BTW: fehlen da einige &quot;return 0;&quot; bzw. break;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/650972</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/650972</guid><dc:creator><![CDATA[D*niel *chumann]]></dc:creator><pubDate>Sat, 13 Nov 2004 16:24:22 GMT</pubDate></item><item><title><![CDATA[Reply to Bild in einem Fenster anzeigen&#x2F;laden on Sat, 13 Nov 2004 16:44:07 GMT]]></title><description><![CDATA[<p>Also das ist nur ein Ausschnit und das das Break nach WM_CREATE fehlt ist nicht so tragisch, (habe ich jetzt hingemacht). Ich glaube das Problem ist das die Schaltflächen deshalb nicht gezeichnet werden weil, sie mit DefWindowProc arbeiten, das ja nur bei nachrichten aufgerufen wird die ich nicht selber behandele.</p>
<p>Da es jetzt schon nicht mit einem leeren WM_PAINT funktioniert, wird es auch dann nicht funktionieren wenn WM_PAINT da ist.</p>
<p>HINWEIS: Es funktioniert nur (das überhaupt was gezeichnet wird), wenn ich WM_PAINT ganz weglasse.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/650992</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/650992</guid><dc:creator><![CDATA[flammenvogel]]></dc:creator><pubDate>Sat, 13 Nov 2004 16:44:07 GMT</pubDate></item><item><title><![CDATA[Reply to Bild in einem Fenster anzeigen&#x2F;laden on Sat, 13 Nov 2004 16:45:23 GMT]]></title><description><![CDATA[<p>In WM_PAINT musst du BeginPaint/EndPaint oder ValidateRect aufrufen oder es die DefWindowProc machen lassen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/650995</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/650995</guid><dc:creator><![CDATA[aaaaaa]]></dc:creator><pubDate>Sat, 13 Nov 2004 16:45:23 GMT</pubDate></item><item><title><![CDATA[Reply to Bild in einem Fenster anzeigen&#x2F;laden on Sun, 14 Nov 2004 10:26:15 GMT]]></title><description><![CDATA[<p>Toll und wie kann ich in WM_PAINT ein Bild zeichnen und es gleichzeitig an die DefWndProc weitergeben. Einfach am Ende von WM_PAINT DefWndProc aufrufen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/651295</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/651295</guid><dc:creator><![CDATA[flammenvogel]]></dc:creator><pubDate>Sun, 14 Nov 2004 10:26:15 GMT</pubDate></item><item><title><![CDATA[Reply to Bild in einem Fenster anzeigen&#x2F;laden on Sun, 14 Nov 2004 10:29:16 GMT]]></title><description><![CDATA[<p>Was ich ganz vergessen habe zu erwähnen, gibt es ne möglichkeit das Bild einfach so einzufügen wie ich den Rest gemacht habe, also mit CreateWindow(&quot;xy&quot;, ...)?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/651298</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/651298</guid><dc:creator><![CDATA[flammenvogel]]></dc:creator><pubDate>Sun, 14 Nov 2004 10:29:16 GMT</pubDate></item><item><title><![CDATA[Reply to Bild in einem Fenster anzeigen&#x2F;laden on Sun, 14 Nov 2004 13:31:03 GMT]]></title><description><![CDATA[<p>flammenvogel schrieb:</p>
<blockquote>
<p>Toll und wie kann ich in WM_PAINT ein Bild zeichnen und es gleichzeitig an die DefWndProc weitergeben. Einfach am Ende von WM_PAINT DefWndProc aufrufen?</p>
</blockquote>
<p>Wofür sollte das denn gut sein?</p>
<p>Möglichkeiten:<br />
<strong>1.</strong> Du lässt Windows alles selber zeichnen: WM_PAINT wird nicht abgefangen</p>
<p><strong>2.</strong> Du zeichnest das Fenster selber: WM_PAINT wird abgefangen:</p>
<pre><code class="language-cpp">case WM_PAINT:
        return OnPaint();
</code></pre>
<p><strong>2.a)</strong> &quot;leeres&quot; OnPaint():</p>
<pre><code class="language-cpp">BOOL CppAppWnd::OnPaint()
{       
PAINTSTRUCT ps;           // fehlen diese drei Zeilen,
BeginPaint(hAppWnd,&amp;ps);  //   produziert man eine 
EndPaint(hAppWnd,&amp;ps);    //     Endlosschleife
return 0;
}
</code></pre>
<p><strong>2.b)</strong> selber etwas zeichnen</p>
<pre><code class="language-cpp">BOOL CppAppWnd::OnPaint()
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hMapScroll, &amp;ps);
HDC hdcMem = CreateCompatibleDC(NULL);

// Male das bitmap ins Map-Feld
SelectObject(hdcMem, hBmp); 
BitBlt(hdc, 0, 0, xMapScroll, yMapScroll, hdcMem, xPos, yPos, SRCCOPY);

EndPaint(hAppWnd,&amp;ps);
return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/651431</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/651431</guid><dc:creator><![CDATA[nate7]]></dc:creator><pubDate>Sun, 14 Nov 2004 13:31:03 GMT</pubDate></item><item><title><![CDATA[Reply to Bild in einem Fenster anzeigen&#x2F;laden on Sun, 14 Nov 2004 17:02:02 GMT]]></title><description><![CDATA[<p>flammenvogel schrieb:</p>
<blockquote>
<p>Was ich ganz vergessen habe zu erwähnen, gibt es ne möglichkeit das Bild einfach so einzufügen wie ich den Rest gemacht habe, also mit CreateWindow(&quot;xy&quot;, ...)?</p>
</blockquote>
<p><strong>3.</strong><br />
Ein static-Control kann Bilder anzeigen: <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/staticcontrols/staticcontrolreference/staticcontrolmessages/stm_setimage.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/staticcontrols/staticcontrolreference/staticcontrolmessages/stm_setimage.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/651630</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/651630</guid><dc:creator><![CDATA[D*niel *chumann]]></dc:creator><pubDate>Sun, 14 Nov 2004 17:02:02 GMT</pubDate></item><item><title><![CDATA[Reply to Bild in einem Fenster anzeigen&#x2F;laden on Sun, 14 Nov 2004 21:26:31 GMT]]></title><description><![CDATA[<p>Danke es läuft jetzt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/651851</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/651851</guid><dc:creator><![CDATA[flammenvogel]]></dc:creator><pubDate>Sun, 14 Nov 2004 21:26:31 GMT</pubDate></item></channel></rss>