Jump to content


Photo

Pleasant TaskBar


  • Please log in to reply
18 replies to this topic

#1 HotKeyIt

HotKeyIt
  • Fellows
  • 6133 posts

Posted 27 March 2012 - 06:57 PM

That is a script I use for years and thought to share now, especially when I read about all the problems with Auto Hide Taskbar on Win7.

Works on XP as well as on Win7, not tested on Vista but should work too.

When a taskbar flashes, tray will be shown for 5 seconds and hidden again.

Simply save the script as Pleasant TaskBar.ahk and double click it.
To show up the Start menu press Windows Key or move mouse in left bottom corner.
Move it away from TaskBar or press Windows Key again to hide it.

Required Taskbar properties:
In XP you should untick Keep the taskbar on top of other windows
In Win_7 Auto-hide the taskbar should be ticked

Enjoy Posted Image
#SingleInstance force
#NoTrayIcon
#Persistent
CoordMode,Mouse,SCREEN
Gui +LastFound
DllCall("RegisterShellHookWindow","UInt",WinExist()),OnMessage(DllCall( "RegisterWindowMessage","Str","SHELLHOOK" ),"ShellMessage")
SetTimer,CheckMouse, 100
SetWinDelay,0
SetBatchLines,-1
Return

CheckMouse:
MouseGetPos,x,y,hWnd,Ctrl
If (hWnd=WinExist("AHK_class Shell_TrayWnd") || hWnd=WinExist("Start AHK_class Button")
|| ( WinExist("AHK_class Shell_TrayWnd")
&& ( WinExist("ahk_class ahk_class #32768") || WinExist("AHK_class TaskListThumbnailWnd")
|| WinExist("ahk_class DV2ControlHost") || WinExist("AHK_class NotifyIconOverflowWindow")) ) ){
SetTimer,CheckMouse, 100
Return
} else if (x<2 && y>A_ScreenHeight-30 && !WinExist("AHK_class Shell_TrayWnd") && !WinExist("ahk_class DV2ControlHost")){
Sleep,100
MouseGetPos,_x,_y
If (!(x=_x && y=_y) || GetKeyState("Lbutton","P")){
SetTimer,CheckMouse, 100
Return
}
WinShow, AHK_class Shell_TrayWnd
WinShow, Start AHK_class Button
} else if (WinExist("ahk_class DV2ControlHost")){
WinHide, ahk_class DV2ControlHost
WinShow, AHK_class Shell_TrayWnd
WinShow, Start AHK_class Button
WinShow, ahk_class DV2ControlHost
} else if (WinExist("AHK_class Shell_TrayWnd") && x>1){
WinHide, AHK_class Shell_TrayWnd
WinHide, Start AHK_class Button
WinHide, AHK_class NotifyIconOverflowWindow
}
SetTimer,CheckMouse, 100
Return

ShellMessage( wParam,lParam )
{
If ( wParam = 0x8006 ){
If WinExist("ahk_class DV2ControlHost") && DVShow:=1
WinHide, ahk_class DV2ControlHost
WinShow, AHK_class Shell_TrayWnd
WinShow, Start AHK_class Button
If DVShow
WinShow, ahk_class DV2ControlHost
SetTimer,CheckMouse, -5000
}
}


#2 fragman

fragman
  • Members
  • 1591 posts

Posted 28 March 2012 - 02:44 PM

You can use shell messages to react to window notifications ("blinking in taskbar").

#3 HotKeyIt

HotKeyIt
  • Fellows
  • 6133 posts

Posted 28 March 2012 - 06:56 PM

When a taskbar flashes, tray will be shown for 5 seconds and hidden again.


Many thanks to Lexikos for this ;)

#4 xyla

xyla
  • Members
  • 1 posts

Posted 18 June 2012 - 01:25 AM

This program is so amazing! Thank you so much. I've been looking for a solution to that pesky auto-hide on Win7 and this is it.

#5 kangaroo

kangaroo
  • Guests

Posted 18 June 2012 - 05:07 PM

is there a way to disable this function so that I can see the taskbar again?

#6 HotKeyIt

