新增: 壁纸切换(主题/本地图片/Bing/纯色渐变)

This commit is contained in:
2026-05-25 19:54:32 +08:00
parent a804db3579
commit bb1574641f
14 changed files with 868 additions and 395 deletions

View File

@@ -1,7 +1,6 @@
package main
import (
"embed"
"log"
"unsafe"
@@ -9,9 +8,6 @@ import (
"golang.org/x/sys/windows"
)
//go:embed web/wallpaper.html
var fs embed.FS
var (
user32 = windows.NewLazySystemDLL("user32.dll")
procFindWindowW = user32.NewProc("FindWindowW")
@@ -37,6 +33,9 @@ var jsQueue = make(chan string, 64)
var paused int32
const wmEvalJS = 0x0401
const wmSetHtml = 0x0402
var htmlQueue = make(chan string, 1)
func evalJS(js string) {
select {
@@ -50,13 +49,6 @@ func evalJS(js string) {
}
}
func min(a, b int) int {
if a < b {
return a
}
return b
}
func findWorkerW() uintptr {
progman, _, _ := procFindWindowW.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr("Progman"))), 0)