Windows 10上用AutoHotkey实现快速隐藏/显示桌面图标与切换虚拟桌面

在这里插入图片描述
当你想用多个桌面的时候需要按ctrl+Windows+左右键 觉得很麻烦怎么办?

下载 AutoHotkey

编辑脚本 添加以下内容

~LControl & WheelUp::
Send {LWin Down}{Ctrl Down}{Left}{Ctrl Up}{LWin Up}
return
~LControl & WheelDown::
Send {LWin Down}{Ctrl Down}{Right}{Ctrl Up}{LWin Up}
return

这样左Ctrl+鼠标滚轮即可实现切换桌面

快速隐藏桌面图标

添加

!q::
HideOrShowDesktopIcons()
return
 
HideOrShowDesktopIcons()
{
	ControlGet, class, Hwnd,, SysListView321, ahk_class Progman
	If class =
		ControlGet, class, Hwnd,, SysListView321, ahk_class WorkerW
 
	If DllCall("IsWindowVisible", UInt,class)
		WinHide, ahk_id %class%
	Else
		WinShow, ahk_id %class%
}

alt+q 实现快速隐藏图标

如何创建脚本

在这里插入图片描述

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

~LControl & WheelUp::
Send {LWin Down}{Ctrl Down}{Left}{Ctrl Up}{LWin Up}
return
~LControl & WheelDown::
Send {LWin Down}{Ctrl Down}{Right}{Ctrl Up}{LWin Up}
return

!q::
HideOrShowDesktopIcons()
return
 
HideOrShowDesktopIcons()
{
	ControlGet, class, Hwnd,, SysListView321, ahk_class Progman
	If class =
		ControlGet, class, Hwnd,, SysListView321, ahk_class WorkerW
 
	If DllCall("IsWindowVisible", UInt,class)
		WinHide, ahk_id %class%
	Else
		WinShow, ahk_id %class%
}

添加以上内容 功能可全部实现

将脚本添加到启动中可以开机自启.

发布了126 篇原创文章 · 获赞 35 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_43442524/article/details/103744613