HotKeyIt
  • Fellows
  • 6133 posts

Posted 19 June 2012 - 05:07 AM

Sure, just add a Hotkey in the end of the code to pause or exit the script, e.g.:
^!Escape::ExitApp
You can also remove #NoTrayIcon, so you can see an icon in the tray and exit the script that way.

#7 kangaroo

kangaroo
  • Guests

Posted 19 June 2012 - 08:25 AM

Hi HotkeyIT, unfortunately ExitApp does not work. Is there another solution I might try? I mean with hotkeys not with tray icon?

#8 HotKeyIt

HotKeyIt
  • Fellows
  • 6133 posts

Posted 19 June 2012 - 07:35 PM

Sorry I think I misunderstood you, I know what you mean now :roll:

Can you try main script again, I have updated it to run OnExit subroutine and show up Taskbar before exiting.

#9 MsgBox

MsgBox
  • Members
  • 204 posts

Posted 19 June 2012 - 09:50 PM

Hi HotKeyIt, I don't usually have the taskbar hidden but did so just to try your script as you said it wasn't tested with Vista.

For me it didn't work as it should. Pressing the Winkey caused the taskbar and startmenu to momentarily show then disappear. Pressing the key once more and they stayed on screen.

A small annoyance is that when firefox is active, moving the cursor to the bottom left of the screen to activate the menu/taskbar caused firefox's sidebar (plugin) to open.

Just thought you'd like to know how it performs with Vista. 8)

#10 comvox

comvox
  • Members
  • 137 posts

Posted 19 June 2012 - 11:14 PM

Thanks, HotKeyIt! This is a pleasant script indeed.
Now, I thought it would be convenient to have the taskbar show when one has the cursor to the right corner as well as the left corner. (This makes it easier to get to the Windows system tray.) But it's easy to have the script do this by simply modifying
x<2 && y>A_ScreenHeight-30
in line 25 to
((x<25 && y>A_ScreenHeight-30) or (x>A_ScreenWidth-25 && A_ScreenHeight-30))
(I changed the "2" because of the screen resolution I use.)

#11 HotKeyIt

HotKeyIt
  • Fellows
  • 6133 posts

Posted 24 November 2012 - 01:02 PM

Updated to behave more pleasantly Posted Image
Updated to hide NotifyIconOverflowWindow in Win 7 as well.

EDIT:
Do not hide when NotifyIconOverflowWindow is under mouse.
EDIT2:
Fixed TrayWindow has not been hidden.
EDIT3:
Do not hide active when TaskListThumbnailWnd is under mouse.

#12 hoppfrosch

hoppfrosch
  • Members
  • 339 posts

Posted 26 November 2012 - 09:14 AM

As I don't use horizontal but vertical Taskbar (on the right side), I would like to show the taskbar on moving mouse onto upper border in the upper right corner. The modification is no prob according to comvox tip.

But: Is there a way to determine the orientation and position of taskbar automatically? Cannot figure it out yet...

Having this info the script could automatically handle showing up moving mouse to the left or upper border, depending on configured orientation/position of the taskbar ...

#13 HotKeyIt

HotKeyIt
  • Fellows
  • 6133 posts

Posted 26 November 2012 - 06:25 PM

I also use horizontal but on left side so left bottom is perfect for me, I assume right bottom will be best for you because at right top you have the close button for windows, especially if they are maximized.

All you need to change is
} else if (x<2 &&
to
} else if (x>(A_ScreenWidth-2) &&

#14 hoppfrosch

hoppfrosch
  • Members
  • 339 posts

Posted 28 November 2012 - 06:19 AM

Thanks for your suggestion - will try it.

Is it possible to detect the position of the taskbar automatically? And let your script decide based of this info, which border to move mouse to?

#15 zhotkey

zhotkey
  • Members
  • 19 posts

Posted 22 April 2013 - 01:27 PM

This script works for 2 monitors.  However, when I use 3 monitors, the windows key will not activate the task bar properly unless I press the windows key in the 3rd monitor.  If I press the windows key in the other windows the task bar comes up but it only has the desktop background and the lower taskbar is unreadable except for the pop up programs menu.