Thanks to Pierre Bellisle!
just three functions:
just three functions:
Code:
'Clipboard IPC #Include "Win32API.inc" Function MyFormat() As Long Local MyClipboardName As Asciiz * 20 'make this the same length as the name below MyClipboardName = "MyOwnClipboardFormat" Function = RegisterClipboardFormat(MyClipboardName) End Function Function WriteMyClipBoard (ByVal Txt As String) As Long Local lpMem As Asciiz Ptr Local hMem As Dword hMem = GlobalAlloc(%GHND, Len(Txt) + 1) lpMem = GlobalLock(hMem) @lpMem = Txt GlobalUnlock hMem OpenClipboard 0 SetClipboardData MyFormat, hMem CloseClipboard Function = 1 End Function Function ReadMyClipboard() As String Local CData As Asciiz * 256, ClipDataPtr As Asciiz Ptr OpenClipboard 0 ClipDataPtr = GetClipboardData(MyFormat) Function = @ClipDataPtr CloseClipboard End Function Function PBMain() If ReadMyClipboard <> "" Then Print "I found this on my clipboard " & ReadMyClipboard waitkey$ WriteMyClipBoard(" I'll just put this on my clipboard") End Function