<?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[Clipboard Inhalt in eine Textdatei schreiben]]></title><description><![CDATA[<p>Hallo, ich bitte um einen Code-Snippet, da ich es irgendwie nicht schaffe.<br />
Ungefähr so:</p>
<pre><code class="language-cpp">int write(void) {
char *text = #GetClipboardData + OpenClipboard usw.#;
fprintf(fp, &quot;%s\n&quot;, text);
return 0;
}
</code></pre>
<p>Mehr nicht, ich weiß halt nur nicht genau, wie man das umsetzt.<br />
Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/195067/clipboard-inhalt-in-eine-textdatei-schreiben</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 03:28:20 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/195067.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 13 Oct 2007 16:11:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Clipboard Inhalt in eine Textdatei schreiben on Sat, 13 Oct 2007 16:11:28 GMT]]></title><description><![CDATA[<p>Hallo, ich bitte um einen Code-Snippet, da ich es irgendwie nicht schaffe.<br />
Ungefähr so:</p>
<pre><code class="language-cpp">int write(void) {
char *text = #GetClipboardData + OpenClipboard usw.#;
fprintf(fp, &quot;%s\n&quot;, text);
return 0;
}
</code></pre>
<p>Mehr nicht, ich weiß halt nur nicht genau, wie man das umsetzt.<br />
Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1384500</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1384500</guid><dc:creator><![CDATA[DerD4nk]]></dc:creator><pubDate>Sat, 13 Oct 2007 16:11:28 GMT</pubDate></item><item><title><![CDATA[Reply to Clipboard Inhalt in eine Textdatei schreiben on Sat, 13 Oct 2007 16:15:23 GMT]]></title><description><![CDATA[<p><a href="http://msdn2.microsoft.com/en-us/library/ms649016.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms649016.aspx</a> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /></p>
<pre><code class="language-cpp">VOID WINAPI EditPaste(VOID) 
{ 
    PLABELBOX pbox; 
    HGLOBAL   hglb; 
    LPTSTR    lptstr; 
    PLABELBOX pboxCopy; 
    int cx, cy; 
    HWND hwnd; 

    pbox = hwndSelected == NULL ? NULL : 
        (PLABELBOX) GetWindowLong(hwndSelected, 0); 

    // If the application is in edit mode, 
    // get the clipboard text. 

    if (pbox != NULL &amp;&amp; pbox-&gt;fEdit) 
    { 
        if (!IsClipboardFormatAvailable(CF_TEXT)) 
            return; 
        if (!OpenClipboard(hwndMain)) 
            return; 

        hglb = GetClipboardData(CF_TEXT); 
        if (hglb != NULL) 
        { 
            lptstr = GlobalLock(hglb); 
            if (lptstr != NULL) 
            { 
                // Call the application-defined ReplaceSelection 
                // function to insert the text and repaint the 
                // window. 

                ReplaceSelection(hwndSelected, pbox, lptstr); 
                GlobalUnlock(hglb); 
            } 
        } 
        CloseClipboard(); 

        return; 
    } 

    // If the application is not in edit mode, 
    // create a label window. 

    if (!IsClipboardFormatAvailable(uLabelFormat)) 
        return; 
    if (!OpenClipboard(hwndMain)) 
        return; 

    hglb = GetClipboardData(uLabelFormat); 
    if (hglb != NULL) 
    { 
        pboxCopy = GlobalLock(hglb); 
        if (pboxCopy != NULL) 
        { 
            cx = pboxCopy-&gt;rcText.right + CX_MARGIN; 
            cy = pboxCopy-&gt;rcText.top * 2 + cyText; 

            hwnd = CreateWindowEx( 
                WS_EX_NOPARENTNOTIFY | WS_EX_TRANSPARENT, 
                atchClassChild, NULL, WS_CHILD, 0, 0, cx, cy, 
                hwndMain, NULL, hinst, NULL 
            ); 
            if (hwnd != NULL) 
            { 
                pbox = (PLABELBOX) GetWindowLong(hwnd, 0); 
                memcpy(pbox, pboxCopy, sizeof(LABELBOX)); 
                ShowWindow(hwnd, SW_SHOWNORMAL); 
                SetFocus(hwnd); 
            } 
            GlobalUnlock(hglb); 
        } 
    } 
    CloseClipboard(); 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1384502</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1384502</guid><dc:creator><![CDATA[tenchou]]></dc:creator><pubDate>Sat, 13 Oct 2007 16:15:23 GMT</pubDate></item></channel></rss>