[AHK] Windows 10上用热键 隐藏/显示桌面图标

105 篇文章 5 订阅
92 篇文章 3 订阅

简单点,再简单点,alt+q 隐藏、显示桌面图标!

!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%
}
;双击桌面右上角显示隐藏桌面图标

#Persistent
CoordMode, Pixel, Screen
CoordMode, Mouse, Screen
;~ 桌面Progman|WorkerW
GroupAdd, Desktop, ahk_class ExploreWClass
GroupAdd, Desktop, ahk_class WorkerW
WaitTime := DllCall("GetDoubleClickTime")/1000
;屏幕左上
x1:=0
y1:=0
;任务栏高度
WinGetPos,,,, h,ahk_class Shell_TrayWnd
;屏幕右下
x2:=A_ScreenWidth
y2:=A_ScreenHeight-h
OutputDebug %x2%,%y2%
#IfWinActive, ahk_group Desktop
~LButton::
KeyWait,LButton
KeyWait, LButton, d T %WaitTime%+200
If ! Errorlevel
{
	MouseGetPos,x,y
	OutputDebug %x%-%y%
	;~ if (x<x1+10 and y<y1+10 )  ;屏幕左上角10*10见方。
	;~ {	
		;~ OutputDebug 左上角
		;~ HideOrShowDesktopIcons()
	;~ }
	if (x>x2-10 and y<y1+10 )  ;屏幕右上角10*10见方。
	{	
		OutputDebug 右上角
		HideOrShowDesktopIcons()
	}
	else if (x<x1+10)
    {
		OutputDebug 左边
        ;~ Run notepad
    }
	else if (y<y1+10)
    {
		OutputDebug 上边
        ;~ Run notepad
    }

	else if(x>x2-10)
	{
		OutputDebug 右边
		;~ run calc
	}
	else if(y>y2-10)
	{
		OutputDebug 下边
		;~ run calc
	}
	else
	{
		OutputDebug 其它
		ToolTip %x%-%y%
		Sleep,1000
		ToolTip
	}
}
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%
}

以下可以不看了。

 

How to Hide All Desktop Icons in Windows 10

Your Desktop is a special folder which shows your background wallpaper that you have chosen and your files, folders, documents, shortcuts and all such items you have stored. It appears every time you sign in to Windows. Today, we will see how to quickly hide your desktop contents.

RECOMMENDED: Click here to fix Windows errors and optimize system performance


Tip: In earlier Windows versions, the Desktop had important icons enabled by default - This PC, Network, Control Panel, and your User files folder. They were all visible by default. However, in modern Windows versions, Microsoft made most of these icons hidden. In Windows 10, only the Recycle Bin is present on the Desktop by default. Also, the Windows 10 Start Menu does not have links to these icons either. You can enable classic Desktop icons as follows:

 

Enable Desktop Icons in Windows 10

To hide all desktop icons in Windows 10, you can do the following.

  1. Minimize all open windows and apps. You can use Win + D or Win + M shortcut keys. Alternatively, you can right-click the taskbar and select "Show the desktop" from the context menu or left click the far end of the taskbar.Taskbar Context Menu Show DesktopTip: See What is the difference between Win + D (Show Desktop) and Win + M (Minimize All) keyboard shortcuts in Windows
  2. Right click the empty space on your Desktop and select View - Show Desktop Icons. This command will toggle the visibility of your Desktop icons.Windows 10 Hide Desktop Icons

This is pretty simple.

Depending on your production environment, it may be necessary to disable Desktop icons for all users in your Active Directory/domain, a specific user on your computer or for all users of your PC. In this case, you can use a special Group Policy item or a Registry tweak. Let's review them.

If you are running Windows 10 Pro, Enterprise, or Education edition, you can use the Local Group Policy Editor app.

Hide All Desktop Icons in Windows 10 with Group Policy

  1. Press Win + R keys together on your keyboard and type:
    gpedit.msc

    Press Enter.Windows 10 run gpedit

  2. Group Policy Editor will open. Go to User Configuration\Administrative Templates\Desktop. Enable the policy option Hide and disable all items on the desktop as shown below.Windows 10 Hide Desktop Icons Gp

Hide All Desktop Icons in Windows 10 with a Registry tweak

  1. Open Registry Editor.
  2. Go to the following Registry key:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    Tip: See how to jump to the desired Registry key with one click.

    If you do not have such a key, then just create it.

  3. Here, create a new 32-bit DWORD value NoDesktopNote: Even if you are running 64-bit Windows, you still need to use a 32-bit DWORD as the value type.
    Set it to 1 to hide desktop icons.Windows 10 Hide Desktop Icons Tweak
  4. To make the changes done by the Registry tweak take effect, you need to sign out and sign in again to your user account.

Later, you can delete the NoDesktop value to allow the user to use Desktop icons.

To apply this option for all users, ensure that you are signed in as Administrator before proceeding.

Then, go to the following Registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

Create the same value here, NoDesktop as described above.

评论 16
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值