ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

[Compleet]: Auto replace icon in captionbar & taskbar

<< < (6/8) > >>

skwire:
Is it possible just to hide them, not remove them?-tmpusr (September 28, 2009, 10:45 PM)
--- End quote ---

I suppose one could write code to watch the mouse cursor and, if it was in the titlebar area, set the window style back to +0x80000 to show the buttons again.

Is it possible just to hide some of them, e.g. leaving the close button only?-tmpusr (September 28, 2009, 10:45 PM)
--- End quote ---

I don't think so, but I don't know for certain.

skwire:
Here, try this.  When you start up this version, a message box will popup asking if you want to enable the min/max/close tweak.  If you choose yes, they will be hidden upon each window's creation and they should appear whenever your mouse is in the titlebar area.  It's not perfect but it seems to work fairly well.  Also, this version leaves the tray icon in place so you can exit it.  All min/max/close buttons should be restored on exit.


--- Code: AutoIt ---/*Author:  Jody Holmes (Skwire)Date:    2009-08-23Contact: [email protected]  v0.0.0.3 - 2009-09-29    + Added optional showing/hiding of titlebar min/max/close buttons. v0.0.0.2 - 2009-08-28    * Hook now fires on two additional messages.        HSHELL_REDRAW        HSHELL_RUDEAPPACTIVATED v0.0.0.1 - 2009-08-23    + Initial build. */ ;#NoTrayIcon#Persistent#NoEnv#SingleInstance, ForceSetWorkingDir, %A_ScriptDir%DetectHiddenWindows, OffOnExit, Cleanup Menu, Tray, NoStandardMenu, Tray, Add, Exit, Cleanup Gui +LastFoundhWnd := WinExist() ; Hook the shell.; http://www.autohotkey.com/forum/viewtopic.php?p=123323#123323DllCall( "RegisterShellHookWindow", UInt, hWnd )MsgNum := DllCall( "RegisterWindowMessage", Str, "SHELLHOOK" )OnMessage( MsgNum, "ShellMessage" ) ; Create a blank cursor for use instead of a blank icon file.; http://www.autohotkey.com/forum/viewtopic.php?p=220113#220113VarSetCapacity( AndMask, 32*4, 0xFF ), VarSetCapacity( XorMask, 32*4, 0 )hIcon := DllCall( "CreateCursor", Uint, 0, Int, 0, Int, 0, Int, 32, Int, 32, Uint, &AndMask, Uint, &XorMask ) ; Initial loop to blank out existing windows.WinGet, s, ListLoop, % s{    s := s%A_Index%    ;SendMessage, 0x80, 0, hIcon, , % "ahk_id " . s} MsgBox, 36, TBarIconBlanker, Would you like to enable the min/max/close buttons tweak as well?IfMsgBox, Yes{    MinMaxCloseOption := 1    SetTimer, WatchCursor, 100} Return ; End of auto-execute section.  ; ------------------------------------------------------------------------; Subroutines ------------------------------------------------------------; ------------------------------------------------------------------------ Cleanup:{    If ( MinMaxCloseOption = 1 ) ; Restore titlebar buttons on close.    {        WinGet, s, List        Loop, % s        {            s := s%A_Index%            WinSet, Style, +0x80000, % "ahk_id " . s ; Restore min/max/close buttons.        }    }    ExitApp}Return  WatchCursor:{    MouseGetPos, , yPos, CurrID,    If ( yPos >= 0 and yPos < 22 )    {        WinSet, Style, +0x80000, % "ahk_id " . CurrID ; Restore min/max/close buttons.    }    Else    {        WinSet, Style, -0x80000, % "ahk_id " . PrevID ; Get rid of min/max/close buttons.        WinSet, Style, -0x80000, % "ahk_id " . CurrID ; Get rid of min/max/close buttons.    }}Return  ; ------------------------------------------------------------------------; Functions --------------------------------------------------------------; ------------------------------------------------------------------------ ; Shell hook to blank out windows that are subsequently created.ShellMessage( wParam, lParam ){    Global hIcon, MinMaxCloseOption, PrevID    If wParam in 1,6,32772    {        SendMessage, 0x80, 0, hIcon, , % "ahk_id " . lParam ; Blank out titlebar and taskbar icons.        If ( MinMaxCloseOption = 1 )        {            WinSet, Style, -0x80000, % "ahk_id " . lParam ; Get rid of min/max/close buttons.        }    }    PrevID := lParam}

tmpusr:
Thanks. This is great.  :Thmbsup: I'll be running this on all my systems forever. :D

If only one could have the same for the Explorer toolbar buttons, the start button, the tray. A universal auto-hide for buttons and other UI elements - the minimalist's dream.

Can you make it not restore the window icon along with the buttons when hovering? It sometimes shows them, sometimes doesn't. I'd like to have an INI option for the behavior.

Can you restore the icon in the toolbar when hovering, either on the button or in toolbar area?

Can you make it work when hovering on background windows?

Can you blank out the window borders - make them transparent - in a similar fashion? If not blank out, then fill with some solid color. It would be neat to have borderless windows that only appear when hovering.

Can you blank out the right side of the Explorer statusbar (which, I just noticed, in Explorer menu is "Status Bar" which seems inconsistent with the way "Taskbar" is written), the part that has the unnecessary My Computer/Internet or simply fill it with a solid rectangle and remove it when hovering? The user would have to match the color and perhaps the height to the visual style - unless there are system variables for those that you can use.

