Hi,

<WmLi / ThoughtWorks.com> wrote in message
news:OFF6F1368C.C1C509ED-ON88256AB9.001637D4 / thoughtworks.com...
> Can anyone give me a sample of how to copy a string to the clipboard in
> Ruby under Windows NT? Is there any document on how to use the Win32API?
> Thanks.
>

Here is sample code:

require 'Win32API'

CF_TEXT = 1
openClipboard = Win32API.new("user32","OpenClipboard",['L'],'L')
closeClipboard = Win32API.new("user32","CloseClipboard",[],'L')
emptyClipboard = Win32API.new("user32","EmptyClipboard",[],'L')
setClipboardData = Win32API.new("user32","SetClipboardData",['L','P'],'L')

str = "Test String"

exit if openClipboard.Call(0)==0
emptyClipboard.Call
setClipboardData.Call(CF_TEXT, str)
closeClipboard.Call

> Steve
>
>

Park Hee-sob