<?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[Button verstecken.]]></title><description><![CDATA[<p>Ich habe folgendes Problem: Wenn ich einen Button mit ShowWindow(hWnd_Button,SW_HIDE) verstecken will, verschwindet der Knopf nicht. Er reagiert zwar danach auf keine Ereignisse mehr, er ist jedoch noch sichtbar.<br />
Wie erreicht man, das der Button dann unsichtbar wird? Ich habe das mit RedrawWindow versucht, hat aber nicht hingehauen, danke schonmal im voraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/137658/button-verstecken</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 23:48:08 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/137658.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 19 Feb 2006 16:04:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Button verstecken. on Sun, 19 Feb 2006 16:04:44 GMT]]></title><description><![CDATA[<p>Ich habe folgendes Problem: Wenn ich einen Button mit ShowWindow(hWnd_Button,SW_HIDE) verstecken will, verschwindet der Knopf nicht. Er reagiert zwar danach auf keine Ereignisse mehr, er ist jedoch noch sichtbar.<br />
Wie erreicht man, das der Button dann unsichtbar wird? Ich habe das mit RedrawWindow versucht, hat aber nicht hingehauen, danke schonmal im voraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/997946</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997946</guid><dc:creator><![CDATA[.....]]></dc:creator><pubDate>Sun, 19 Feb 2006 16:04:44 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Sun, 19 Feb 2006 16:34:14 GMT]]></title><description><![CDATA[<p>ich vermute, showwindow ist da der falsche ansatz.</p>
<p>da ich fast vermute, dass du den button mit</p>
<pre><code class="language-cpp">hButton = CreateWindow([...], WS_CHILD | WS_VISIBLE, [...]);
</code></pre>
<p>erstellt hast, müsstest du ihn (den button) nur noch außerhalb des sichtbaren bereiches verfrachten, also</p>
<pre><code class="language-cpp">MoveWindow(hButton, 0, 0, 0, 0, true);
</code></pre>
<p>hoffe, das hilft.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/997966</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997966</guid><dc:creator><![CDATA[ItsNotYou]]></dc:creator><pubDate>Sun, 19 Feb 2006 16:34:14 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Sun, 19 Feb 2006 16:36:17 GMT]]></title><description><![CDATA[<p>Mit ShowWindow sollte es gehen. Es liegt wahrscheinlich an was anderem.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/997972</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997972</guid><dc:creator><![CDATA[...........]]></dc:creator><pubDate>Sun, 19 Feb 2006 16:36:17 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Sun, 19 Feb 2006 17:24:27 GMT]]></title><description><![CDATA[<p>naja, wenn ich das Fenster minimiere, und dann wieder maximiere, dann ist der Button weg, genau wie ich das will. Das Fenster wird einfach nur nicht neu gezeichnet. (Meine Theorie) <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>
]]></description><link>https://www.c-plusplus.net/forum/post/998031</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998031</guid><dc:creator><![CDATA[....]]></dc:creator><pubDate>Sun, 19 Feb 2006 17:24:27 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Sun, 19 Feb 2006 20:14:19 GMT]]></title><description><![CDATA[<p>Windows möchte gern wissen, dass es den vom Button vorher belegten Bereich neu zeichnen soll. Dazu mußt Du &quot;InvalidateRect&quot; nach &quot;ShowWindow&quot; aufrufen.</p>
<p>Das Neuzeichnen wird aber erst ausgeführt, wenn das Programm seine aktuellen Aktivitäten (nämlich das Bearbeiten der aktuellen Windows-Message) beendet hat. Sollte Dein Programm nach InvalidateRect noch längere Aktivitäten durchführen, kannst Du mit &quot;UpdateWindow&quot; das sofortige Neuzeichnen erzwingen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/998152</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998152</guid><dc:creator><![CDATA[mgs_]]></dc:creator><pubDate>Sun, 19 Feb 2006 20:14:19 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Mon, 20 Feb 2006 11:41:10 GMT]]></title><description><![CDATA[<p>habe jetzt</p>
<pre><code class="language-cpp">RECT rc;
GetClientRect(hWnd,&amp;rc);
InvalidateRect(hWnd,&amp;rc,true);
UpdateWindow(hWnd);
</code></pre>
<p>Das wird ausgeführt, wenn ich auf diesen Knopf drücke... aber immer noch das selbe, es passiert nichts. Der Knopf, der versteckt werden soll, ist immer noch sichtbar, reagiert blos auf keine Eingaben mehr.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/998449</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998449</guid><dc:creator><![CDATA[.....]]></dc:creator><pubDate>Mon, 20 Feb 2006 11:41:10 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Mon, 20 Feb 2006 11:42:33 GMT]]></title><description><![CDATA[<p>Ist der Button auf ner Groupbox drauf oder so?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/998451</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998451</guid><dc:creator><![CDATA[hmmmmmm]]></dc:creator><pubDate>Mon, 20 Feb 2006 11:42:33 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Mon, 20 Feb 2006 19:59:58 GMT]]></title><description><![CDATA[<p>ja, das ist er:)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/998906</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998906</guid><dc:creator><![CDATA[...]]></dc:creator><pubDate>Mon, 20 Feb 2006 19:59:58 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Mon, 20 Feb 2006 20:02:26 GMT]]></title><description><![CDATA[<p>dann mach mal InvalidateRect aber mit dem Handle der Groupbox</p>
]]></description><link>https://www.c-plusplus.net/forum/post/998909</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998909</guid><dc:creator><![CDATA[hmmmmmm]]></dc:creator><pubDate>Mon, 20 Feb 2006 20:02:26 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Tue, 21 Feb 2006 11:12:21 GMT]]></title><description><![CDATA[<p>naja, es funktioniert leider auch nicht.</p>
<pre><code class="language-cpp">case WM_CREATE:
hWndGroupBox_3=CreateWindowEx(0,&quot;BUTTON&quot;,&quot;Auswählen und Bewegen&quot;        ,BS_GROUPBOX|WS_CHILD|WS_GROUP|WS_VISIBLE,
					5,282,rc.right-10,110 ,hWnd,(HMENU)0,global_hInst,0);
