How to improve it? Cheers
Spoiler
Code: Select all
;
#SingleInstance, Force
Gui, Destroy
Gui, Add, GroupBox, % " x" 010 " y" 15 " w" 258 " h" 128, % "Select Options"
Gui, Add, Checkbox, x023 y40 vCheck1, Taskbar [On/Off]
Gui, Add, Checkbox, x023 y65 vCheck2, Desktop Icons [On/Off]
Gui, Add, Button, % " x" 5 " y" 150 " w" 70 " h" 20, % "Cancel"
Gui, Add, Button, % " x" 225 " y" 150 " w" 70 " h" 20, % "OK"
Gui, Show, % " w" 300 " h" 175, % "*** Tool ***"
Gui +AlwaysOnTop
Return
GuiEscape:
GuiClose:
ButtonCancel:
ExitApp
return
ButtonOK:
Gui, Submit, NoHide
Loop, 2
{
If Check%A_Index%
Goto Task%A_Index%
}
Return
Task1: ; Show / Hide Taskbar
If WinExist("ahk_class Shell_TrayWnd")
{
WinHide, ahk_class Shell_TrayWnd
WinHide, ahk_class Shell_SecondaryTrayWnd
}
Else
{
WinShow, ahk_class Shell_TrayWnd
WinShow, ahk_class Shell_SecondaryTrayWnd
}
Return
Task2: ; Show / Hide Desktop Icons
ControlGet, HWND, Hwnd,, SysListView321, ahk_class Progman
If HWND =
ControlGet, HWND, Hwnd,, SysListView321, ahk_class WorkerW
If DllCall("IsWindowVisible", UInt, HWND)
WinHide, ahk_id %HWND%
Else
WinShow, ahk_id %HWND%
Return