Using syscall in Go, how can I call the UWP API in Windows 10? I saw and tried many win32 examples, but when I tried to use System.WindowsRuntime.dll , it was not-go; in particular, I received:
panic: Failed to load System.WindowsRuntime.dll: The specified module could not be found.
(this was a runtime binary constructed fine)
I tried to create both standard go build and
go build -ldflags="-H windows"
code example:
var( windowsRuntime = syscall.NewLazyDLL("System.WindowsRuntime.dll") getDiskFreeSpace = windowsRuntime.NewProc("GetDiskFreeSpace") )
Note. Other options:
windowsRuntime = syscall.NewLazyDLL("System.Runtime.WindowsRuntime.dll")
&
windowsRuntime = syscall.NewLazyDLL("WindowsRuntime.dll")
Has anyone been able to get this job or have any advice on this? As always, very grateful !!
source share