Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no clipboard text while in Windows service #43

Open
Fndroid opened this issue Jul 10, 2019 · 4 comments
Open

no clipboard text while in Windows service #43

Fndroid opened this issue Jul 10, 2019 · 4 comments

Comments

@Fndroid
Copy link

Fndroid commented Jul 10, 2019

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.

@Bios-Marcel
Copy link

+1 I got this too, but not in a windows-service. It was a terminal application: https://github.com/Bios-Marcel/cordless

@marcio199226
Copy link

I have the same issue...anybody know how to fix it?

@HACKERALERT
Copy link

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.

@jinmao88
Copy link

jinmao88 commented Aug 8, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants