clipboard icon indicating copy to clipboard operation
clipboard copied to clipboard

Multi clipboard format support for Windows

Open kiennq opened this issue 7 years ago • 0 comments

Add 4 new interface function for clipboard package:

  1. func ReadAllWithFormat(cf uintptr) (string, error)

  2. func WriteAllWithFormat(text string, cf uintptr) error

  3. func ClearClipboard() error

  4. func getClipboardFormat(_ string)

With those, we can set and get multiple data type from clipboard. One example is in Windows, we can set HTML clipboard and text clipboard simultaneously, application can choose to render which data depends on its needs. The newly add utility goclip is using the new interface to implement copy and paste multiple clipboard data type too.

Please refer to this https://msdn.microsoft.com/en-us/library/windows/desktop/ms649015(v=vs.85).aspx

kiennq avatar Jun 13 '18 16:06 kiennq