#include once "window9.bi"

Function GetClipBoardText() As String Export
  OpenClipboard(0)
  Var Clip = GetClipboardData(CF_TEXT)
  Var size_ = GlobalSize(Clip)
  Dim Buf As String = Space(size_)
  Var Mem = GlobalLock(Clip)
  CopyMemory(Strptr(buf), Mem, size_)
  Function=buf
  GlobalUnlock(Mem)
  CloseClipboard()
End Function
