I try to find out the font folder on a windows installation. AFAICS the proposed way is to call SHGetKnownFolderPath
in Shell32.dll
with KNOWNFOLDERID
set to FOLDERID_Fonts
.
I have no idea what to pass to the Call
function in the code below:
package main
import (
"syscall"
)
func main() {
// HRESULT SHGetKnownFolderPath(
// _In_ REFKNOWNFOLDERID rfid,
// _In_ DWORD dwFlags,
// _In_opt_ HANDLE hToken,
// _Out_ PWSTR *ppszPath
// );
var (
shell32 = syscall.NewLazyDLL("Shell32.dll")
shGetKnowFolderPath = shell32.NewProc("SHGetKnownFolderPath")
// Doesn't work, of course:
folderId int
flags int
handle int
retval int
)
shGetKnowFolderPath.Call(uintptr(folderId), uintptr(flags), uintptr(handle), uintptr(retval))
}
Any idea? (I guess a workaround for now would be to stick to %windir%\Fonts
, but I'd like to get a proper solution).
References: