AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Trying to toggle autohide taskbar with keystroke in vista
Goto page Previous  1, 2, 3  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
ballyhairs



Joined: 02 Feb 2009
Posts: 112

PostPosted: Sun May 17, 2009 2:28 pm    Post subject: Reply with quote

The one from indiglo works really nice because it resizes items and full screen windows after it hides taskbar, only 2 bugs...
it will show on mouse hover after a while and if you enable TV out then system tray will show on TV part.
Any help?
Back to top
View user's profile Send private message
a_h_k



Joined: 02 Feb 2008
Posts: 627

PostPosted: Thu Dec 24, 2009 4:03 am    Post subject: Reply with quote

A similar solution here
Back to top
View user's profile Send private message Visit poster's website
Lewrex



Joined: 24 Dec 2009
Posts: 14

PostPosted: Thu Dec 24, 2009 1:29 pm    Post subject: Reply with quote

a_h_k,

The similar solution is this one Smile.

I simply adapted the code you guys have developed to make it dock savvy.

I've given you credit as you will see if you follow a_h_k's link.

I've been looking for some time for a way to kill and resurrect the taskbar because I really hate the windows autohide mechanism. When you drift near the edge your taskbar is on, it pops up when you really want it to stay hidden.

This gives me the control I want.

I've also added a hot corner to it, so the taskbar glides in and out when you move your mouse to a specified corner.

http://rocketdock.com/addon/docklets/26821


Last edited by Lewrex on Mon Dec 28, 2009 1:59 pm; edited 12 times in total
Back to top
View user's profile Send private message
Lewrex



Joined: 24 Dec 2009
Posts: 14

PostPosted: Sat Dec 26, 2009 2:10 am    Post subject: Reply with quote

If you put the WinShow first when unhiding, the taskbar glides back into place instead of snapping in:

See this section:

{
If x=0
{
WinShow ahk_class Shell_TrayWnd
NumPut( ( ABS_ALWAYSONTOP := 0x2 ), APPBARDATA, 32, "UInt" )
DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
x=1
return
}
Back to top
View user's profile Send private message
a_h_k



Joined: 02 Feb 2008
Posts: 627

PostPosted: Sun Dec 27, 2009 2:34 am    Post subject: Reply with quote

a_h_k wrote:
A similar solution here
I put this link in this thread, as i was sure your rocketdock link only referenced this thread (?). My link also goes straight to the working version in the thread

I don't use docks, nor Vista, but it sounds very good what you've done Smile

I was just helping a guy out with some "random" code, and it just so happened that it helped to satisfy a fairly long-standing want for some - that of to reliably show/hide the taskbar/SM, which is great!!!
I'm pleased that the code is being put to good use! Very Happy

Here is something i worked on several months ago (basic version working, but still need to complete): Improved Windows autohide sidebar
It's another way to deal with the problem of the auto-hide taskbar popping-up when you don't want it to. It keeps the taskbar as auto-hidden & behind all other windows, at all times. But when the mouse HOVERS for a USER-SET TIME, the taskbar then appears. Also it makes the taskbar go away whenever you focus on another window. Also resolves nuisance of Windows keeping taskbar showing a few seconds after a balloon tip first appears. Also uses the clickless way (there's a name for it) of invoking SM & SM sub-menus
I've have to continue work on it one of these days...
Back to top
View user's profile Send private message Visit poster's website
Lewrex



Joined: 24 Dec 2009
Posts: 14

PostPosted: Mon Dec 28, 2009 2:28 pm    Post subject: Reply with quote

a_h_k,

I don't think your tool works in Win7. I downloaded it, but in Win 7 it didn't seem to do as you describe.

I have Vista on another machine, but haven't tried it on that one yet.

I've been playing with my toggler some more and have added quite a bit of new functionality to do with screen resolutions and hot corner options. I'm going to put it on my website. No charge of course and will give you full credit since the actual toggle bit is your work, but lots has now come from myself and elsewhere, so I think I'll keep working on it and just keep updating on my site (which I'm in the process of finishing).

In the meantime, the latest version is on the RocketDock site:
http://rocketdock.com/addon/docklets/26821
Back to top
View user's profile Send private message
a_h_k



Joined: 02 Feb 2008
Posts: 627

PostPosted: Tue Dec 29, 2009 3:29 am    Post subject: Reply with quote

Lewrex wrote:
I don't think your tool works in Win7. I downloaded it, but in Win 7 it didn't seem to do as you describe

I have Vista on another machine, but haven't tried it on that one yet

Yeah, it probably doesn't work on 7 or Vista (yet), as i only created it on XP.
As i mentioned before, i'll need to work some more on it .. but maybe sooner than later? Wink
Back to top
View user's profile Send private message Visit poster's website
Lewrex



Joined: 24 Dec 2009
Posts: 14

PostPosted: Tue Jan 26, 2010 12:53 pm    Post subject: Reply with quote

I've made it a bit more automated:

http://www.autohotkey.net/~Lewrex/
_________________
---------------
Dallas
Back to top
View user's profile Send private message
Peace Logic



Joined: 24 Feb 2010
Posts: 7
Location: Falls Church, VA

PostPosted: Sun Feb 28, 2010 11:36 pm    Post subject: Re: Better Script Reply with quote

indiglo wrote:
I was looking for something like this for a while, and this thread helped me finally make something that works, so I figured I would let people know how to do it.

Thanks very much to EricCartman for the function calls, really all I did was fix the structure of the code.

Eric's code was working perfectly until I realized it was using 25% processor Shocked when the taskbar was showing.

This code uses no looping mechanisms, so it doesn't do anything except when you want it to.

Code:
{
   DetectHiddenWindows, On
   VarSetCapacity( APPBARDATA, 36, 0 )
   NumPut( ( ABS_ALWAYSONTOP := 0x2 )|( ABS_AUTOHIDE := 0x1 ), APPBARDATA, 32, "UInt" )
   DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
   Sleep 10                                ;Sometimes the bar doesn't get hidden 'all of the way' this prevents that.
   WinHide ahk_class Shell_TrayWnd
} ;If you want the taskbar to start visible, delete this block.

x=1

f12::  ;The key used to toggle the taskbar. Change it as you like.
{
   If x=0
   {
      NumPut( ( ABS_ALWAYSONTOP := 0x2 ), APPBARDATA, 32, "UInt" )
      DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
      WinShow ahk_class Shell_TrayWnd
      x=1
      return
   }

   If x=1
   {
      DetectHiddenWindows, On
      VarSetCapacity( APPBARDATA, 36, 0 )
      NumPut( ( ABS_ALWAYSONTOP := 0x2 )|( ABS_AUTOHIDE := 0x1 ), APPBARDATA, 32, "UInt" )
      DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
      Sleep 10
      WinHide ahk_class Shell_TrayWnd
      x=0
      return
   }
}


For people wondering how to 'install'/ 'where' to write this (as I did at first): 1-Download and install autohotkey. 2-Simply copy the above code and paste it into notepad. 3-save this file as a .ahk file. 4-open the file to run the script.

I'm not sure how to get this to happen automatically when you log in, but I don't know that much about autohotkey. I'm sure there is some way to do it if you look

Hope this helps.



First, Thank you for the script. This is the info I was looking for.

I noticed a few problems with the script and was wondering if some one could help me resolve them.

1. When my laptop goes to sleep and then wakes back up the auto hide mechanism is active again. In other words if you move your pointer down to the bottom of the screen the task bar jumps up. Now of course you can reactivate the intended behavior by pressing F12 twice, but I would like to find out how to prevent this from happening when returning from sleep mode.

2. If you press the windows key while the taskbar is hidden, the windows logo button remains visible and active after pressing the windows-key again.

I've thought of some code that will fix number two, but I'm not sure how to fix number one. I did find a post on how to detect sleep mode and returning from sleep mode:

http://www.autohotkey.com/forum/topic21697.htmlsleep+mode

It seems possible to re-initiate the the stay hidden function using the code in that thread, but there must be a more elegant solution than that.

Why does the script not work correctly after sleep mode?

Any help is greatly appreciated Smile

Dean
Back to top
View user's profile Send private message AIM Address
TurtleOfDoom
Guest





PostPosted: Wed Apr 07, 2010 6:05 pm    Post subject: A Shorter Solution Reply with quote

I find this to be a more elegant solution (it's adapted from those above)

Code:
^F10::ToggleAutoHideTaskBar()

ToggleAutoHideTaskBar()
{
   VarSetCapacity( APPBARDATA, 36, 0 )
   NumPut(36, APPBARDATA, 0, "UInt") ; First field is the size of the struct
   bits := DllCall("Shell32.dll\SHAppBarMessage"
             ,"UInt", 4 ; ABM_GETSTATE
             ,"UInt", &APPBARDATA ) 
  NumPut( (bits ^ 0x1), APPBARDATA, 32, "UInt" ) ; Toggle Autohide
  DllCall("Shell32.dll\SHAppBarMessage"
             ,"UInt", ( ABM_SETSTATE := 0xA )
             ,"UInt", &APPBARDATA )
}
Back to top
foo_mep
Guest





PostPosted: Tue Jun 08, 2010 12:09 pm    Post subject: Reply with quote

the script is great.
but its possible to hide taskbar total. not autohide?
Back to top
a_h_k



Joined: 02 Feb 2008
Posts: 627

PostPosted: Wed Jun 09, 2010 12:59 am    Post subject: Reply with quote

The similar solution i mentioned before...
Code:
#NoEnv
#NoTrayIcon
#SingleInstance force
DetectHiddenWindows, Off   ;for IfWinExist

VarSetCapacity( APPBARDATA, 36, 0 )
;------------------------------------------------------------
; Fetch current hidden/showing status

IfWinNotExist, ahk_class Shell_TrayWnd
  TaskbarAndStartToggleState = 0     ;Currently hidden (not showing)
Else
  TaskbarAndStartToggleState = 1     ;Currently non-hidden (showing)
;------------------------------------------------------------
Gosub +z   ;Toggle the taskbar/SM state
;------------------------------------------------------------
Exit
;------------------------------------------------------------
+z::
 TaskbarAndStartToggleState := Func(TaskbarAndStartToggleState)
Return

Func(TaskbarAndStartToggleState)
{
   Global APPBARDATA

   If TaskbarAndStartToggleState = 0
   {
      NumPut( (ABS_ALWAYSONTOP := 0x2), APPBARDATA, 32, "UInt" )           ;Enable "Always on top" (& disable auto-hide)
      DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )

      WinShow ahk_class Shell_TrayWnd
      Return 1            ;Now showing
   }
   
   If TaskbarAndStartToggleState = 1
   {
      NumPut( ( ABS_AUTOHIDE := 0x1 ), APPBARDATA, 32, "UInt" )            ;Disable "Always on top" (& enable auto-hide to hide Start button)
      DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )

      WinHide ahk_class Shell_TrayWnd
      ;WinHide ahk_class Shell_TrayWnd   ;don't need this 2nd one?
      Return 0            ;Now hidden
   }
}
Back to top
View user's profile Send private message Visit poster's website
foo_mep
Guest





PostPosted: Wed Jun 09, 2010 7:39 am    Post subject: Reply with quote

ahh great. thank you Smile
Back to top
dnquark



Joined: 21 Dec 2007
Posts: 10

PostPosted: Thu Dec 30, 2010 10:35 am    Post subject: Reply with quote

With all the scripts that are listed here, the taskbar hides, but the windows don't maximize -- there's just blank space where the taskbar used to be through which the desktop wallpaper shows. Is there a way to make windows maximize?..
Back to top
View user's profile Send private message
a_h_k



Joined: 02 Feb 2008
Posts: 627

PostPosted: Wed Jan 19, 2011 11:32 am    Post subject: Reply with quote

I sure i answered something exactly like this not long ago..
_________________
My Ahk Site
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group