hWnd_BtnIndice    = CreateImageBtn(10 ,222,40,40,hWnd,BS_AUTOCHECKBOX | BS_PUSHLIKE ,IDI_ICONINDICE    ,(HMENU)BTN_INDICE     );
hWnd_BtnSelectP	  = CreateImageBtn(10 ,342,40,40,hWnd,BS_AUTOCHECKBOX | BS_PUSHLIKE ,IDI_ICONSELECTP   ,(HMENU)BTN_SELECTP    );
hWnd_BtnSelectT	  = CreateImageBtn(52 ,342,40,40,hWnd,BS_AUTOCHECKBOX | BS_PUSHLIKE ,IDI_ICONSELECTT   ,(HMENU)BTN_SELECTT    );
</code></pre>
<p>Soweit der Code für WM_CREATE.</p>
<pre><code class="language-cpp">case WM_COMMAND:
switch(LOWORD(wParam))
{

	case BTN_INDICE:
	{	
		...
		ShowWindow(hWnd_BtnSelectP,SW_HIDE);
		ShowWindow(hWnd_BtnSelectT,SW_HIDE);
		RECT rc; 
		GetClientRect(hWndGroupBox_3,&amp;rc); 
		InvalidateRect(hWndGroupBox_3,&amp;rc,true); 
		UpdateWindow(hWndGroupBox_3); 

	}
	...
}
</code></pre>
<p>so in etwa der Code, was passiert, wenn man klickt. für hWndGroupBox_3 könnte man auch hWnd, das Parenthandle einsetzen, das haut genausowenig hin.</p>
<p>zum Näheren Verständnis noch der Code für CreateImageBtn(...):</p>
<pre><code class="language-cpp">HWND CreateImageBtn(int x, int y ,int rx, int ry, HWND hWnd,DWORD dwStyle, int res, HMENU IDBtn)
{
	HANDLE hIcon;
	HWND   hWndBtn;

	hIcon   = LoadImage (GetModuleHandle (NULL), MAKEINTRESOURCE(res),IMAGE_ICON,0, 0,LR_DEFAULTCOLOR | LR_COPYFROMRESOURCE);
	hWndBtn = CreateWindow(&quot;BUTTON&quot;, &quot;&quot;, WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON|BS_ICON|dwStyle ,x, y, rx, ry, hWnd, IDBtn, global_hInst,  0);
	SendMessage(hWndBtn, BM_SETIMAGE, (WPARAM) IMAGE_ICON,(LPARAM)(HANDLE) hIcon);
	return hWndBtn;
}
</code></pre>
<p>hoffe auf ne gute Lösung, danke schonmal:)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/999257</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/999257</guid><dc:creator><![CDATA[.....]]></dc:creator><pubDate>Tue, 21 Feb 2006 11:12:21 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Tue, 21 Feb 2006 11:44:11 GMT]]></title><description><![CDATA[<p>Sorry hab mich vertan. Mach mal InvalidateRect auf das Parentfenster der Groupbox.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/999286</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/999286</guid><dc:creator><![CDATA[hmmmmmm]]></dc:creator><pubDate>Tue, 21 Feb 2006 11:44:11 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Tue, 21 Feb 2006 13:58:42 GMT]]></title><description><![CDATA[<p>Ob ich das jetzt nun auf die Groupbox mache, oder nicht, es haut leider nicht hin, wie schon gesagt:</p>
<blockquote>
<p>für hWndGroupBox_3 könnte man auch hWnd, das Parenthandle einsetzen, das haut genausowenig hin.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/999416</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/999416</guid><dc:creator><![CDATA[.....]]></dc:creator><pubDate>Tue, 21 Feb 2006 13:58:42 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Wed, 22 Feb 2006 18:23:07 GMT]]></title><description><![CDATA[<p>Ich habe jetzt WM_PAINT dazugefügt:</p>
<pre><code class="language-cpp">case WM_PAINT:
{
	PAINTSTRUCT ps;
	RECT rc;
	HDC hDc=BeginPaint(hWnd,&amp;ps);
	GetClientRect(hWnd,&amp;rc);
	FillRect (hDc, &amp;rc, (HBRUSH)GetSysColorBrush(COLOR_BTNFACE));
	EndPaint(hWnd,&amp;ps);
}
</code></pre>
<p>InvalidateRect wird auf das Parentwindow angewendet. Durch das Löschen mit</p>
<pre><code class="language-cpp">FillRect (hDc, &amp;rc, (HBRUSH)GetSysColorBrush(COLOR_BTNFACE));
</code></pre>
<p>Verschwinden jetzt endlich die Knöpfe. Jedoch blinken alle Elemente auf dem Fenster, die neu gezeichnet werden, bei jedem Ankommen von WM_PAINT. Kann man das irgendwie unterdrücken?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1000505</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1000505</guid><dc:creator><![CDATA[.....]]></dc:creator><pubDate>Wed, 22 Feb 2006 18:23:07 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Wed, 22 Feb 2006 18:38:51 GMT]]></title><description><![CDATA[<p>vielleicht hilft <a href="http://www.winapi.net/index.php?inhalt=tipp4" rel="nofollow">http://www.winapi.net/index.php?inhalt=tipp4</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1000523</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1000523</guid><dc:creator><![CDATA[ItsNotYou]]></dc:creator><pubDate>Wed, 22 Feb 2006 18:38:51 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Wed, 22 Feb 2006 20:01:09 GMT]]></title><description><![CDATA[<p>@Its not You<br />
Hab mir jetzt die</p>
<pre><code class="language-cpp">case WM_ERASEBKGND:
				return 1;
</code></pre>
<p>eingebaut, arbeitet leider auch nicht. Es flackert immer noch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1000598</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1000598</guid><dc:creator><![CDATA[.....]]></dc:creator><pubDate>Wed, 22 Feb 2006 20:01:09 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Wed, 22 Feb 2006 20:11:59 GMT]]></title><description><![CDATA[<p>Mir kommt das schon ziemlich blöd vor:</p>
<blockquote>
<p>Wenn wir nun z.B. mit InvalidateRect() ein WM_PAINT zum Neuzeichnen bekommen wollen löscht das System vor WM_PAINT die Clientarea.</p>
</blockquote>
<p>So <a href="http://Winapi.net" rel="nofollow">Winapi.net</a><br />
Das Problem scheint bei mir zu sein, das das System genau das nicht tut...<br />
Ich meine damit das löschen der Clientarea. Deswegen mache ich ja:</p>
<pre><code class="language-cpp">case WM_PAINT:
{
    PAINTSTRUCT ps;
    RECT rc;
    HDC hDc=BeginPaint(hWnd,&amp;ps);
    GetClientRect(hWnd,&amp;rc);
    FillRect (hDc, &amp;rc, (HBRUSH)GetSysColorBrush(COLOR_BTNFACE));
    EndPaint(hWnd,&amp;ps);
}
</code></pre>
<p>Ich blick da einfach nicht mehr durch. Kann man das neuzeichnen der Clientarea auch anders erzwingen?</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1000614</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1000614</guid><dc:creator><![CDATA[.....]]></dc:creator><pubDate>Wed, 22 Feb 2006 20:11:59 GMT</pubDate></item><item><title><![CDATA[Reply to Button verstecken. on Wed, 22 Feb 2006 20:13:40 GMT]]></title><description><![CDATA[<p>Mir kommt das schon ziemlich blöd vor:</p>
<blockquote>
<p>Wenn wir nun z.B. mit InvalidateRect() ein WM_PAINT zum Neuzeichnen bekommen wollen löscht das System vor WM_PAINT die Clientarea.</p>
</blockquote>
<p>So <a href="http://Winapi.net" rel="nofollow">Winapi.net</a><br />
Das Problem scheint bei mir zu sein, das das System genau das nicht tut...<br />
Ich meine damit das löschen der Clientarea. Deswegen mache ich ja:</p>
<pre><code class="language-cpp">case WM_PAINT:
{
    PAINTSTRUCT ps;
    RECT rc;
    HDC hDc=BeginPaint(hWnd,&amp;ps);
    GetClientRect(hWnd,&amp;rc);
    FillRect (hDc, &amp;rc, (HBRUSH)GetSysColorBrush(COLOR_BTNFACE));
    EndPaint(hWnd,&amp;ps);
}
</code></pre>
<p>Ich blick da einfach nicht mehr durch. Kann man das neuzeichnen der Clientarea auch anders erzwingen?</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1000616</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1000616</guid><dc:creator><![CDATA[.....]]></dc:creator><pubDate>Wed, 22 Feb 2006 20:13:40 GMT</pubDate></item></channel></rss>