Created
January 14, 2013 17:04
-
-
Save kissgyorgy/4531556 to your computer and use it in GitHub Desktop.
AutoIt: Lock/Unlock Windows taskbar in Windows 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WinAPI.au3> | |
#include <WindowsConstants.au3> | |
$iPrevState = LockTaskBar(1) | |
Func LockTaskBar($iLock) | |
41If @OSVersion <> "WIN_7" Then | |
MsgBox(16,"Onyl on Windows 7", "The taskbar can only be locked this way in Windows 7 !") | |
Return | |
EndIf | |
Local $iPrevState = RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSizeMove") | |
$hTrayWnd = WinGetHandle("[CLASS:Shell_TrayWnd]") | |
If _WinAPI_GetClassName($hTrayWnd) <> "Shell_TrayWnd" Then Exit | |
If $iPrevState = $iLock Then _SendMessage($hTrayWnd, $WM_COMMAND, 424, 0) | |
Return 1-$iPrevState | |
EndFunc ;==>LockTaskBar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment