fb:porticula NoPaste
Windows Copy/Paste Text
Uploader: | Eternal_Pain |
Datum/Zeit: | 03.03.2014 14:40:02 |
#include once "windows.bi"
Function GetClipboardText() as String
Dim as Integer ok = OpenClipboard(NULL)
Dim as HANDLE hData = GetClipboardData(CF_TEXT)
Dim as ubyte ptr pchData
pchData = GlobalLock(hData)
Function = *pchData
GlobalUnlock(hData)
CloseClipboard()
End Function
Sub SetClipboardText(Byval text as String)
Dim as Integer ok = OpenClipboard(NULL)
Dim as HGLOBAL hClipboardData
Dim as ubyte ptr pchData
EmptyClipboard()
hClipboardData = GlobalAlloc(GMEM_DDESHARE, len(text)+1)
pchData = GlobalLock(hClipboardData)
for cpy as Integer = 0 to len(text)-1
pchData[cpy] = text[cpy]
next cpy
GlobalUnlock(hClipboardData)
SetClipboardData(CF_TEXT,hClipboardData)
CloseClipboard()
End Sub
'SetClipboardText("das isxyvxyvyxvyxvyxvt ein test")
?GetClipboardText()
sleep