Jump to content

Command for Auto-hide the taskbar ?


Outbreaker
 Share

Recommended Posts

I use this script to enable the "Quick Launch" but i can't find any command for enabling "Auto-hide the taskbar" :)

#Include <SendMessage.au3>

Const $WM_USER = 0X400

Const $WMTRAY_TOGGLEQL = ($WM_USER + 237)

If $CmdLine[0] = 1 Then

Select

Case $CmdLine[1] = 0

_SendMessage(WinGetHandle("[CLASS:Shell_TrayWnd]"), $WMTRAY_TOGGLEQL, 0, False)

Case $CmdLine[1] = 1

_SendMessage(WinGetHandle("[CLASS:Shell_TrayWnd]"), $WMTRAY_TOGGLEQL, 0, True)

EndSelect

EndIf

Edited by Outbreaker
Link to comment
Share on other sites

  • Moderators

No that's not working. :idiot:

TOGGLEQL = Ouick Launch

I am searching for the hide taskbar.

Yes that is working. You're just not using it right :P

Use the ClassNameNN of the TaskBar. It's been done a ton of times on here in fact.

Edit:

I may have totally mistaken what you're asking though >_< ... not unusual.

I think you want to just enable, not progmatically do it from your script :)

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

@SmOke_N

Afaik he wants to turn it permanently off which seems to be a bit tricky, using the registry is hard and using ControlCommand() is not very "clean". There should be a proper solution but I don't know it :)

Link to comment
Share on other sites

I have an other script that i snipped together but the problem is that it's only working on English Windows.

And i don't now how to make it language-independent. I think its works with the "WinGetHandle" command but i am little bit lost how make the script work with that. I tryd but failed. :)

If $CmdLine[0] = 1 Then
    Select
        Case $CmdLine[1] = 0
            Run("Rundll32.exe SHELL32.DLL,Options_RunDLL 1")
            WinWaitActive("Taskbar and Start Menu Properties", "Taskbar", 6)
            ControlFocus("Taskbar and Start Menu Properties", "Taskbar","SysTabControl321")
            If ControlCommand("Taskbar and Start Menu Properties", "Taskbar", "Button5", "IsChecked") = 1 Then
                ControlCommand("Taskbar and Start Menu Properties", "Taskbar", "Button5", "UnCheck")
                ControlClick("Taskbar and Start Menu Properties", "Taskbar", "Button11")
            Else
                WinClose("Taskbar and Start Menu Properties")
            EndIf
        Case $CmdLine[1] = 1
            Run("Rundll32.exe SHELL32.DLL,Options_RunDLL 1")
            WinWaitActive("Taskbar and Start Menu Properties", "Taskbar", 6)
            ControlFocus("Taskbar and Start Menu Properties", "Taskbar","SysTabControl321")
            If ControlCommand("Taskbar and Start Menu Properties", "Taskbar", "Button5", "IsChecked") = 1 Then
                WinClose ("Taskbar and Start Menu Properties")
            Else
                ControlCommand("Taskbar and Start Menu Properties", "Taskbar", "Button5", "Check")
                ControlClick("Taskbar and Start Menu Properties", "Taskbar", "Button11")
            EndIf
    EndSelect
EndIf
Edited by Outbreaker
Link to comment
Share on other sites

  • Moderators

This is the best I could do before Heros started :) ...

I'm not happy with having to kill explorer, there's a CE dll call to refresh I tried, but it failed (I even though to just put up a gui of the current screen and lock the mouse >_< ). Maybe someone else can pick it up.

The descriptions of what can be done are in the function:

_TaskBar_SetState(2)

Func _TaskBar_SetState($i_set = 2)
    #cs
        1 = Auto Hide and Show Clock 
        2 = Always on Top and Show Clock 
        3 = Always on Top and Auto Hide and Show Clock 
        4 = Show small icons in Start Menu and Show Clock 
        5 = Always on Top and Show small icons in Start Menu 
        6 = Always on Top and Auto Hide and Show small icons in Start Menu 
        7 = Always on Top and Show small icons in Start Menu and Show Clock 
        8 = All Options Enabled 
        9 = Always on Top and Auto Hide 
        10 = Auto Hide and Show small icons in Start Menu
    #ce
    
    Local Const $WM__SETTINGCHANGE = 0x001A
    
    Local $s_set_num
    
    Switch Int($i_set)
        Case 1, 2, 3, 4
            $s_set_num = StringFormat("%02s", Int($i_set))
        Case 5
            $s_set_num = "0E"
        Case 6
            $s_set_num = "0F"
        Case 7
            $s_set_num = "06"
        Case 8
            $s_set_num = "07"
        Case 9
            $s_set_num = "0B"
        Case 10
            $s_set_num = "0D"
        Case Else
            Return SetError(1, 0, 0)
    EndSwitch
    
    Local $s_key = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2"
    If @OSType = "WIN32_WINDOWS" Then $s_key = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects"
    
    Local $s_current_val = RegRead($s_key, "Settings")
    
    Local $s_compare = StringRegExpReplace($s_current_val, "(.{16})(.{2})(.+?)\z", "\2")
    If $s_compare = $s_set_num Then Return $s_current_val
    
    Local $s_convert = StringReplace(StringRegExpReplace($s_current_val, "(.{16})(.{2})(.+?)\z", "\1 " & $s_set_num  & " \3"), " ", "")
    RegWrite($s_key, "Settings", "REG_BINARY", $s_convert)
    
    ; CE method doesn't work , can't figure out the right values that are used.
    ;DllCall("User32.dll", "int", "SendMessage", "hwnd", WinGetHandle("[CLASS:Shell_TrayWnd]"), "int", $WM__SETTINGCHANGE, "wparam", 0, "lparam", 5000)
    
    Local $i_explorer_pid = ProcessExists("explorer.exe")
    ProcessClose($i_explorer_pid)
    ProcessWait("explorer.exe")
    
    Return $s_current_val
EndFunc

Edit:

http://msdn.microsoft.com/en-us/library/ms725497(VS.85).aspx

Oops, guess I forgot to work with SystemParametersInfo() http://msdn.microsoft.com/en-us/library/ms724947(VS.85).aspx

In my DllCall method I originally tried.

If ya'll figure it before I'm interested again, feel free.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...