Open SForresterGG opened 1 year ago
I am trying to use your EnumDisplayMonitors function, but I can't figure out how to pass a function pointer that works. Do you have examples of how to use this?
I've tried lots of things along the lines of
func monitorEnumProc(hMonitor w32.HMONITOR, hdc w32.HDC, lpRect *w32.RECT, lparam w32.LPARAM) bool { fmt.Println("hMonitor") return true }
func GetMonitors() {
funcPtr := monitorEnumProc fptr := unsafe.Pointer(&funcPtr) EnumDisplayMonitors(0, nil, uintptr(fptr), 0)
}
but it invariably crashes somewhere along the way, displaying something like Process 33436 has exited with status 3221226525
Any assistance greatly appreciated! -Steven
I am trying to use your EnumDisplayMonitors function, but I can't figure out how to pass a function pointer that works. Do you have examples of how to use this?
I've tried lots of things along the lines of
func monitorEnumProc(hMonitor w32.HMONITOR, hdc w32.HDC, lpRect *w32.RECT, lparam w32.LPARAM) bool { fmt.Println("hMonitor") return true }
func GetMonitors() {
}
but it invariably crashes somewhere along the way, displaying something like Process 33436 has exited with status 3221226525
Any assistance greatly appreciated! -Steven