<?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[richedit - syntaxhighlighting]]></title><description><![CDATA[<p>hi,</p>
<p>ich wollte mir einen kleinen &quot;syntax-highlighter&quot; für php basteln. nur hab ich keine ahnung wie. wenn zum beispiel &quot;if&quot; geschrieben wird, dann soll dieses mit meinem CHARFORMAT cFormat formatiert werden.<br />
ich hab mir überlegt, im textfeld diesen string kurzzeitig zu markieren und dann zu formatieren, aber ich weiß zum einen nicht, wie ich diesen string sozusagen ausfindig machen kann und zum anderen denk ich, dass es eine bessere methode gibt, dass zu machen.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/68512/richedit-syntaxhighlighting</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Apr 2026 18:52:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/68512.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 18 Mar 2004 15:01:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to richedit - syntaxhighlighting on Thu, 18 Mar 2004 15:01:05 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>ich wollte mir einen kleinen &quot;syntax-highlighter&quot; für php basteln. nur hab ich keine ahnung wie. wenn zum beispiel &quot;if&quot; geschrieben wird, dann soll dieses mit meinem CHARFORMAT cFormat formatiert werden.<br />
ich hab mir überlegt, im textfeld diesen string kurzzeitig zu markieren und dann zu formatieren, aber ich weiß zum einen nicht, wie ich diesen string sozusagen ausfindig machen kann und zum anderen denk ich, dass es eine bessere methode gibt, dass zu machen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/483532</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/483532</guid><dc:creator><![CDATA[Herr-Vorragend]]></dc:creator><pubDate>Thu, 18 Mar 2004 15:01:05 GMT</pubDate></item><item><title><![CDATA[Reply to richedit - syntaxhighlighting on Thu, 18 Mar 2004 15:07:48 GMT]]></title><description><![CDATA[<p>google findet etwas<br />
<a href="http://www.google.de/search?hl=de&amp;ie=UTF-8&amp;oe=UTF-8&amp;q=syntax+highlighting+richedit+box&amp;spell=1" rel="nofollow">http://www.google.de/search?hl=de&amp;ie=UTF-8&amp;oe=UTF-8&amp;q=syntax+highlighting+richedit+box&amp;spell=1</a><br />
der zweite betrag sieht sehr interessant aus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/483535</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/483535</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Thu, 18 Mar 2004 15:07:48 GMT</pubDate></item><item><title><![CDATA[Reply to richedit - syntaxhighlighting on Fri, 19 Mar 2004 10:33:48 GMT]]></title><description><![CDATA[<p>ui, sowas hab ich gesucht. nur muss ich mir das mal genauer anschauen, weil ich es nicht benutzen, sondern selbst machen will.</p>
<p>noch eine frage: die funktion Colorize verlangt eine variable vom typ &quot;CRichEditCtrl&quot;. Wie kommt man denn an so etwas?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/484110</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/484110</guid><dc:creator><![CDATA[Herr-Vorragend]]></dc:creator><pubDate>Fri, 19 Mar 2004 10:33:48 GMT</pubDate></item><item><title><![CDATA[Reply to richedit - syntaxhighlighting on Fri, 19 Mar 2004 10:39:03 GMT]]></title><description><![CDATA[<p>die klasse vom zweiten link ist eigentlich für mfc gedacht.<br />
also ein paar änderungen musst schon vornehmen.<br />
aber statt &quot;CRichEditCtrl&quot; zu übergeben kannst du es auch so umschreiben das du dein fensterhandle (richeditctrl) übergibst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/484115</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/484115</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Fri, 19 Mar 2004 10:39:03 GMT</pubDate></item><item><title><![CDATA[Reply to richedit - syntaxhighlighting on Fri, 19 Mar 2004 14:51:28 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>ich hab schon öfters dieses GetRichEditCtrl() gesehen, doch bei mir gibt es diese funktion nicht, was muss ich da denn includen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/484314</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/484314</guid><dc:creator><![CDATA[Herr-Vorragend]]></dc:creator><pubDate>Fri, 19 Mar 2004 14:51:28 GMT</pubDate></item><item><title><![CDATA[Reply to richedit - syntaxhighlighting on Fri, 19 Mar 2004 16:10:22 GMT]]></title><description><![CDATA[<p>Herr-Vorragend schrieb:</p>
<blockquote>
<p>hi,</p>
<p>ich hab schon öfters dieses GetRichEditCtrl() gesehen, doch bei mir gibt es diese funktion nicht, was muss ich da denn includen?</p>
</blockquote>
<p>nix wenn du kein mfc benutzen willst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/484410</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/484410</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Fri, 19 Mar 2004 16:10:22 GMT</pubDate></item><item><title><![CDATA[Reply to richedit - syntaxhighlighting on Sat, 20 Mar 2004 12:26:18 GMT]]></title><description><![CDATA[<p>aso, sollte ich denn besser mfc benutzen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/484859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/484859</guid><dc:creator><![CDATA[Herr-Vorragend]]></dc:creator><pubDate>Sat, 20 Mar 2004 12:26:18 GMT</pubDate></item><item><title><![CDATA[Reply to richedit - syntaxhighlighting on Mon, 22 Mar 2004 07:47:47 GMT]]></title><description><![CDATA[<p>Herr-Vorragend schrieb:</p>
<blockquote>
<p>aso, sollte ich denn besser mfc benutzen?</p>
</blockquote>
<p>ist deine sache <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="😉"
    /> besser finde <strong>ich</strong> es nicht <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>codebeispiel</p>
<pre><code class="language-cpp">// pointer auf Richeditctrl ändern in entsprechende Winapi Message

//void CSyntaxColorizer::Colorize(CHARRANGE cr, CRichEditCtrl *pCtrl)
void CSyntaxColorizer::Colorize(CHARRANGE cr, HWND hwndRichEdit)
{
	long nTextLength = 0;

	if(cr.cpMin == 0 &amp;&amp; cr.cpMax == -1) //send entire text of rich edit box
	{
		//set up the buffer to hold the text from the rich edit box
		nTextLength = pCtrl-&gt;GetTextLength();

//		pCtrl-&gt;SetSel(0,-1);
                  SendMessage(hwndRichEdit, EM_SETSEL, (WPARAM)0, (LPARAM)-1);

	}
	else
	{
		//set up the buffer to hold the text
		nTextLength = cr.cpMax - cr.cpMin + 1;//add 1 because zero-based array

		//get the text
//		pCtrl-&gt;SetSel(cr.cpMin,cr.cpMax);
                  SendMessage(hwndRichEdit, EM_SETSEL, (WPARAM)cr.cpMin, (LPARAM)cr.cpMax);
	}

	LPTSTR lpszBuf = new TCHAR[nTextLength+1];
//	pCtrl-&gt;GetSelText(lpszBuf);
//	pCtrl-&gt;SetSelectionCharFormat(m_cfDefault);
         SendMessage(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)(LPSTR)lpszBuf);
         SendMessage(hwndRichEdit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&amp;m_cfDefault);

	colorize(lpszBuf,pCtrl,cr.cpMin);

	delete lpszBuf;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/485824</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/485824</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 22 Mar 2004 07:47:47 GMT</pubDate></item><item><title><![CDATA[Reply to richedit - syntaxhighlighting on Mon, 22 Mar 2004 14:05:48 GMT]]></title><description><![CDATA[<p>dankeschön, ich bleib dann auch bei SendMessage() <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/486061</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/486061</guid><dc:creator><![CDATA[Herr-Vorragend]]></dc:creator><pubDate>Mon, 22 Mar 2004 14:05:48 GMT</pubDate></item><item><title><![CDATA[Reply to richedit - syntaxhighlighting on Mon, 22 Mar 2004 14:11:24 GMT]]></title><description><![CDATA[<p>Herr-Vorragend schrieb:</p>
<blockquote>
<p>dankeschön, ich bleib dann auch bei SendMessage() <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>
</blockquote>
<p>mein reden <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/486070</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/486070</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 22 Mar 2004 14:11:24 GMT</pubDate></item></channel></rss>