Tyleo-Dev-AutoIT-Oldies/Win11-Tools/TaskbarPos/TaskbarPos-Changer.au3

54 lines
1.5 KiB
AutoIt
Raw Permalink Normal View History

2024-02-18 21:17:39 +00:00
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("TaskBar Pos", 240, 100, 270, 197)
Global $ToTop = GUICtrlCreateButton("Taskbar to Top", 8, 48, 225, 33)
Global $ToBottom = GUICtrlCreateButton("Taskbar to Bottom (Default)", 8, 16, 225, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
HotKeySet("e",ExpLoad)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $ToTop
ShellExecute(@ScriptDir & "\TopPos.reg")
MsgBox(0,"Reload Explorer","Click OK to reload explorer now !")
Run("taskkill /im explorer.exe /f")
Sleep(250)
Run("explorer.exe")
Run("taskkill /im explorer.exe /f")
Sleep(250)
Run("explorer.exe")
Run("taskkill /im explorer.exe /f")
Sleep(250)
Run("explorer.exe")
Run("taskkill /im explorer.exe /f")
Sleep(250)
Run("explorer.exe")
Case $ToBottom
ShellExecute(@ScriptDir & "\DefaultPos.reg")
MsgBox(0,"Reload Explorer","Click OK to reload explorer now !")
Run("taskkill /im explorer.exe /f")
Sleep(250)
Run("explorer.exe")
Run("taskkill /im explorer.exe /f")
Sleep(250)
Run("explorer.exe")
Run("taskkill /im explorer.exe /f")
Sleep(250)
Run("explorer.exe")
Run("taskkill /im explorer.exe /f")
Sleep(250)
Run("explorer.exe")
EndSwitch
WEnd
Func ExpLoad()
Run("explorer.exe")
EndFunc