Windows 11 的任务栏相比之前的 Windows 版本有什么特别的地方吗?为什么无法用 AHK 将窗口放在任务栏上了?

2023-03-11 14:29:05 +08:00
 shendaowu

之前在 AHK 官方论坛问了,没人回复。所以来这里碰碰运气。

下面的代码在 Windows 10 里好用,在 Windows 11 里没用:

WinGetPos, taskbar_x, taskbar_y, taskbar_w, taskbar_h, ahk_class Shell_TrayWnd

overlay_height := 36
overlay_width := 36
;overlay_x := taskbar_w - 172
overlay_x := 1200
overlay_y := 2

Gui, Margin, 0, 0
Gui, -Caption +ToolWindow +LastFound
GUI_ID := WinExist()
WinGet, TaskBar_ID, ID, ahk_class Shell_TrayWnd
DllCall("SetParent", "uint", GUI_ID, "uint", Taskbar_ID)

Gui,Show, x%overlay_x% y%overlay_y% h%overlay_height% w%overlay_width% NoActivate, overlaygui_1

ControlGet, phwnd, hwnd,, msctls_progress321
WinSet, ExStyle, -0x20000, ahk_id %phwnd%

代码是网上东拼西凑的,我不太理解。看不懂问我基本也没什么用。

另外除了放在任务栏上还有其他的方法达到类似的效果吗?我要的效果就是随时都能看到但是不要遮挡其他窗口。

1432 次点击
所在节点    Windows
3 条回复
cheng6563
2023-03-11 16:17:28 +08:00
Win11 的任务栏不是重写了吗
Noicdi
2023-03-11 16:23:41 +08:00
win11 的任务栏重写了,前段时间 translucenttb 也失效了,在 GitHub 里找到这个,关闭了新任务栏,你试试行不行

https://github.com/TranslucentTB/TranslucentTB/issues/537#issuecomment-1053807594
hanksun
2023-03-12 01:20:53 +08:00
重写了,Win11 的任务栏跟过去所有 Win 的任务栏逻辑也不一样了,现在就是个类似 macOS dock 一样的存在,存放图标而已。(不理解)

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/923144

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX