优化: 知识卡片交互+deepseek模型+鼠标钩子
This commit is contained in:
21
systray.go
21
systray.go
@@ -124,7 +124,7 @@ func startWebView() {
|
||||
wvHwnd = uintptr(wv.Window())
|
||||
procShowWindow.Call(wvHwnd, 0) // SW_HIDE
|
||||
procSetWindowLongPtrW.Call(wvHwnd, gwlStyle, wsPopup|wsVisible|wsChild)
|
||||
procSetWindowLongPtrW.Call(wvHwnd, gwlExStyle, wsExTransparent|wsExLayered)
|
||||
procSetWindowLongPtrW.Call(wvHwnd, gwlExStyle, wsExLayered)
|
||||
|
||||
// 立即嵌入 WorkerW
|
||||
embedWorkerW(workerw, screenW, screenH)
|
||||
@@ -136,6 +136,20 @@ func startWebView() {
|
||||
return saveConfig(cfg)
|
||||
})
|
||||
|
||||
wv.Bind("refreshKnowledge", func() string {
|
||||
go fetchAndPushKnowledge()
|
||||
return ""
|
||||
})
|
||||
|
||||
wv.Bind("setInteractiveRect", func(left, top, right, bottom float64) string {
|
||||
overlayHitRect.Left = int32(left)
|
||||
overlayHitRect.Top = int32(top)
|
||||
overlayHitRect.Right = int32(right)
|
||||
overlayHitRect.Bottom = int32(bottom)
|
||||
overlayHasHitRect = true
|
||||
return ""
|
||||
})
|
||||
|
||||
log.Println("设置 HTML...")
|
||||
cfg := loadConfig()
|
||||
wv.SetHtml(buildWallpaperHTML(cfg))
|
||||
@@ -145,6 +159,11 @@ func startWebView() {
|
||||
procShowWindow.Call(wvHwnd, 5)
|
||||
log.Println("壁纸窗口已显示")
|
||||
|
||||
// 子类化:WM_NCHITTEST 动态穿透(WebView2 初始化完成后)
|
||||
subclassOverlayWindows()
|
||||
// 全局鼠标钩子:桌面图标层拦截了 WM_NCHITTEST,用钩子直接捕获点击
|
||||
installMouseHook()
|
||||
|
||||
go func() {
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
reloadAllCards()
|
||||
|
||||
Reference in New Issue
Block a user