#NoTrayIcon #Region ;**** 参数创建于 ACNWrapper_GUI **** #PRE_Icon=蓝点lilac.ico #PRE_Outfile=RemoveShowDesktopButton_x32.exe #PRE_Outfile_x64=RemoveShowDesktopButton_x64.exe #PRE_Compression=4 #PRE_Compile_Both=y #PRE_Res_Comment=RemoveShowDesktopButton #PRE_Res_Description=移除显示桌面按钮 #PRE_Res_Fileversion=1 #PRE_Res_LegalCopyright=copyright?2019 蓝点lilac #PRE_Res_requestedExecutionLevel=None #PRE_Res_Field=LegalTrademarks|蓝点lilac #PRE_Res_Field=CompanyName|蓝点lilac #Obfuscator_Parameters=/cs=1 /cn=1 /cf=1 /cv=1 /sf=1 /sv=1 /sci=1 #EndRegion ;**** 参数创建于 ACNWrapper_GUI **** $g_szVersion = "RemoveShowDesktopButton" If WinExists($g_szVersion) Then Exit AutoItWinSetTitle($g_szVersion) #include <Constants.au3> Opt("TrayMenuMode", 3) $hwnd = WinGetHandle("[CLASS:Shell_TrayWnd]", "") Local $iPath = EnvGet("APPDATA") & "\BluePointLilac\RemoveShowDesktopButton\" If @ScriptFullPath =$iPath & "RemoveShowDesktopButton.exe" Then ControlHide($hwnd, "", "TrayShowDesktopButtonWClass1") TraySetState(1) TraySetState(2) Exit EndIf Example() Func Example() Local $iRunMenu = TrayCreateMenu("启动项") Local $iRun = TrayCreateItem("开机自启动",$iRunMenu) TrayCreateItem("",$iRunMenu) Local $iBack = TrayCreateItem("启动后退出",$iRunMenu) TrayCreateItem("") Local $iHide = TrayCreateItem("隐藏按钮") TrayCreateItem("") Local $iShow = TrayCreateItem("显示按钮") TrayCreateItem("") Local $iExit = TrayCreateItem("退出") TraySetState(1) ; Show the tray menu. TraySetToolTip("移除显示桌面按钮" & Chr(10) & "作者:蓝点lilac") Local $iBoot = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "RemoveShowDesktopButton") If FileExists($iBoot) Then TrayItemSetState($iRun, $TRAY_CHECKED) TrayItemSetState($iBack,$TRAY_ENABLE) If $iBoot =$iPath & "RemoveShowDesktopButton.exe" Then TrayItemSetState($iBack, $TRAY_CHECKED) Else TrayItemSetState($iBack, $TRAY_UNCHECKED) EndIf Else TrayItemSetState($iRun, $TRAY_UNCHECKED) TrayItemSetState($iBack,$TRAY_DISABLE) EndIf TraySetClick(8) ; Show the tray menu when the mouse if hovered over the tray icon. While 1 Switch TrayGetMsg() Case $iHide ControlHide($hwnd, "", "TrayShowDesktopButtonWClass1") TraySetState(2) TraySetState(1) Case $iShow ControlShow($hwnd, "", "TrayShowDesktopButtonWClass1") TraySetState(2) TraySetState(1) Case $iRun If TrayItemGetState($iRun)=68 Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "RemoveShowDesktopButton", "REG_SZ", @ScriptFullPath) TrayItemSetState($iRun, $TRAY_CHECKED) TrayItemSetState($iBack, $TRAY_ENABLE) ElseIf TrayItemGetState($iRun)=65 Then RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "RemoveShowDesktopButton") TrayItemSetState($iRun, $TRAY_UNCHECKED) TrayItemSetState($iBack, $TRAY_DISABLE) TrayItemSetState($iBack, $TRAY_UNCHECKED) EndIf Case $iBack If TrayItemGetState($iBack)=68 Then TrayItemSetState($iBack, $TRAY_CHECKED) FileCopy(@ScriptFullPath, $iPath, 9) FileMove($iPath & @ScriptName,$iPath & "RemoveShowDesktopButton.exe",1) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "RemoveShowDesktopButton", "REG_SZ", $iPath & "RemoveShowDesktopButton.exe") ElseIf TrayItemGetState($iBack)=65 Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "RemoveShowDesktopButton", "REG_SZ", @ScriptFullPath) TrayItemSetState($iBack, $TRAY_UNCHECKED) FileDelete($iPath & "RemoveShowDesktopButton.exe") EndIf Case $iExit ExitLoop EndSwitch WEnd EndFunc
原文地址:https://www.cnblogs.com/BluePointLilac/p/11701158.html
时间: 2024-11-03 22:37:45