#Include once "window9.bi"

Function SetClipBoardText(ByVal Text As String) As integer Export
  Var Clip = GlobalAlloc(GMEM_MOVEABLE Or GMEM_SHARE, Len(Text)+1)
  OpenClipboard(0)
  EmptyClipboard()
  Var Mem = GlobalLock(Clip)
  CopyMemory(Mem, Strptr(Text), Len(Text))
  GlobalUnlock(Mem)
  Function=cast(integer,SetClipboardData(CF_TEXT,Clip))
  CloseClipboard()
End Function
