<?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[Child unsichtbar machen, &amp;quot;sichtbar&amp;quot; wird es nicht unsichtbar, programmtechnisch ist es weg]]></title><description><![CDATA[<p>Hey all,<br />
irgendwann hatte ich mal das Selbe Problem mit dem Selben Programm aber ich find den Post nicht.<br />
Ich habe ein HWND mit x*y Childs(Minesweeper-like) und die sollen beim daraufklicken auch verschwinden...</p>
<p>Rein Programmtechnisch ist der angeklickte Button weg, allerdings ist seine Form noch in dem Parentfenster &quot;aufgezeichnet&quot;/&quot;sichtbar&quot;...</p>
<pre><code class="language-cpp">.
.
.
LRESULT CALLBACK WndProc( HWND myWnd, UINT wndMsg, WPARAM wParam, LPARAM lParam )
	//This function will recieve all messages, wich where send by windows to this window.
{
	switch( wndMsg )
	{
		case WM_CREATE:					//on window creation
			for( y = 0; y &lt; Yaxe; y++ )		//create all Buttons
			{
				for( x = 0; x &lt; Xaxe; x++ )
				{
					mines[y][x] = CreateWindow( &quot;BUTTON&quot;, &quot;&quot;, BS_FLAT | WS_CHILD | WS_VISIBLE | WS_DLGFRAME | BS_ICON, aktXPos, aktYPos, buttonX, buttonY, myWnd, (HMENU)bmMine, ((LPCREATESTRUCT)lParam)-&gt;hInstance, NULL );
					prevBtnProc = (WNDPROC)SetWindowLong( mines[y][x], GWL_WNDPROC, (LONG)myBtn );

					aktXPos += buttonX;					//generate the position of the new button
				}
				aktYPos += buttonY;
				aktXPos = 0;
			}
			for( y = 0; y &lt; numberOfMines; y++ )	//generate the mine infos, so that there are some mines in the game.
			{
				do
				{
					tmpX = zufall( 0, Xaxe*10 );
					tmpY = zufall( 0, Yaxe*10 );
				}while( isMine( tmpX/10, tmpY/10 ) );
				arrayOfMines[y][1] = tmpX/10;
				arrayOfMines[y][2] = tmpY/10;
			}
			visitMsg = true;
		break;
		case WM_PAINT:
			myHdc = BeginPaint( myWnd, &amp;myPaint );
			{
				if( !isEnd )
				{
					for( y = 0; y &lt; numberOfMines; y++ )	//write down the mines
						TextOut( myHdc, arrayOfMines[y][1]*buttonX+3, arrayOfMines[y][2]*buttonY, &quot;X&quot;, 1 );

					for( y = 0; y &lt; Yaxe; y++ )				//create the number of mines for a field
					{
						for( x = 0; x &lt; Xaxe; x++ )
						{
							if( !isMine( x, y ) &amp;&amp; countMines( x, y ) &gt; 0 )
							{
								itoa( countMines( x, y ), &amp;zahl, 10 );

								TextOut( myHdc, x*buttonX+4, y*buttonY, &amp;zahl, 1 );
							}
						}
					}
				}
			}
			EndPaint( myWnd, &amp;myPaint );
			visitMsg = true;
		break;
	}
	return visitMsg;
}
.
.
.
</code></pre>
<p>Wenn ich jetzt</p>
<pre><code class="language-cpp">ShowWindow( mines[1][1], SW_HIDE );
</code></pre>
<p>mache, bleibt die Kontur noch da... Wie geht das weg?</p>
<p>Danke schonmal, bei Fragen, einfach posten</p>
<p>[edit]wenn ich</p>
<pre><code class="language-cpp">ShowWindow( myAppWnd, SW_HIDE );
ShowWindow( myAppWnd, SW_SHOW );
</code></pre>
<p>mache, ist der Button wirklich weg...</p>
<pre><code class="language-cpp">SendMessage( myAppWnd, WM_PAINT, 0, 0 );
</code></pre>
<p>Geht allerdings nicht</p>
<pre><code class="language-cpp">InvalidateRect( myAppWnd, NULL, TRUE );
</code></pre>
<p>geht auch nicht...(button wird nicht übermalt)<br />
Nur bei TextOut ist der Button halt wirklich weg...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/210349/child-unsichtbar-machen-quot-sichtbar-quot-wird-es-nicht-unsichtbar-programmtechnisch-ist-es-weg</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 23:31:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/210349.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 10 Apr 2008 07:54:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Child unsichtbar machen, &amp;quot;sichtbar&amp;quot; wird es nicht unsichtbar, programmtechnisch ist es weg on Thu, 10 Apr 2008 08:44:13 GMT]]></title><description><![CDATA[<p>Hey all,<br />
irgendwann hatte ich mal das Selbe Problem mit dem Selben Programm aber ich find den Post nicht.<br />
Ich habe ein HWND mit x*y Childs(Minesweeper-like) und die sollen beim daraufklicken auch verschwinden...</p>
<p>Rein Programmtechnisch ist der angeklickte Button weg, allerdings ist seine Form noch in dem Parentfenster &quot;aufgezeichnet&quot;/&quot;sichtbar&quot;...</p>
<pre><code class="language-cpp">.
.
.
LRESULT CALLBACK WndProc( HWND myWnd, UINT wndMsg, WPARAM wParam, LPARAM lParam )
	//This function will recieve all messages, wich where send by windows to this window.
{
	switch( wndMsg )
	{
		case WM_CREATE:					//on window creation
			for( y = 0; y &lt; Yaxe; y++ )		//create all Buttons
			{
				for( x = 0; x &lt; Xaxe; x++ )
				{
					mines[y][x] = CreateWindow( &quot;BUTTON&quot;, &quot;&quot;, BS_FLAT | WS_CHILD | WS_VISIBLE | WS_DLGFRAME | BS_ICON, aktXPos, aktYPos, buttonX, buttonY, myWnd, (HMENU)bmMine, ((LPCREATESTRUCT)lParam)-&gt;hInstance, NULL );
					prevBtnProc = (WNDPROC)SetWindowLong( mines[y][x], GWL_WNDPROC, (LONG)myBtn );

					aktXPos += buttonX;					//generate the position of the new button
				}
				aktYPos += buttonY;
				aktXPos = 0;
			}
			for( y = 0; y &lt; numberOfMines; y++ )	//generate the mine infos, so that there are some mines in the game.
			{
				do
				{
					tmpX = zufall( 0, Xaxe*10 );
					tmpY = zufall( 0, Yaxe*10 );
				}while( isMine( tmpX/10, tmpY/10 ) );
				arrayOfMines[y][1] = tmpX/10;
				arrayOfMines[y][2] = tmpY/10;
			}
			visitMsg = true;
		break;
		case WM_PAINT:
			myHdc = BeginPaint( myWnd, &amp;myPaint );
			{
				if( !isEnd )
				{
					for( y = 0; y &lt; numberOfMines; y++ )	//write down the mines
						TextOut( myHdc, arrayOfMines[y][1]*buttonX+3, arrayOfMines[y][2]*buttonY, &quot;X&quot;, 1 );

					for( y = 0; y &lt; Yaxe; y++ )				//create the number of mines for a field
					{
						for( x = 0; x &lt; Xaxe; x++ )
						{
							if( !isMine( x, y ) &amp;&amp; countMines( x, y ) &gt; 0 )
							{
								itoa( countMines( x, y ), &amp;zahl, 10 );

								TextOut( myHdc, x*buttonX+4, y*buttonY, &amp;zahl, 1 );
							}
						}
					}
				}
			}
			EndPaint( myWnd, &amp;myPaint );
			visitMsg = true;
		break;
	}
	return visitMsg;
}
.
.
.
</code></pre>
<p>Wenn ich jetzt</p>
<pre><code class="language-cpp">ShowWindow( mines[1][1], SW_HIDE );
</code></pre>
<p>mache, bleibt die Kontur noch da... Wie geht das weg?</p>
<p>Danke schonmal, bei Fragen, einfach posten</p>
<p>[edit]wenn ich</p>
<pre><code class="language-cpp">ShowWindow( myAppWnd, SW_HIDE );
ShowWindow( myAppWnd, SW_SHOW );
</code></pre>
<p>mache, ist der Button wirklich weg...</p>
<pre><code class="language-cpp">SendMessage( myAppWnd, WM_PAINT, 0, 0 );
</code></pre>
<p>Geht allerdings nicht</p>
<pre><code class="language-cpp">InvalidateRect( myAppWnd, NULL, TRUE );
</code></pre>
<p>geht auch nicht...(button wird nicht übermalt)<br />
Nur bei TextOut ist der Button halt wirklich weg...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1489495</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1489495</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Thu, 10 Apr 2008 08:44:13 GMT</pubDate></item><item><title><![CDATA[Reply to Child unsichtbar machen, &amp;quot;sichtbar&amp;quot; wird es nicht unsichtbar, programmtechnisch ist es weg on Thu, 10 Apr 2008 13:21:33 GMT]]></title><description><![CDATA[<p>Hm, ich sag einfach mal, was mit so auffällt, weil der Code etwas wirrsch ist:</p>
<p>1. 'visitMsg' ist eigentlich überflüssig ( <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/27a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--right_arrow"
      title=":arrow_right:"
      alt="➡"
    /> Gibst Du auch immer FALSE zurück, wenn Du eine Nachricht <em>nicht</em> behandelst?)<br />
2. Lass mal testweise die Zeile mit dem SetWindowLong (Subclassing) weg, oder poste die SubclassProc der Buttons.<br />
3. Was enthält 'bmMine', bzw. wie ist die Variable definiert?<br />
4. Zeig mal die Stelle des Aufrufs von ShowWindow.<br />
5. Eventuell empfiehlt sich beim Zeichnen mit Back-Buffern zu arbeiten, je nachdem, ob es flackert <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="😉"
    /> (noch so als Tipp).<br />
6. Hast Du beim Erstellen des Hauptfensters WS_CLIPCHILDREN als Style-Flag angegeben?</p>
<p>Grüße!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1489736</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1489736</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Thu, 10 Apr 2008 13:21:33 GMT</pubDate></item></channel></rss>