Weird Windows Quirk Fix

This commit is contained in:
Steven Tracey 2023-05-04 13:30:58 -04:00
parent 28e83e92bc
commit 382e8d3f44
2 changed files with 7 additions and 1 deletions

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -24,6 +24,6 @@ func main() {
}
procSystemParamInfo := windows.NewLazyDLL("user32.dll").NewProc("SystemParametersInfoW")
imagePath, _ := windows.UTF16PtrFromString(string(fileBytes) + `\` + strconv.Itoa(rand.Intn(len(files))+1) + ".jpg")
imagePath, _ := windows.UTF16PtrFromString(string(fileBytes) + `\` + strconv.Itoa(rand.Intn(len(files)-1)+1) + ".jpg")
procSystemParamInfo.Call(20, 0, uintptr(unsafe.Pointer(imagePath)), 0x001A)
}