<?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[mist -&amp;gt; Verzweiflung]]></title><description><![CDATA[<p>Problem: Ein Programm klappt nicht. da der QuellText etwas länger ist, versuch ich mal das Fehler - Ausschlussverfahren, hoffe dabei auf Hilfe von Forumlern ^^&quot;&quot;<br />
erstma 2 Fragen:</p>
<pre><code>Frage 1, ist das gültig?:
SetWindowLong(hWnd, 0, (LONG) hBitmap);
...
hBitmap =(HBITMAP) GetWindowLong(hWnd, 0);

Frage 2, dasselbe mit TCHAR* anstatt HBITMAP
</code></pre>
<p>falls das nicht bringt, schau ich, was noch böse sein könnte, hoffentlich klappt das am Ende <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f623.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--persevering_face"
      title="&gt;.&lt;"
      alt="😣"
    /></p>
<p>p.S: Falls einer so freundlich ist, mal über den ganzen Quelltext zu gucken, der möge sich bitte melden. (Aber bitte net mit 62938742304872€/Stunde ankommen - bin arbeitsloser Schüler xDD)</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/173213/mist-gt-verzweiflung</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Jul 2026 02:10:44 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/173213.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 Feb 2007 21:35:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Mon, 12 Feb 2007 21:36:18 GMT]]></title><description><![CDATA[<p>Problem: Ein Programm klappt nicht. da der QuellText etwas länger ist, versuch ich mal das Fehler - Ausschlussverfahren, hoffe dabei auf Hilfe von Forumlern ^^&quot;&quot;<br />
erstma 2 Fragen:</p>
<pre><code>Frage 1, ist das gültig?:
SetWindowLong(hWnd, 0, (LONG) hBitmap);
...
hBitmap =(HBITMAP) GetWindowLong(hWnd, 0);

Frage 2, dasselbe mit TCHAR* anstatt HBITMAP
</code></pre>
<p>falls das nicht bringt, schau ich, was noch böse sein könnte, hoffentlich klappt das am Ende <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f623.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--persevering_face"
      title="&gt;.&lt;"
      alt="😣"
    /></p>
<p>p.S: Falls einer so freundlich ist, mal über den ganzen Quelltext zu gucken, der möge sich bitte melden. (Aber bitte net mit 62938742304872€/Stunde ankommen - bin arbeitsloser Schüler xDD)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1227784</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227784</guid><dc:creator><![CDATA[Azrael* il Meraz]]></dc:creator><pubDate>Mon, 12 Feb 2007 21:36:18 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Mon, 12 Feb 2007 21:59:47 GMT]]></title><description><![CDATA[<p>gültig kann es sein, sinnlos ist es aber vermutlich. was versuchst du zu erreichen?<br />
schau dir die parameter an.<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windowclasses/windowclassreference/windowclassfunctions/setwindowlong.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windowclasses/windowclassreference/windowclassfunctions/setwindowlong.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1227796</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227796</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 12 Feb 2007 21:59:47 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Mon, 12 Feb 2007 22:14:09 GMT]]></title><description><![CDATA[<p>Frage 1 : gültig<br />
Frage 2 : gültig</p>
<p>Es kann u.U. sein, dass die Werte, die Du mit SetWindowLong () gespeichert hast, ungültig wurden. Das liegt allerdings nicht an Get/SetWindowLong ().</p>
<p>Beschreibe das Problem mal näher.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1227806</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227806</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 12 Feb 2007 22:14:09 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Mon, 12 Feb 2007 22:49:19 GMT]]></title><description><![CDATA[<p>naja, der Anwendungsbereich ist in 25 Teile geteilt (5x5) - jeder Teil ist ein ChildWindow. diese sollen auf knopfdruck ein Bild anzeigen oder ihren eigenen Anwendungsbereich weiß färben (wenn dort zuvor ein Bild war). Auf jeden Fall ist im Zusatzspeicher vom Hauptfenster eine Struktur gespeichert:</p>
<pre><code class="language-cpp">struct HauptInfo
{
	TCHAR* pszFeldName;   // ersatz für ne globale Variable
	short idFocus;        // das z.Z aktive Child-Fenster
	HBITMAP hActiveBmp;   // ein (Später auswählbares) BITMAP, bzw ein Handle
	int cxBmp;            // Bitmapbreite
	int cyBmp;            // BitmapHöhe
};
</code></pre>
<p>Gespeichert wird diese im Speicher mit dieser Funktion:</p>
<pre><code class="language-cpp">int SetHInfo(HWND hWnd, HauptInfo HInfo)
{
	SetWindowLong(hWnd, 0,(LONG) HInfo.pszFeldName);
	SetWindowWord(hWnd, sizeof(TCHAR*),(short) HInfo.idFocus);
	SetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(int),(LONG) HInfo.hActiveBmp);
	SetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(int) + sizeof(HBITMAP),(LONG) HInfo.cxBmp);
	SetWindowLong(hWnd, sizeof(TCHAR*) + 2*sizeof(int) + sizeof(HBITMAP),(LONG) HInfo.cyBmp);
	return 0;
}
</code></pre>
<p>Abgeholt wird die Information durch</p>
<pre><code class="language-cpp">int GetHInfo(HWND hWnd, HauptInfo &amp;HInfo)
{
	HInfo.pszFeldName	= (TCHAR*) GetWindowLong(hWnd, 0);
	HInfo.idFocus		= (short) GetWindowWord(hWnd, sizeof(TCHAR*));
	HInfo.hActiveBmp	= (HBITMAP) (GetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(short)));
	HInfo.cxBmp			= (int) GetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(int) + sizeof(HBITMAP));
	HInfo.cyBmp			= (int) GetWindowLong(hWnd, sizeof(TCHAR*) + 2*sizeof(int) + sizeof(HBITMAP));
	return 0;
}
</code></pre>
<p>bei WM_CREATE des Haupt Proc wird folgendes gemacht:</p>
<pre><code class="language-cpp">case WM_CREATE:
		// für Bitmap
		hInstance = ((LPCREATESTRUCT) lParam)-&gt;hInstance;
		for(y = 0; y&lt;5;y++)
		for(x = 0; x&lt;5;x++)
		{
			FeldHwnd[x][y] = CreateWindow(HInfo.pszFeldName, 
			NULL, 
			WS_CHILDWINDOW | WS_VISIBLE,
			0,0,0,0,	//braucht man nicht, da Werte bei Size gesetzt werden
			hWnd,
			(HMENU) (y &lt;&lt; 8 | x),
			(HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),
			NULL);
		}
		// Bitmap Laden
		HInfo.hActiveBmp = LoadBitmap(hInstance, TEXT(&quot;bitmap&quot;));
		GetObject(HInfo.hActiveBmp, sizeof(BITMAP), &amp;bitmap);

		// für spätere Ausgabe
		HInfo.cxBmp = bitmap.bmWidth;
		HInfo.cyBmp = bitmap.bmHeight;
		// Infos speichern
		SetHInfo(hWnd, HInfo);
		return 0;
</code></pre>
<p>hier nochmal die Objekte/Variablen des HauptProcs:</p>
<pre><code class="language-cpp">// 25 Felder
	static HWND FeldHwnd[5][5];
	static short idFocus = (short) LOWORD(GetWindowLong(hWnd, sizeof(TCHAR*)));
	// gebrauchte Variablen
	int x, y;
	static int cxClient, cyClient, cxSource, cySource;
	TCHAR Text[10];
	static HauptInfo HInfo;

	// Hier werden die Infos jedes mal abgeholt abgeholt
	GetHInfo(hWnd, HInfo);
	BITMAP bitmap;
	HINSTANCE hInstance;
</code></pre>
<p>dann gibt es noch eine Struktur, die im Nebenspeicher des Child-Windows gespeichert wird:</p>
<pre><code class="language-cpp">struct FeldInfo
{
	HBITMAP hBmp;
	short pmd;
	RECT rect;
	int cxBmp;
	int cyBmp;
};
</code></pre>
<p>hier die set und getfunktionen:</p>
<pre><code class="language-cpp">int SetFInfo(HWND hWnd, FeldInfo FInfo)
{
	SetWindowLong(hWnd, 0,(LONG) FInfo.hBmp);
	SetWindowWord(hWnd, sizeof(HBITMAP),(short) FInfo.pmd);
	SetWindowLong(hWnd, sizeof(HBITMAP) + sizeof(short), FInfo.rect.left);
	SetWindowLong(hWnd, sizeof(HBITMAP) + sizeof(short) + sizeof(LONG), FInfo.rect.top);
	SetWindowLong(hWnd, sizeof(HBITMAP) + sizeof(short) + 2*sizeof(LONG), FInfo.rect.right);
	SetWindowLong(hWnd, sizeof(HBITMAP) + sizeof(short) + 3*sizeof(LONG), FInfo.rect.bottom);
	SetWindowLong(hWnd, sizeof(HBITMAP) + sizeof(short) + 4*sizeof(LONG),FInfo.cxBmp);
	SetWindowLong(hWnd, sizeof(HBITMAP) + sizeof(short) + 4*sizeof(LONG) + sizeof(int),FInfo.cyBmp);
	return 0;
}

int GetFInfo(HWND hWnd, FeldInfo &amp;FInfo)
{
	FInfo.hBmp			= (HBITMAP) GetWindowLong(hWnd, 0);
	FInfo.pmd			= GetWindowWord(hWnd, sizeof(HBITMAP));
	FInfo.rect.left		= GetWindowLong(hWnd, sizeof(HBITMAP) + sizeof(short));
	FInfo.rect.top		= GetWindowLong(hWnd, sizeof(HBITMAP) + sizeof(short) + sizeof(LONG));
	FInfo.rect.right	= GetWindowLong(hWnd, sizeof(HBITMAP) + sizeof(short) + 2*sizeof(LONG));
	FInfo.rect.bottom	= GetWindowLong(hWnd, sizeof(HBITMAP) + sizeof(short) + 3*sizeof(LONG));
	FInfo.cxBmp			= GetWindowLong(hWnd, sizeof(HBITMAP) + sizeof(short) + 4*sizeof(LONG));
	FInfo.cyBmp			= GetWindowLong(hWnd, sizeof(HBITMAP) + sizeof(short) + 4*sizeof(LONG) + sizeof(int));
	return 0;
}
</code></pre>
<p>bei WM_LBUTTONDOWN im FeldProc geschieht folgendes:</p>
<pre><code class="language-cpp">if(FInfo.pmd == BRUSH)
		{
			FInfo.hBmp = GetHIhB(GetParent(hWnd)); //Die Funktion gibt das im Nebenspeicher des Hauptfensters gespeicherte Bitmaphandle zurück
			FInfo.pmd = BMP;
			GetWindowRect(hWnd, &amp;(FInfo.rect));
			InvalidateRect(hWnd, &amp;(FInfo.rect), TRUE);
			return 0;
		}
		else
		{
			FInfo.hBmp = NULL;
			FInfo.pmd = BRUSH;
			GetWindowRect(hWnd, &amp;(FInfo.rect));
			SetFInfo(hWnd, FInfo);
			InvalidateRect(hWnd, &amp;(FInfo.rect), TRUE);
			return 0;
		}
</code></pre>
<p>und hier nochmal die Paint Antwort des FeldProc:</p>
<pre><code class="language-cpp">case WM_PAINT:
		hdc = BeginPaint(hWnd, &amp;ps);
		if(FInfo.pmd == BRUSH)
		{
			SelectObject(hdc, GetStockObject(WHITE_BRUSH));
			Rectangle(hdc, FInfo.rect.left, FInfo.rect.top, FInfo.rect.right, FInfo.rect.bottom);
		}
		else
		{
			FInfo.cxBmp = GetHIcx(GetParent(hWnd));
			FInfo.cyBmp = GetHIcy(GetParent(hWnd));
			hdcMem = CreateCompatibleDC(hdc);
			SelectObject(hdcMem, FInfo.hBmp);

			StretchBlt(hdc, 0,
				0,
				FInfo.cxBmp,
				FInfo.cyBmp, 
				hdcMem, 0, 0, FInfo.cxBmp, FInfo.cyBmp, 
				SRCCOPY);

			DeleteDC(hdcMem);
		}
		DeleteObject(FInfo.hBmp);
		EndPaint(hWnd, &amp;ps);
	}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1227819</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227819</guid><dc:creator><![CDATA[Azrael* il Meraz]]></dc:creator><pubDate>Mon, 12 Feb 2007 22:49:19 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Mon, 12 Feb 2007 23:17:04 GMT]]></title><description><![CDATA[<p>Index verschoben (sizeof(short) = 2, sizeof(int) = 4) :</p>
<pre><code class="language-cpp">int SetHInfo(HWND hWnd, HauptInfo HInfo) 
{ 
 SetWindowLong(hWnd, 0,(LONG) HInfo.pszFeldName);
 SetWindowWord(hWnd, sizeof(TCHAR*),(short) HInfo.idFocus);

// SetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(int),(LONG) HInfo.hActiveBmp);
 SetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(short),(LONG) HInfo.hActiveBmp);

// SetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(int) + sizeof(HBITMAP),(LONG) HInfo.cxBmp);
 SetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(short) + sizeof(HBITMAP),(LONG) HInfo.cxBmp);

// SetWindowLong(hWnd, sizeof(TCHAR*) + 2*sizeof(int) + sizeof(HBITMAP),(LONG) HInfo.cyBmp);
 SetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(short) + sizeof(HBITMAP) + sizeof(int),(LONG) HInfo.cyBmp);

 return 0;
}

int GetHInfo(HWND hWnd, HauptInfo &amp;HInfo)
{
 HInfo.pszFeldName = (TCHAR*)   GetWindowLong(hWnd, 0);
 HInfo.idFocus     = (short)    GetWindowWord(hWnd, sizeof(TCHAR*));
 HInfo.hActiveBmp  = (HBITMAP) (GetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(short)));

// HInfo.cxBmp       = (int)      GetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(int) + sizeof(HBITMAP));
 HInfo.cxBmp       = (int)      GetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(short) + sizeof(HBITMAP));

// HInfo.cyBmp       = (int)      GetWindowLong(hWnd, sizeof(TCHAR*) + 2*sizeof(int) + sizeof(HBITMAP));
 HInfo.cyBmp       = (int)      GetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(short) + sizeof(HBITMAP) + sizeof(int));

 return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1227827</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227827</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 12 Feb 2007 23:17:04 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Tue, 13 Feb 2007 10:14:11 GMT]]></title><description><![CDATA[<p>Wie hast du denn die Fensterklasse registriert?<br />
Wenn du Get/SetWindowLong() für eigene Werte verwenden willst musst du auf jeden Fall WNDCLASS(EX)::cbWndExtra beim Aufruf von RegisterClass(Ex) entsprechend setzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1227957</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227957</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Tue, 13 Feb 2007 10:14:11 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Tue, 13 Feb 2007 15:21:36 GMT]]></title><description><![CDATA[<p>jo, speicher hab ich vor der registrierrung schon reserviert, und zwar sizeof(HauptInfo) für das Hauptfenster und sizeof(FeldInfo für das Nebenfenster)</p>
<p>Argh - Index jetzt richtig, klappt immer noch nicht - alles bleibt weiß <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f623.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--persevering_face"
      title="&gt;.&lt;"
      alt="😣"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228220</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228220</guid><dc:creator><![CDATA[Azrael* il Meraz]]></dc:creator><pubDate>Tue, 13 Feb 2007 15:21:36 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Tue, 13 Feb 2007 16:04:52 GMT]]></title><description><![CDATA[<p>Es gibt ein Problem in der Ablaufsteuerung :</p>
<pre><code class="language-cpp">// bei WM_CREATE des Haupt Proc 
// --------------------------------------
case WM_CREATE: 
...
 // Bitmap Laden 
 HInfo.hActiveBmp = LoadBitmap(hInstance, TEXT(&quot;bitmap&quot;)); // hier wird HInfo.hActiveBmp erzeugt
...
 SetHInfo(hWnd, HInfo);
...

// bei WM_LBUTTONDOWN im FeldProc :
// --------------------------------------
...
 FInfo.hBmp = GetHIhB(GetParent(hWnd)); // hier wird HInfo.hActiveBmp FInfo.hBmp zugewiesen
... 

// die Paint Antwort des FeldProc :
// --------------------------------------
case WM_PAINT: 
...
 DeleteObject(FInfo.hBmp); // und hier wird FInfo.hBmp gelöscht !
...                        // -&gt; dadurch wird auch HInfo.hActiveBmp ungültig
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1228251</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228251</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 13 Feb 2007 16:04:52 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Tue, 13 Feb 2007 17:38:18 GMT]]></title><description><![CDATA[<p>hab die delete-sache aus WM_PAINT entfernt und dafür folgendes bei WM_DESTROY des Hauptfensters hinzugefügt:</p>
<pre><code>case WM_DESTROY:
		// Bitmap löschen
		DeleteObject(HInfo.hActiveBmp);
		// aus dem Speicher auch
		SetHInfo(hWnd, HInfo);
		PostQuitMessage(0);
		return 0;
</code></pre>
<p>immer noc halles weiß, ich fange an, an hohe brücken und fenster im 6ten stock zu denken ^^&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228290</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228290</guid><dc:creator><![CDATA[Azrael* il Meraz]]></dc:creator><pubDate>Tue, 13 Feb 2007 17:38:18 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Tue, 13 Feb 2007 18:50:14 GMT]]></title><description><![CDATA[<p>Es gibt da immer noch ein Ablaufproblem.</p>
<p>Kommentiere mal das CreateWindow () der Child-Fenster aus und probiere, ob Du mit den Daten der HInfo (die bei WM_CREATE initialisiert wurde) auf dem Hauptfenster zeichnen kannst.</p>
<p>Falls die HInfo korrekt initialisiert ist, müsste das hier eine Bitmap zeichnen :</p>
<pre><code class="language-cpp">case WM_PAINT :
{
 HDC hdc1,hdc2;

 hdc1 = GetDC              (hWnd);
 hdc2 = CreateCompatibleDC (hdc1); 

 SelectObject (hdc2,HInfo.hActiveBmp);

 BitBlt (
   hdc1,    // DEST
   0,0,
   HInfo.cxBmp,
   HInfo.cyBmp,
   hdc2,   // SOURCE
   0,0,
   SRCCOPY
 );

 DeleteDC   (hdc2);
 ReleaseDC  (hWnd,hdc1);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1228316</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228316</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 13 Feb 2007 18:50:14 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Tue, 13 Feb 2007 20:47:03 GMT]]></title><description><![CDATA[<p>aha - hier bleibts auch weiß. weiß aber trotzdem nicht, was genau ich falsch gemacht habe. Ich poste mal mein ganzen HauptProc:</p>
<pre><code class="language-cpp">LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	// 25 Felder
	static HWND FeldHwnd[5][5];
	static short idFocus = (short) GetWindowWord(hWnd, sizeof(TCHAR*));
	// gebrauchte Variablen
	int x, y;
	TCHAR Text[10];
	static HauptInfo HInfo;

	// Infos holen
	GetHInfo(hWnd, HInfo);
	BITMAP bitmap;
	HINSTANCE hInstance;

	switch(msg)
	{
	case WM_CREATE:
		// für Bitmap
		hInstance = ((LPCREATESTRUCT) lParam)-&gt;hInstance;
		//for(y = 0; y&lt;5;y++)
		//for(x = 0; x&lt;5;x++)
		//{
		//	FeldHwnd[x][y] = CreateWindow(HInfo.pszFeldName, 
		//	NULL, 
		//	WS_CHILDWINDOW | WS_VISIBLE,
		//	0,0,0,0,	//braucht man nicht, da Werte bei Size gesetzt werden
		//	hWnd,
		//	(HMENU) (y &lt;&lt; 8 | x),
		//	(HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),
		//	NULL);
		//}
		// Bitmap Laden
		HInfo.hActiveBmp = LoadBitmap(hInstance, TEXT(&quot;omfg&quot;));
		GetObject(HInfo.hActiveBmp, sizeof(BITMAP), &amp;bitmap);

		// für spätere Ausgabe
		HInfo.cxBmp = bitmap.bmWidth;
		HInfo.cyBmp = bitmap.bmHeight;
		// Infos speichern
		SetHInfo(hWnd, HInfo);
		return 0;

	case WM_SIZE:
		// Größe der Felder Festlegen
		for(y=0;y&lt;5;y++)
		for(x=0;x&lt;5;x++)
		{
			MoveWindow(FeldHwnd[x][y],
				LOWORD(lParam)/5 *x, 
				HIWORD(lParam)/5 *y,
				LOWORD(lParam)/5,
				HIWORD(lParam)/5,
				TRUE);
		}
		return 0;

	case WM_LBUTTONDOWN:
		MessageBeep(0);
		return 0;

	case WM_SETFOCUS:
		// EingabeFokus auf das aktive Child Fenster übertragen
		SetFocus(GetDlgItem(hWnd, HInfo.idFocus));
		return 0;
	case WM_PAINT :
		{
			HDC hdc1,hdc2;

			hdc1 = GetDC              (hWnd);
			hdc2 = CreateCompatibleDC (hdc1);

			SelectObject (hdc2,HInfo.hActiveBmp);

			BitBlt (
			hdc1,    // DEST
			0,0,
			HInfo.cxBmp,
			HInfo.cyBmp,
			hdc2,   // SOURCE
			0,0,
			SRCCOPY
			);

			DeleteDC   (hdc2);
			ReleaseDC  (hWnd,hdc1);
			return 0;
		}
		case WM_DESTROY:
		// Bitmap löschen
		DeleteObject(HInfo.hActiveBmp);
		// aus dem Speicher auch
		SetHInfo(hWnd, HInfo);
		PostQuitMessage(0);
		return 0;
	}
	return DefWindowProc(hWnd, msg, wParam, lParam);
}
</code></pre>
<p>Ich mag zwar auch net vom Löffel gefüttert zu werden, aber irgendwie ist es manchmal unvermeidlich <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f623.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--persevering_face"
      title="&gt;.&lt;"
      alt="😣"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228373</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228373</guid><dc:creator><![CDATA[Azrael* il Meraz]]></dc:creator><pubDate>Tue, 13 Feb 2007 20:47:03 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Tue, 13 Feb 2007 21:13:37 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">// Ersetze Zeile 38
HInfo.hActiveBmp = LoadBitmap(hInstance, TEXT(&quot;omfg&quot;));

// mit
HInfo.hActiveBmp = LoadBitmap(NULL,OBM_CHECKBOXES);
// oder
HInfo.hActiveBmp = LoadBitmap(NULL,OBM_CLOSE);
</code></pre>
<p>Dann werden Bitmaps vom Betriebssystem geladen. So lässt sich testen, ob die Zeichenroutine ok ist.</p>
<p>Wenn diese gezeichnet werden, musst Du prüfen, ob es in Deinem Projekt eine Bitmap namens &quot;omfg&quot; überhaupt gibt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228393</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228393</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 13 Feb 2007 21:13:37 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Tue, 13 Feb 2007 22:21:33 GMT]]></title><description><![CDATA[<pre><code>.\main.cpp(112) : error C2065: 'OBM_CLOSE': nichtdeklarierter Bezeichner
</code></pre>
<p><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="😃"
    /></p>
<p>da stimmt doch was nicht...</p>
<blockquote>
<p>HInfo.hActiveBmp = LoadBitmap(NULL,MAKEINTRESOURCE(32754));</p>
</blockquote>
<p>Zeichnet er aber</p>
<pre><code>IDB_BITMAP1             BITMAP                  &quot;omfg.bmp&quot;
</code></pre>
<p>was hiervon nimmt man: IDB_BITMAP oder &quot;omfg.bmp&quot;?</p>
<p>Oh, mist, so - ich start nochmal von neu, hat kein Sinn, hab noch selber einiges entdeckt: z.b dass die child Windows überhauptgarnicht erstellt werden. Und die Sache mit der Struktur im Zusatzspeicher klapt auch net richtig.... mache jetzt erstmal ein einziges Child Window und nehme mir globale Variablen, dann klappts hoffentlich &gt;.&lt;. Trotzdem vielen Dank für die Hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228410</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228410</guid><dc:creator><![CDATA[Azrael* il Meraz]]></dc:creator><pubDate>Tue, 13 Feb 2007 22:21:33 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Tue, 13 Feb 2007 22:25:09 GMT]]></title><description><![CDATA[<p>winuser.h schrieb:</p>
<blockquote>
<p>...<br />
#define OBM_CLOSE 32754<br />
#define OBM_UPARROW 32753<br />
#define OBM_DNARROW 32752<br />
#define OBM_RGARROW 32751<br />
...</p>
</blockquote>
<p>Huch, so geht es also auch. Immerhin, die Zeichenroutine läuft.</p>
<p>Azrael, il Meraz schrieb:</p>
<blockquote>
<p>was hiervon nimmt man: IDB_BITMAP oder &quot;omfg.bmp&quot;?</p>
</blockquote>
<p>Immer den Bezeicher ganz links. Unter diesem Namen ist die Bitmap dem Programm bekannt.</p>
<pre><code class="language-cpp">// also &quot;IDB_BITMAP1&quot;
IDB_BITMAP1             BITMAP                  &quot;omfg.bmp&quot;

// Jetzt habe ich das grade nicht im Kopf. 

// Entweder so : (als INTRESOURCE)
HInfo.hActiveBmp = LoadBitmap(hInstance,IDB_BITMAP1);

// Oder so : (als Name)
HInfo.hActiveBmp = LoadBitmap(hInstance,&quot;IDB_BITMAP1&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1228429</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228429</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 13 Feb 2007 22:25:09 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Wed, 14 Feb 2007 07:37:11 GMT]]></title><description><![CDATA[<p>Ich würde GetHInfo(hWnd, HInfo); nicht bei jeder Funktion ausführen, sondern nur dann wenn Du sie wirklich brauchst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228493</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228493</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 14 Feb 2007 07:37:11 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Wed, 14 Feb 2007 07:39:23 GMT]]></title><description><![CDATA[<p>Azrael, il Meraz schrieb:</p>
<blockquote>
<p>Abgeholt wird die Information durch</p>
<pre><code class="language-cpp">int GetHInfo(HWND hWnd, HauptInfo &amp;HInfo)
{
	HInfo.pszFeldName	= (TCHAR*) GetWindowLong(hWnd, 0);
	HInfo.idFocus		= (short) GetWindowWord(hWnd, sizeof(TCHAR*));
	HInfo.hActiveBmp	= (HBITMAP) (GetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(short)));
	HInfo.cxBmp			= (int) GetWindowLong(hWnd, sizeof(TCHAR*) + sizeof(int) + sizeof(HBITMAP));
	HInfo.cyBmp			= (int) GetWindowLong(hWnd, sizeof(TCHAR*) + 2*sizeof(int) + sizeof(HBITMAP));
	return 0;
}
</code></pre>
</blockquote>
<p>Sag mal! Warum machst Du Dir das Leben so schwer und allokierst nicht einfach nur Platz für einen Zeiger in der Fensterklasse erzeugst mit new/malloc einen entsprechenden Speicherbereich auf den zu zugreifst. Das ist weitaus schneller als was Du hier machst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228495</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228495</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 14 Feb 2007 07:39:23 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Wed, 14 Feb 2007 12:01:06 GMT]]></title><description><![CDATA[<p>hey, stimmt, danke. bei HInfo sollte es klappen. Aber bei - FInfo nicht - da muss ja jedes Fenster ihr eigenes Rechteck und Bitmap haben &gt;.&lt;. Bzw. - eigentlich kann man ja ein FInfo-array machen und den Fenstern jeweils ein Pointer geben. So - das war jetzt mal Schriftliches Denken <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 hab jetzt mal von neu angefangen. Müsst noch ein bissl warten, bis ich euch weiter nerven kann^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228647</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228647</guid><dc:creator><![CDATA[Azrael* il Meraz]]></dc:creator><pubDate>Wed, 14 Feb 2007 12:01:06 GMT</pubDate></item><item><title><![CDATA[Reply to mist -&amp;gt; Verzweiflung on Wed, 14 Feb 2007 13:56:41 GMT]]></title><description><![CDATA[<p>Verstehe Dienen Einwurf nicht. Das gilt für ale Daten.<br />
Erzeuge eineinen Speicherblock, wenn WM_NCCREATE ankommt. Speicher die Adresse dieses Blocks mit SetWindowLong im fensterlokalem Speicher.<br />
Wan immer Du daten brauchst holst Du Dir nur den Zeiger mit GetWindowLong und arbeitest mit der Struktur.<br />
Bei WM_NCDESTROY entsorgst Du den Speicher!</p>
<p>Das ist die allgemeine Technik bei so etwas. Dann hat jede Fenster-Instanz seinen eigenen Speicherbereich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228778</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228778</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 14 Feb 2007 13:56:41 GMT</pubDate></item></channel></rss>