From 382e8d3f444acb37efe021eee0c26adc13c21719 Mon Sep 17 00:00:00 2001 From: Steven Tracey Date: Thu, 4 May 2023 13:30:58 -0400 Subject: [PATCH] Weird Windows Quirk Fix --- .idea/vcs.xml | 6 ++++++ main.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .idea/vcs.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/main.go b/main.go index 36414d2..4700de6 100644 --- a/main.go +++ b/main.go @@ -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) }