copy and paste in program

Jimmy Cao jcao219 at gmail.com
Sun Sep 11 19:47:20 PDT 2011


Here's an example I've quickly put together for you:

import std.stdio;
import core.stdc.string;

extern(Windows) {
    void* GetClipboardData(uint);
    bool OpenClipboard(void*);
}

void main() {
    if (OpenClipboard(null)) {
        auto cstr = cast(char*)GetClipboardData(1);
        if (cstr)
            writeln(std.conv.to!string(cast(char*)cstr[0..strlen(cstr)]));
    }
}



On Sun, Sep 11, 2011 at 9:22 PM, Joel Christensen <joelcnz at gmail.com> wrote:

> So how would I got about doing it in D?
>
>
> On 12-Sep-11 1:52 PM, Vladimir Panteleev wrote:
>
>> On Mon, 12 Sep 2011 04:39:52 +0300, Joel Christensen <joelcnz at gmail.com>
>> wrote:
>>
>>  I'm not sure I would be able to get Windows CE Clipboard stuff working
>>> for me.
>>>
>>
>> Search engines often return Windows CE results for API searches.
>>
>> Here's the clipboard developer documentation for full Windows versions:
>>
>> http://msdn.microsoft.com/en-**us/library/ms648709(v=VS.85).**aspx<http://msdn.microsoft.com/en-us/library/ms648709(v=VS.85).aspx>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20110911/ceb09a3e/attachment.html>


More information about the Digitalmars-d-learn mailing list