mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 14:45:52 -06:00
Toggle Search Button in the taskbar (#2162)
This commit is contained in:
parent
a0c4b33483
commit
227babe0e8
@ -3068,7 +3068,15 @@
|
||||
"Description": "If Enabled then Sticky Keys is activated - Sticky keys is an accessibility feature of some graphical user interfaces which assists users who have physical disabilities or help users reduce repetitive strain injury.",
|
||||
"category": "Customize Preferences",
|
||||
"panel": "2",
|
||||
"Order": "a069_",
|
||||
"Order": "a070_",
|
||||
"Type": "Toggle"
|
||||
},
|
||||
"WPFToggleTaskbarSearch": {
|
||||
"Content": "Taskbar Search",
|
||||
"Description": "If Enabled Search Button will be on the taskbar.",
|
||||
"category": "Customize Preferences",
|
||||
"panel": "2",
|
||||
"Order": "a068_",
|
||||
"Type": "Toggle"
|
||||
},
|
||||
"WPFOOSUbutton": {
|
||||
@ -3083,7 +3091,7 @@
|
||||
"Description": "If Enabled then Widgets Icon in Taskbar will be shown.",
|
||||
"category": "Customize Preferences",
|
||||
"panel": "2",
|
||||
"Order": "a068_",
|
||||
"Order": "a069_",
|
||||
"Type": "Toggle"
|
||||
},
|
||||
"WPFchangedns": {
|
||||
|
@ -98,6 +98,15 @@ Function Get-WinUtilToggleStatus {
|
||||
return $false
|
||||
}
|
||||
}
|
||||
if($ToggleSwitch -eq "WPFToggleTaskbarSearch"){
|
||||
$SearchButton = (Get-ItemProperty -path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search").SearchboxTaskbarMode
|
||||
if($SearchButton -eq 0){
|
||||
return $false
|
||||
}
|
||||
else{
|
||||
return $true
|
||||
}
|
||||
}
|
||||
if ($ToggleSwitch -eq "WPFToggleStickyKeys") {
|
||||
$StickyKeys = (Get-ItemProperty -path 'HKCU:\Control Panel\Accessibility\StickyKeys').Flags
|
||||
if($StickyKeys -eq 58){
|
||||
|
34
functions/private/Invoke-WinUtilTaskbarSearch.ps1
Normal file
34
functions/private/Invoke-WinUtilTaskbarSearch.ps1
Normal file
@ -0,0 +1,34 @@
|
||||
function Invoke-WinUtilTaskbarSearch {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Enable/Disable Taskbar Widgets
|
||||
|
||||
.PARAMETER Enabled
|
||||
Indicates whether to enable or disable Taskbar Widgets
|
||||
|
||||
#>
|
||||
Param($Enabled)
|
||||
Try{
|
||||
if ($Enabled -eq $false){
|
||||
Write-Host "Enabling Search Button"
|
||||
$value = 1
|
||||
}
|
||||
else {
|
||||
Write-Host "Disabling Search Button"
|
||||
$value = 0
|
||||
}
|
||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search\"
|
||||
Set-ItemProperty -Path $Path -Name SearchboxTaskbarMode -Value $value
|
||||
}
|
||||
Catch [System.Security.SecurityException] {
|
||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||
}
|
||||
Catch [System.Management.Automation.ItemNotFoundException] {
|
||||
Write-Warning $psitem.Exception.ErrorRecord
|
||||
}
|
||||
Catch{
|
||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||
Write-Warning $psitem.Exception.StackTrace
|
||||
}
|
||||
}
|
@ -28,5 +28,6 @@ function Invoke-WPFToggle {
|
||||
"WPFToggleMouseAcceleration" {Invoke-WinUtilMouseAcceleration $(Get-WinUtilToggleStatus WPFToggleMouseAcceleration)}
|
||||
"WPFToggleStickyKeys" {Invoke-WinUtilStickyKeys $(Get-WinUtilToggleStatus WPFToggleStickyKeys)}
|
||||
"WPFToggleTaskbarWidgets" {Invoke-WinUtilTaskbarWidgets $(Get-WinUtilToggleStatus WPFToggleTaskbarWidgets)}
|
||||
"WPFToggleTaskbarSearch" {Invoke-WinUtilTaskbarSearch $(Get-WinUtilToggleStatus WPFToggleTaskbarSearch)}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user