clipboard
clipboard copied to clipboard
no clipboard text while in Windows service
The logic of my progrom is read texts from the clipboard and send them to my server
And clipboard.ReadAll()
works fine when I run the .exe in CMD
But when I tried to run it as a service, clipboard.ReadAll()
returns an error like: The operation completed successfully
Are there any solutions for this? Thank you.
+1 I got this too, but not in a windows-service. It was a terminal application: https://github.com/Bios-Marcel/cordless
I have the same issue...anybody know how to fix it?
I found a fix. Around line 82 in clipboard_windows.go
, there is:
if r == 0 {
_, _, _ = closeClipboard.Call()
return "", err
}
Just comment out that block and everything works :). It seems like an unnecessary check, since I'm using GLFW for one of my projects and it explicitly says to leave the memory management to GLFW, not do it manually.
I found a fix. Around line 82 in
clipboard_windows.go
, there is:if r == 0 { _, _, _ = closeClipboard.Call() return "", err }
Just comment out that block and everything works :). It seems like an unnecessary check, since I'm using GLFW for one of my projects and it explicitly says to leave the memory management to GLFW, not do it manually.
its not work