def paste(_ = nil)
      data = +""
      if 0 != User32.open( 0 )
        hclip = User32.get( CF_UNICODETEXT )
        if hclip && 0 != hclip
          pointer_to_data = Kernel32.lock( hclip )
          # Windows Unicode is ended by two null bytes, so get the whole string
          size = Kernel32.size( hclip )
          data << pointer_to_data.get_bytes( 0, size - 2 )
          data.force_encoding("UTF-16LE")
          Kernel32.unlock( hclip )
        end
        User32.close( )
      end
      data
    end
def paste(_ = nil)
      data = +""
      if 0 != User32.open( 0 )
        hclip = User32.get( CF_UNICODETEXT )
        if hclip && 0 != hclip
          pointer_to_data = Kernel32.lock( hclip )
          # Windows Unicode is ended by two null bytes, so get the whole string
          size = Kernel32.size( hclip )
          data << pointer_to_data.get_bytes( 0, size - 2 )
          data.force_encoding("UTF-16LE")
          Kernel32.unlock( hclip )
        end
        User32.close( )
      end
      data
    end
see http://www.codeproject.com/KB/clipboard/archerclipboard1.aspx