2025-11-10 10:17:06 +08:00
|
|
|
//go:build windows
|
|
|
|
|
|
2024-03-27 11:20:59 +08:00
|
|
|
package clipboard
|
|
|
|
|
|
|
|
|
|
import (
|
2024-04-02 14:11:59 +08:00
|
|
|
"errors"
|
2024-03-27 11:20:59 +08:00
|
|
|
)
|
|
|
|
|
|
2025-11-10 10:17:06 +08:00
|
|
|
func Init() error {
|
|
|
|
|
return nil
|
2024-03-27 11:20:59 +08:00
|
|
|
}
|
|
|
|
|
|
2024-04-02 14:11:59 +08:00
|
|
|
func Set(types FileType, data []byte) error {
|
|
|
|
|
switch types {
|
|
|
|
|
case Text:
|
|
|
|
|
return AutoSetter("CF_UNICODETEXT", data)
|
|
|
|
|
case File:
|
|
|
|
|
return AutoSetter("CF_HDROP", data)
|
|
|
|
|
case Image:
|
|
|
|
|
return AutoSetter("PNG", data)
|
|
|
|
|
case HTML:
|
2025-11-10 10:17:06 +08:00
|
|
|
return AutoSetter("HTML format", data)
|
2024-04-02 14:11:59 +08:00
|
|
|
}
|
|
|
|
|
return errors.New("not support type:" + string(types))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func SetOrigin(types string, data []byte) error {
|
|
|
|
|
return AutoSetter(types, data)
|
|
|
|
|
}
|