Open c17abab opened 1 year ago
Good point. Is there any specific use case for 32-bit windows? I am 99% sure that this package didn't consider 32-bit windows.
Good point. Is there any specific use case for 32-bit windows? I am 99% sure that this package didn't consider 32-bit windows.
Found the cause of the problem, the user32.dll function openClipboard need a parameter(A handle to the window to be associated with the open clipboard. If this parameter is NULL, the open clipboard is associated with the current task). So maybe you need to get the window handle first, or set the parameter to 0: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-openclipboard
eg:
// Here you need to get the handle of the clipboard window first
getOpenClipboardWindow := user32.MustFindProc("GetOpenClipboardWindow")
for {
r, _, _ = getOpenClipboardWindow.Call()
// set the parameter to 0 is also ok
r, _, _ = openClipboard.Call(r)
if r == 0 {
continue
}
break
}
defer closeClipboard.Call()
Thanks for the investigation. As you already investigated the issue, any PR would be very welcome 👍
The compilation parameters are as follows: $env:GOARCH="amd64"; $env:GOOS="windows"; $env:GOARCH="386"; # 32
$env:GOARCH="amd64"; # 64
and the program will be stucked at line 324 in the file clipborad_windows.go: