<?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[Scrollender Text]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich möchte ein Static Control gerne scrollenden Text verpassen. Ich würde das im WM_PAINT-Ereignis machen aber wie komme ich denn an die Message, wenn das Static- Control auf einem vorgefertigten Dialog liegt? Oder muss ich das über das WM_PAINT vom Dialog verarbeiten?<br />
Kann mir da jemand weiter helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/136531/scrollender-text</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 15:19:35 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/136531.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 11 Feb 2006 09:52:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Scrollender Text on Sat, 11 Feb 2006 09:52:18 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich möchte ein Static Control gerne scrollenden Text verpassen. Ich würde das im WM_PAINT-Ereignis machen aber wie komme ich denn an die Message, wenn das Static- Control auf einem vorgefertigten Dialog liegt? Oder muss ich das über das WM_PAINT vom Dialog verarbeiten?<br />
Kann mir da jemand weiter helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/991361</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/991361</guid><dc:creator><![CDATA[poncho]]></dc:creator><pubDate>Sat, 11 Feb 2006 09:52:18 GMT</pubDate></item><item><title><![CDATA[Reply to Scrollender Text on Sat, 11 Feb 2006 14:23:54 GMT]]></title><description><![CDATA[<p>Du könntest das Control Subclassen. <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windowclasses/windowclassreference/windowclassfunctions/setclasslong.asp" rel="nofollow">SetClassLong</a> sollte Dir da weiterhelfen. Bzw. solltest Du SetClassLongPtr (wg. evtl. 64 Bit Pointern/Handles) nehmen.</p>
<p>Damit eine eigene WndProc zuweisen, WM_PAINT abfangen, verarbeiten, weiterreichen an DefWindowProc. Alle Nachrichten außer WM_PAINT natürlich auch weiterreichen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/991571</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/991571</guid><dc:creator><![CDATA[mantiz]]></dc:creator><pubDate>Sat, 11 Feb 2006 14:23:54 GMT</pubDate></item><item><title><![CDATA[Reply to Scrollender Text on Sat, 11 Feb 2006 20:28:57 GMT]]></title><description><![CDATA[<p>Ich hab das mal probliert aber es will nicht so recht klappen.</p>
<pre><code class="language-cpp">BOOL CALLBACK DialogProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
     switch (message)
     {
     case WM_INITDIALOG:
		OldScrollTextProc = (WNDPROC)SetClassLong(GetDlgItem(hwnd, IDC_STATIC6), GCL_WNDPROC, (LONG)ScrollTextProc);
		if(!OldScrollTextProc)
			ErrorExit(&quot;SetClassLong&quot;);
		return FALSE;

     case WM_CLOSE:
		EndDialog (hwnd, 0);
		return TRUE;
     }
     return FALSE;
}

BOOL CALLBACK ScrollTextProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
     switch (message)
     {
	 case WM_PAINT:
		HDC hdc;
		RECT rc;
		PAINTSTRUCT ps;
		GetClientRect(hwnd, &amp;rc);
		hdc = BeginPaint(hwnd, &amp;ps);
		TextOut(hdc, 0, 0, &quot;test&quot;, 4);
		EndPaint(hwnd, &amp;ps);
		break;
     }
	 return CallWindowProc(OldScrollTextProc, hwnd, message, wParam, lParam);
}
</code></pre>
<p>Hierbei kommt erstmal kein Fehler aber es wird beim neu zeichnen nie die neue ScrollTextProc aufgerufen.</p>
<p>Dann hatte ich noch eine andere Methode gefunden:</p>
<pre><code class="language-cpp">BOOL CALLBACK DialogProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
     switch (message)
     {
     case WM_INITDIALOG:
		SetWindowLong(GetDlgItem(hwnd, IDC_STATIC6), GWL_STYLE, GetWindowLong(GetDlgItem(hwnd, IDC_STATIC6), GWL_STYLE ) | BS_OWNERDRAW);
		return FALSE;

	 case WM_DRAWITEM:
		if(((DRAWITEMSTRUCT*)lParam)-&gt;hwndItem == GetDlgItem(hwnd, IDC_STATIC6))
		{
			MessageBox(NULL, &quot;test&quot;, &quot;test&quot;, MB_OK);
			return(TRUE);
		}
		break;

     case WM_CLOSE:
		EndDialog (hwnd, 0);
		return TRUE;
     }
     return false;
}
</code></pre>
<p>Das hat aber genauso wenig funktioniert - WM_DRAWITEM wird nie aufgerufen.</p>
<p>Muss ich vielleicht selber noch etwas machen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/991832</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/991832</guid><dc:creator><![CDATA[poncho]]></dc:creator><pubDate>Sat, 11 Feb 2006 20:28:57 GMT</pubDate></item><item><title><![CDATA[Reply to Scrollender Text on Sat, 11 Feb 2006 23:44:24 GMT]]></title><description><![CDATA[<p>Ich habs jetzt:</p>
<pre><code class="language-cpp">OldScrollTextProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwnd, IDC_STATIC6), GWLP_WNDPROC, (LONG)(LONG_PTR)(WNDPROC)ScrollTextProc);
</code></pre>
<p>Allerdings haut da irgendetwas immernoch nicht ganz hin.<br />
WM_PAINT wird nur einmal nach ShowWindow durchlaufen. Sobald der Text in dem Control geändert wird, wird es normal ohne meine extra Verarbeitung gezeichnet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/991953</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/991953</guid><dc:creator><![CDATA[poncho]]></dc:creator><pubDate>Sat, 11 Feb 2006 23:44:24 GMT</pubDate></item><item><title><![CDATA[Reply to Scrollender Text on Sun, 12 Feb 2006 19:06:44 GMT]]></title><description><![CDATA[<p>Hmm ich hoffe Ich hab dein prob richtig verstanden mit dem scrollenden Text aber ich denke WM_PAINT hilft dir da nich weiter. Da du ja nur WM_PAINT Messages bekommst wenn das Fenster neu gezeichnet werden muss.<br />
Setzt dir doch einen Timer (SetTimer(..)) auf weiß ich 10ms oder so musst mal testen und zeichnest dann wenn du die Message WM_TIMER bekommst deine Nachricht neu.<br />
Aber ka ob du das jetzt gebrauchen kannst.</p>
<p>MfG schirrmie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/992521</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/992521</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Sun, 12 Feb 2006 19:06:44 GMT</pubDate></item><item><title><![CDATA[Reply to Scrollender Text on Mon, 13 Feb 2006 07:17:33 GMT]]></title><description><![CDATA[<p>Hmm, stimmt eigentlich. Es ist zwar trotzdem komisch, dass das nicht funktioniert aber eigentlich ist es auch egal, denn der Timer würde ja dafür sorgen, dass es immer neu gezeichnet wird.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/992795</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/992795</guid><dc:creator><![CDATA[poncho]]></dc:creator><pubDate>Mon, 13 Feb 2006 07:17:33 GMT</pubDate></item><item><title><![CDATA[Reply to Scrollender Text on Tue, 14 Feb 2006 19:49:16 GMT]]></title><description><![CDATA[<p>Falls es jeamnden interessiert, so funktoiniert es:</p>
<pre><code class="language-cpp">void CALLBACK TimerScroll( HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime )
{
	HDC hdc;
	//Control Größe
	RECT rc;
	//Text Größe (von DrawText gefüllt)
	RECT rc2;
	memset(&amp;rc2, 0, sizeof(RECT));
	GetClientRect(hwnd, &amp;rc);
	hdc = GetDC(hwnd);
	//Standard System-Schriftart setzen
	HGDIOBJ hfont;
	hfont = GetStockObject(DEFAULT_GUI_FONT);
	SelectObject(hdc, hfont);
	//Standard System-Hintergrundfarbe setzen
	SetBkColor(hdc, (COLORREF)GetSysColor(COLOR_BTNFACE));
	//Text-Ausmaße berechnen
	DrawText(hdc, scrollText, strlen(scrollText), &amp;rc2, DT_CALCRECT);
	scrollPos -= 2;
	//wenn Text komplett links raus ist, starte wieder von rechts
	if(scrollPos &lt; -rc2.right)
	{
		scrollPos = rc.right;
	}
	//Text zeichnen
	ExtTextOut(hdc, scrollPos, 0, ETO_OPAQUE | ETO_CLIPPED, &amp;rc, scrollText, strlen(scrollText), NULL);
	ReleaseDC(hwnd, hdc);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/994265</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/994265</guid><dc:creator><![CDATA[poncho]]></dc:creator><pubDate>Tue, 14 Feb 2006 19:49:16 GMT</pubDate></item></channel></rss>