|
|
@ -16,6 +16,7 @@ func TestClipboardReadText(t *testing.T) {
|
|
|
|
t.Error(err)
|
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tp := CF_UNICODETEXT
|
|
|
|
tp := CF_UNICODETEXT
|
|
|
|
|
|
|
|
fmt.Println("lenghth", len(formats))
|
|
|
|
for _, f := range formats {
|
|
|
|
for _, f := range formats {
|
|
|
|
fmt.Println("Clipboard Format:", f)
|
|
|
|
fmt.Println("Clipboard Format:", f)
|
|
|
|
d, e := GetClipboardFormatName(f)
|
|
|
|
d, e := GetClipboardFormatName(f)
|
|
|
@ -25,9 +26,12 @@ func TestClipboardReadText(t *testing.T) {
|
|
|
|
fmt.Println("HTML Format:", tp)
|
|
|
|
fmt.Println("HTML Format:", tp)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if d == "DataObject" {
|
|
|
|
if d == "DataObject" {
|
|
|
|
tp = CF_HDROP
|
|
|
|
tp = f
|
|
|
|
fmt.Println("DataObject:", tp)
|
|
|
|
fmt.Println("DataObject:", tp)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if f > 20000 {
|
|
|
|
|
|
|
|
tp = f
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mem, err := GetClipboardData(tp)
|
|
|
|
mem, err := GetClipboardData(tp)
|
|
|
@ -56,10 +60,19 @@ func TestClipboardReadText(t *testing.T) {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Println("Size:", size)
|
|
|
|
var buf []byte
|
|
|
|
var buf []byte
|
|
|
|
for i := 0; i < int(size); i++ {
|
|
|
|
for i := 0; i < int(size); i++ {
|
|
|
|
buf = append(buf, *(*byte)(unsafe.Pointer(uintptr(p) + uintptr(i))))
|
|
|
|
buf = append(buf, *(*byte)(unsafe.Pointer(uintptr(p) + uintptr(i))))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fmt.Println("\n\nClipboard Data:", string(buf))
|
|
|
|
fmt.Println("\n\nClipboard Data:", "ok")
|
|
|
|
fmt.Println("Clipboard Test Done")
|
|
|
|
fmt.Println("Clipboard Test Done")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func TestGetUpdatedClipboardFormatsAll(t *testing.T) {
|
|
|
|
|
|
|
|
d, e := GetUpdatedClipboardFormatsAll()
|
|
|
|
|
|
|
|
if e != nil {
|
|
|
|
|
|
|
|
t.Error(e)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Println(d)
|
|
|
|
|
|
|
|
}
|
|
|
|