<?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[Dialog Autoscroll]]></title><description><![CDATA[<p>Gibt es bei Dialogen eine Funktion wie Autoscroll (falls der Platz für den Inhalt nicht ausreicht, das eine Scrollbar angezeigt wird)?</p>
<p>Wenn nicht, wie kann man sowas manuell erstellen?</p>
<p>Danke im voraus</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/122488/dialog-autoscroll</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Jul 2026 07:28:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/122488.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 06 Oct 2005 11:27:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dialog Autoscroll on Thu, 06 Oct 2005 11:27:38 GMT]]></title><description><![CDATA[<p>Gibt es bei Dialogen eine Funktion wie Autoscroll (falls der Platz für den Inhalt nicht ausreicht, das eine Scrollbar angezeigt wird)?</p>
<p>Wenn nicht, wie kann man sowas manuell erstellen?</p>
<p>Danke im voraus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/886334</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/886334</guid><dc:creator><![CDATA[ZeroCool74]]></dc:creator><pubDate>Thu, 06 Oct 2005 11:27:38 GMT</pubDate></item><item><title><![CDATA[Reply to Dialog Autoscroll on Thu, 06 Oct 2005 12:10:03 GMT]]></title><description><![CDATA[<p>irgendwie so:</p>
<pre><code class="language-cpp">case WM_SIZE:
		cxClient  = LOWORD(lParam);
		cyClient = HIWORD(lParam);

		// do we need scroll panes?
		{
			RECT ServerRect;
			RECT ClientRect;

			GetClientRect(GetDesktopWindow(), &amp;ServerRect);
			GetClientRect(hwnd, &amp;ClientRect);

			// do we need a vertical scroll pane?
			if(ServerRect.bottom &gt; ClientRect.bottom)
			{
				//SetScrollPos(hwnd, SB_VERT, 3, TRUE);
				SCROLLINFO si;
				si.cbSize = sizeof(si);
				si.nMin = 0;
				si.nMax = ServerRect.bottom;
				si.nPage = ClientRect.bottom;
				si.fMask = SIF_RANGE | SIF_PAGE;

				SetScrollInfo(hwnd, SB_VERT, &amp;si, TRUE);
			}

			// do we need a horizontal scroll pane?
			if(ServerRect.bottom &gt; ClientRect.bottom)
			{
				//SetScrollPos(hwnd, SB_VERT, 3, TRUE);
				SCROLLINFO si;
				si.cbSize = sizeof(si);
				si.nMin = 0;
				si.nMax = ServerRect.right;
				si.nPage = ClientRect.right;
				si.fMask = SIF_RANGE | SIF_PAGE;

				SetScrollInfo(hwnd, SB_HORZ, &amp;si, TRUE);
			}
		}

		return 0;

	case WM_VSCROLL:
		{
		// vertikal Bildlaufleiste abfragen
		SCROLLINFO si;
		si.cbSize = sizeof(si);
		si.fMask = SIF_ALL;	// Alle Felder besetzen
		GetScrollInfo(hwnd, SB_VERT, &amp;si);

		// Position für späteren Vergleich festhalten
		int iVertPos = si.nPos;

		switch(LOWORD(wParam))
		{
		case SB_TOP:
			si.nPos = si.nMin;
			break;
		case SB_BOTTOM:
			si.nPos = si.nMax;
			break;
		case SB_LINEUP:
			si.nPos -=1;
			break;
		case SB_LINEDOWN:
			si.nPos +=1;
		case SB_PAGEUP:
			si.nPos -= si.nPage;
			break;
		case SB_PAGEDOWN:
			si.nPos += si.nPage;
			break;
		case SB_THUMBTRACK:
			si.nPos = si.nTrackPos;
			break;

		default:
			break;
		}

		// Position erst setzen und dann wieder abfragen. Weil Windows über die Seitengröße 
		// umrechnet, kommt bei der Abfrage überlicherweise ein anderer Wert heraus

		si.fMask = SIF_POS;
		SetScrollInfo(hwnd, SB_VERT, &amp;si, TRUE);
		GetScrollInfo(hwnd, SB_VERT, &amp;si);

		// Wenn sich die Position geändert hat: Fensterinhalt rollen und aktualisieren
		if(si.nPos != iVertPos)
		{
			//ScrollWindow(hwnd, 0, 30, NULL, NULL);
			//UpdateWindow(hwnd);
			InvalidateRect(hwnd, NULL, TRUE);
		}

		}

		return 0;

	case WM_HSCROLL:
		{
		// vertikal Bildlaufleiste abfragen
		SCROLLINFO si;
		si.cbSize = sizeof(si);
		si.fMask = SIF_ALL;	// Alle Felder besetzen
		GetScrollInfo(hwnd, SB_HORZ, &amp;si);

		// Position für späteren Vergleich festhalten
		int iHorzPos = si.nPos;

		switch(LOWORD(wParam))
		{
		case SB_TOP:
			si.nPos = si.nMin;
			break;
		case SB_BOTTOM:
			si.nPos = si.nMax;
			break;
		case SB_LINEUP:
			si.nPos -=1;
			break;
		case SB_LINEDOWN:
			si.nPos +=1;
		case SB_PAGEUP:
			si.nPos -= si.nPage;
			break;
		case SB_PAGEDOWN:
			si.nPos += si.nPage;
			break;
		case SB_THUMBTRACK:
			si.nPos = si.nTrackPos;
			break;

		default:
			break;
		}

		// Position erst setzen und dann wieder abfragen. Weil Windows über die Seitengröße 
		// umrechnet, kommt bei der Abfrage überlicherweise ein anderer Wert heraus

		si.fMask = SIF_POS;
		SetScrollInfo(hwnd, SB_HORZ, &amp;si, TRUE);
		GetScrollInfo(hwnd, SB_HORZ, &amp;si);

		// Wenn sich die Position geändert hat: Fensterinhalt rollen und aktualisieren
		if(si.nPos != iHorzPos)
		{
			//ScrollWindow(hwnd, 0, 30, NULL, NULL);
			//UpdateWindow(hwnd);
			InvalidateRect(hwnd, NULL, TRUE);
		}

		}

		return 0;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/886368</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/886368</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Thu, 06 Oct 2005 12:10:03 GMT</pubDate></item></channel></rss>