Can you use a system variable to find out the actual height of the titlebar instead of the fixed value, 22? I use a larger title bar and it ony shows when I'm at the top 22.

Can you remove the empty space occupied by the invisible icon in front of the taskbar buttons?

I'd prefer it to ask nothing upon startup and default to hide buttons and have no tray icon.

Bug: Right clicking taskbar button doesn't bring up the menu (though sometimes it does).

Bug: Buttons not removed on command line window.

Bug-like behavior (due to implementation, if I'm correct): it keeps blinking with TeraCopy and 7-Zip, that update the % done in the titlebar.

skwire:
This version checks the system for titlebar height so it should work better with your system.  It also attempts to keep the titlebar icon hidden when restoring the min/max/close buttons.  It also does away with the message box at the start and the tray icon.

As for your other requests, I really don't want to develop this app any further in all these other directions.  There are so many variables at play here and so many different system configurations that I simply have no desire to get knee-deep in trying to troubleshoot/fix/hack/whatever.  Feel free to study the code and take it further on your own.  There really isn't a whole lot of complex code in this script.  Here you go:


--- Code: AutoIt ---/*Author:  Jody Holmes (Skwire)Date:    2009-08-23Contact: [email protected]  v0.0.0.3 - 2009-09-29    + Added optional showing/hiding of titlebar min/max/close buttons. v0.0.0.2 - 2009-08-28    * Hook now fires on two additional messages.        HSHELL_REDRAW        HSHELL_RUDEAPPACTIVATED v0.0.0.1 - 2009-08-23    + Initial build. */ #NoTrayIcon#Persistent#NoEnv#SingleInstance, ForceSetWorkingDir, %A_ScriptDir%DetectHiddenWindows, OffOnExit, CleanupSysGet, TBarHeight, 4 Menu, Tray, NoStandardMenu, Tray, Add, Exit, Cleanup Gui +LastFoundhWnd := WinExist() ; Hook the shell.; http://www.autohotkey.com/forum/viewtopic.php?p=123323#123323DllCall( "RegisterShellHookWindow", UInt, hWnd )MsgNum := DllCall( "RegisterWindowMessage", Str, "SHELLHOOK" )OnMessage( MsgNum, "ShellMessage" ) ; Create a blank cursor for use instead of a blank icon file.; http://www.autohotkey.com/forum/viewtopic.php?p=220113#220113VarSetCapacity( AndMask, 32*4, 0xFF ), VarSetCapacity( XorMask, 32*4, 0 )hIcon := DllCall( "CreateCursor", Uint, 0, Int, 0, Int, 0, Int, 32, Int, 32, Uint, &AndMask, Uint, &XorMask ) ; Initial loop to blank out existing windows.WinGet, s, ListLoop, % s{    s := s%A_Index%    ;SendMessage, 0x80, 0, hIcon, , % "ahk_id " . s} ; MsgBox, 36, TBarIconBlanker, Would you like to enable the min/max/close buttons tweak as well?; IfMsgBox, Yes; {;     MinMaxCloseOption := 1;     SetTimer, WatchCursor, 100; }MinMaxCloseOption := 1SetTimer, WatchCursor, 100 Return ; End of auto-execute section.  ; ------------------------------------------------------------------------; Subroutines ------------------------------------------------------------; ------------------------------------------------------------------------ Cleanup:{    If ( MinMaxCloseOption = 1 ) ; Restore titlebar buttons on close.    {        WinGet, s, List        Loop, % s        {            s := s%A_Index%            WinSet, Style, +0x80000, % "ahk_id " . s ; Restore min/max/close buttons.        }    }    ExitApp}Return  WatchCursor:{    MouseGetPos, , yPos, CurrID,    If ( yPos >= 0 and yPos < ( TBarHeight + 3 ) )    {        WinSet, Style, +0x80000, % "ahk_id " . CurrID ; Restore min/max/close buttons.        SendMessage, 0x80, 0, hIcon, , % "ahk_id " . CurrID ; Blank out titlebar and taskbar icons.    }    Else    {        WinSet, Style, -0x80000, % "ahk_id " . PrevID ; Get rid of min/max/close buttons.        WinSet, Style, -0x80000, % "ahk_id " . CurrID ; Get rid of min/max/close buttons.        SendMessage, 0x80, 0, hIcon, , % "ahk_id " . CurrID ; Blank out titlebar and taskbar icons.    }}Return  ; ------------------------------------------------------------------------; Functions --------------------------------------------------------------; ------------------------------------------------------------------------ ; Shell hook to blank out windows that are subsequently created.ShellMessage( wParam, lParam ){    Global hIcon, MinMaxCloseOption, PrevID    If wParam in 1,6,32772    {        SendMessage, 0x80, 0, hIcon, , % "ahk_id " . lParam ; Blank out titlebar and taskbar icons.        If ( MinMaxCloseOption = 1 )        {            WinSet, Style, -0x80000, % "ahk_id " . lParam ; Get rid of min/max/close buttons.        }    }    PrevID := lParam}


tmpusr:
Thanks again.

Could you take a look at the changed taskbar button behavior: in many cases you need to click it twice until the window minimizes. And the right click menu is missing.

If you don't want to work on them, do you whether they are possible, like the overlaying of window borders with a solid color unless hovering there?

Without the buttons and icons the system looks much cleaner. I think this should be an option in Win 8 or Win 7 SP1, it's that good.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version