<?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[Copy&#x2F;Pase in FormView dialogen (additional)]]></title><description><![CDATA[<p>Hier noch die funktionen die es ermoeglichen bestimmten text aus einer editbox in der formview zu kopieren und zu pasten</p>
<p>Copy</p>
<pre><code class="language-cpp">// Get selected text and paste into the clipboard
void CFormClass::OnCopy()
{
	if(::GetFocus() == m_EditBox.m_hWnd)
	{
		// Get the whole text
		CString strText;
		m_EditBox.GetWindowText(strText);

		// extraxt the only selected area of the text
		int iStart = 0;
		int iEnd = 0;
		m_EditBox.GetSel(iStart, iEnd);
		strText = strText.Mid(iStart, strText.GetLength() - iEnd);

		// put to clipboard
		SetClipboardText(strText);
	}
}
</code></pre>
<p>Paste</p>
<pre><code class="language-cpp">// replace selected text with text from the clipboard
void CFormClass::OnPaste()
{
	if(::GetFocus()== m_EditBox.m_hWnd)
	{
		// Get the whole text
		CString strText;
		m_EditBox.GetWindowText(strText);

		// what should be added
		CString strNewText = GetClipboardText();

		// remove selection from the text
		int iStart = 0;
		int iEnd = 0;
		m_EditBox.GetSel(iStart, iEnd);
		strText.Delete(iStart, strText.GetLength() - iEnd);

		// put the new text on the right position and show the text
		strText.Insert(iStart, strNewText);
		m_EditBox.SetWindowText(strText);

		// set the cursor
		int iCurPos = iStart + strNewText.GetLength();
		//m_EditBox.SetSel(iStart, iCurPos);		// the new pastet text is selected
		m_EditBox.SetSel(iCurPos, iCurPos);		// cursor on the end of the pasted text
	}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/198504/copy-pase-in-formview-dialogen-additional</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Apr 2026 05:41:35 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/198504.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Nov 2007 09:04:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Copy&#x2F;Pase in FormView dialogen (additional) on Thu, 22 Nov 2007 09:04:30 GMT]]></title><description><![CDATA[<p>Hier noch die funktionen die es ermoeglichen bestimmten text aus einer editbox in der formview zu kopieren und zu pasten</p>
<p>Copy</p>
<pre><code class="language-cpp">// Get selected text and paste into the clipboard
void CFormClass::OnCopy()
{
	if(::GetFocus() == m_EditBox.m_hWnd)
	{
		// Get the whole text
		CString strText;
		m_EditBox.GetWindowText(strText);

		// extraxt the only selected area of the text
		int iStart = 0;
		int iEnd = 0;
		m_EditBox.GetSel(iStart, iEnd);
		strText = strText.Mid(iStart, strText.GetLength() - iEnd);

		// put to clipboard
		SetClipboardText(strText);
	}
}
</code></pre>
<p>Paste</p>
<pre><code class="language-cpp">// replace selected text with text from the clipboard
void CFormClass::OnPaste()
{
	if(::GetFocus()== m_EditBox.m_hWnd)
	{
		// Get the whole text
		CString strText;
		m_EditBox.GetWindowText(strText);

		// what should be added
		CString strNewText = GetClipboardText();

		// remove selection from the text
		int iStart = 0;
		int iEnd = 0;
		m_EditBox.GetSel(iStart, iEnd);
		strText.Delete(iStart, strText.GetLength() - iEnd);

		// put the new text on the right position and show the text
		strText.Insert(iStart, strNewText);
		m_EditBox.SetWindowText(strText);

		// set the cursor
		int iCurPos = iStart + strNewText.GetLength();
		//m_EditBox.SetSel(iStart, iCurPos);		// the new pastet text is selected
		m_EditBox.SetSel(iCurPos, iCurPos);		// cursor on the end of the pasted text
	}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1407950</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1407950</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Thu, 22 Nov 2007 09:04:30 GMT</pubDate></item><item><title><![CDATA[Reply to Copy&#x2F;Pase in FormView dialogen (additional) on Thu, 22 Nov 2007 09:14:34 GMT]]></title><description><![CDATA[<p>Danke! <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="🙂"
    /><br />
Ich habs noch angehängt. Zusammenführen geht leider nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1407956</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1407956</guid><dc:creator><![CDATA[estartu]]></dc:creator><pubDate>Thu, 22 Nov 2007 09:14:34 GMT</pubDate></item><item><title><![CDATA[Reply to Copy&#x2F;Pase in FormView dialogen (additional) on Thu, 22 Nov 2007 09:16:25 GMT]]></title><description><![CDATA[<p>wart ma, da ist noch n fehler drinn, behebs grad, paste dann den neuen code hier</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1407958</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1407958</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Thu, 22 Nov 2007 09:16:25 GMT</pubDate></item><item><title><![CDATA[Reply to Copy&#x2F;Pase in FormView dialogen (additional) on Thu, 22 Nov 2007 09:17:25 GMT]]></title><description><![CDATA[<p>Irgendwie bin ich heute zu schnell. <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="😃"
    /><br />
Kein Problem, ich kann ja ändern. <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/1407959</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1407959</guid><dc:creator><![CDATA[estartu]]></dc:creator><pubDate>Thu, 22 Nov 2007 09:17:25 GMT</pubDate></item><item><title><![CDATA[Reply to Copy&#x2F;Pase in FormView dialogen (additional) on Thu, 22 Nov 2007 09:30:39 GMT]]></title><description><![CDATA[<p>so, nun aber</p>
<p>Paste</p>
<pre><code class="language-cpp">void CFormDialog::OnPaste()
{
	HWND focus = ::GetFocus();
	CEdit *Element = NULL;
	if(focus == m_Edit.m_hWnd)
		Element = &amp;m_Edit;
	// for additional edit boxes, simply ask and assign here

	if(Element)
	{
		// Get the whole text
		CString strText;
		Element-&gt;GetWindowText(strText);

		// Get clipboard text
		CString strNewText = GetClipboardText();

		// Delete the selected area from the text
		int iStart = 0;
		int iEnd = 0;
		Element-&gt;GetSel(iStart, iEnd);
		strText.Delete(iStart, iEnd - iStart);

		// Add the new text inside
		strText.Insert(iStart, strNewText);

		// Set the new text and set the cursor after it
		Element-&gt;SetWindowText(strText);
		int iCurPos = iStart + strNewText.GetLength();
		Element-&gt;SetSel(iCurPos, iCurPos);
	}
}
</code></pre>
<p>Copy</p>
<pre><code class="language-cpp">void CFormDialog::OnCopy()
{
	HWND focus = ::GetFocus();
	CEdit *Element = NULL;
	if(focus == m_Edit.m_hWnd)
		Element = &amp;m_Edit;
	// for additional edit boxes, simply ask and assign here

	if(Element)
	{
		// Get the whole text
		CString strText;
		Element-&gt;GetWindowText(strText);

		// Get the selected area from the text
		int iStart = 0;
		int iEnd = 0;
		Element-&gt;GetSel(iStart, iEnd);
		strText = strText.Mid(iStart, iEnd - iStart);

		// Set the cplipboard text
		SetClipboardText(strText);
	}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1407966</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1407966</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Thu, 22 Nov 2007 09:30:39 GMT</pubDate></item><item><title><![CDATA[Reply to Copy&#x2F;Pase in FormView dialogen (additional) on Thu, 22 Nov 2007 09:38:06 GMT]]></title><description><![CDATA[<p>eventuell kannst du noch dazu schreiben dass</p>
<p>wenn SetClipboardText oder GetClipboardText als member einer klasse sind, muss<br />
OpenClipboard ohne argumente aufgerufen werden</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1407969</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1407969</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Thu, 22 Nov 2007 09:38:06 GMT</pubDate></item><item><title><![CDATA[Reply to Copy&#x2F;Pase in FormView dialogen (additional) on Thu, 22 Nov 2007 09:43:51 GMT]]></title><description><![CDATA[<p>STRG+A (Select all)</p>
<pre><code class="language-cpp">void CFormDialog::OnSelectAll()
{
	HWND focus = ::GetFocus();
	CEdit *Element = NULL;
	if(focus == m_Edit.m_hWnd)
		Element = &amp;m_Edit;
	// for additional edit boxes, simply ask and assign here

	if(Element)
		Element-&gt;SetSel(0, Element-&gt;GetWindowTextLength());
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1407970</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1407970</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Thu, 22 Nov 2007 09:43:51 GMT</pubDate></item><item><title><![CDATA[Reply to Copy&#x2F;Pase in FormView dialogen (additional) on Thu, 22 Nov 2007 09:46:50 GMT]]></title><description><![CDATA[<p>Ist auch alles dabei. <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/1407974</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1407974</guid><dc:creator><![CDATA[estartu]]></dc:creator><pubDate>Thu, 22 Nov 2007 09:46:50 GMT</pubDate></item><item><title><![CDATA[Reply to Copy&#x2F;Pase in FormView dialogen (additional) on Thu, 22 Nov 2007 10:19:58 GMT]]></title><description><![CDATA[<p>wunderpraechtig, habe ich nun auch mal was fuer die FAQ getan #gg {=</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1408003</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1408003</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Thu, 22 Nov 2007 10:19:58 GMT</pubDate></item></channel></rss>