This seems to work in Wine (I don't have a windows machine in front of
me.) I also don't know if this is the best way to do this, but it
seems to work. Basically this sets up the syscall from user32 for
CallWindowProcA which then calls the Go function created with
syscall.NewCallback.
package main
import (
"fmt"
"syscall"
)
func main() {
cb := syscall.NewCallback(func(int, int, int, int) int {
fmt.Println("cb"); return 0})
wnd := syscall.NewLazyDLL("user32.dll")
wndProc := wnd.NewProc("CallWindowProcA")
wndProc.Call(cb, 0, 0, 0, 0)
}