topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 9:51 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Auto-hide window borders when not hovering over/near them (SCREENSHOT)  (Read 7526 times)

tmpusr

  • Member
  • Joined in 2005
  • **
  • Posts: 154
  • Instantiation stuck in meatspace with no backup
    • View Profile
    • Donate to Member
To take a step toward the clean, minimalist look you see in the Microsoft 2019 video, hide window borders when not hovering the cursor over them (or near them, user adjustable option). Either by making them transparent, or if that's not possible, overlay with some user-selectable solid color (usually the desktop background color), like in this mockup:

http://img193.imageshack.us/img193/6012/autohidewindowborders.png
IDEA: Auto-hide window borders when not hovering over/near them (SCREENSHOT)


When hovering over or near the border, the color would be removed but could also be changed to transparent and tinted so that the borders "glow" or simply changed to some other solid color (width and position adjustable - if not using the border width system variable - so you could cover only parts of the border, for example leaving the outermost or innermost line visible). If you can actually remove them so that the windows would tile seamlessly, that would be an option, but just hiding them would be fine.

It certainly can be done as seen in this tiling window manager:

http://hashtwm.demonastery.org/

This http://www.autohotke.../commands/WinSet.htm would seem to do the job (though I'm not sure) and has even rounded corners which would be a bonus (user option, adjustable roundness).

https://www.donation....msg179289#msg179289 lets you blank out the window titlebar (and taskbar) icons and buttons when not hovering over the titlebar. It seems you'd only have to change a bit of code there to get this app done.

That app is needed for getting that ultra-minimalistic look. Perhaps it and this one could be combined.

The app could, optionally, also hide the window titlebar, and also the statusbar, and scrollbars, when not hovering near them. It would optionally actually remove the titlebar like in the tiling window manager, but when the cursor is near the titlebar area, it pops up.

A separate bonus snack:

To get rid of the last piece of visual clutter, I'd also like to have the My Computer/Internet icon removed from the Explorer statusbar. Simply filling that area with a solid color would be an acceptable solution. The user would have to match the color and perhaps the height to the visual style - unless there are system variables for those.


Also see http://homepage1.nif...kazubon/tclocklight/ for getting rid of the visual junk in the taskbar.
« Last Edit: September 30, 2009, 10:35 AM by tmpusr »

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Code: AutoIt [Select]
  1. F1:: ; Remove caption and sizing border from the active window.
  2. {
  3.     WinSet, Style, -0xC00000, A    
  4.     WinSet, Style, -0x40000, A    
  5. }
  6.  
  7. F2:: ; Return active window to normal.
  8. {
  9.     WinSet, Style, +0xC00000, A    
  10.     WinSet, Style, +0x40000, A
  11. }

tmpusr

  • Member
  • Joined in 2005
  • **
  • Posts: 154
  • Instantiation stuck in meatspace with no backup
    • View Profile
    • Donate to Member
Thanks. I pasted the titlebar hiding line into the other app, and instead of just hiding the buttons, now the whole titlebar vanishes, which is fine, but it screws up the taskbar and desktop when near their top so they should be excluded (you can actually see the caption of the desktop 'Program Manager').

The border removal needs code that restores them when you're near them. And it doesn't always achieve the visual goal completely because it leaves vertical and horizontal lines e.g. in Explorer and Notepad. It would need to remove a few more pixels inside, 2 more to be precise. The solid color rectangle would be a solution, which of course requires using a solid desktop color to give the correct visual impression, but that's how I'm willing to operate.
« Last Edit: September 30, 2009, 01:07 PM by tmpusr »

tmpusr

  • Member
  • Joined in 2005
  • **
  • Posts: 154
  • Instantiation stuck in meatspace with no backup
    • View Profile
    • Donate to Member
I don't really know what I'm doing, and there are problems, but this is semi-usable. I just added the lines here and tweaked the titlebar activation area. The taskbar, desktop, and menus should be excluded and the logic of the auto-hide could be better. It should work as you expect it to; when you go near the top the titlebar should pop up but the window shouldn't move.

Code: AutoIt [Select]
  1. /*
  2. Author:  Jody Holmes (Skwire)
  3. Date:    2009-08-23
  4. Contact: skwire@skwire.net
  5.  
  6.  
  7. v0.0.0.3 - 2009-09-29
  8.     + Added optional showing/hiding of titlebar min/max/close buttons.
  9.  
  10. v0.0.0.2 - 2009-08-28
  11.     * Hook now fires on two additional messages.
  12.         HSHELL_REDRAW
  13.         HSHELL_RUDEAPPACTIVATED
  14.  
  15. v0.0.0.1 - 2009-08-23
  16.     + Initial build.
  17.  
  18. */
  19.  
  20. #NoTrayIcon
  21. #Persistent
  22. #NoEnv
  23. #SingleInstance, Force
  24. SetWorkingDir, %A_ScriptDir%
  25. DetectHiddenWindows, Off
  26. OnExit, Cleanup
  27. SysGet, TBarHeight, 4
  28.  
  29. Menu, Tray, NoStandard
  30. Menu, Tray, Add, Exit, Cleanup
  31.  
  32. Gui +LastFound
  33. hWnd := WinExist()
  34.  
  35. ; Hook the shell.
  36. ; http://www.autohotkey.com/forum/viewtopic.php?p=123323#123323
  37. DllCall( "RegisterShellHookWindow", UInt, hWnd )
  38. MsgNum := DllCall( "RegisterWindowMessage", Str, "SHELLHOOK" )
  39. OnMessage( MsgNum, "ShellMessage" )
  40.  
  41. ; Create a blank cursor for use instead of a blank icon file.
  42. ; http://www.autohotkey.com/forum/viewtopic.php?p=220113#220113
  43. VarSetCapacity( AndMask, 32*4, 0xFF ), VarSetCapacity( XorMask, 32*4, 0 )
  44. hIcon := DllCall( "CreateCursor", Uint, 0, Int, 0, Int, 0, Int, 32, Int, 32, Uint, &AndMask, Uint, &XorMask )
  45.  
  46. ; Initial loop to blank out existing windows.
  47. WinGet, s, List
  48. Loop, % s
  49. {
  50.     s := s%A_Index%
  51.     ;SendMessage, 0x80, 0, hIcon, , % "ahk_id " . s
  52. }
  53.  
  54. ; MsgBox, 36, TBarIconBlanker, Would you like to enable the min/max/close buttons tweak as well?
  55. ; IfMsgBox, Yes
  56. ; {
  57. ;     MinMaxCloseOption := 1
  58. ;     SetTimer, WatchCursor, 100
  59. ; }
  60. MinMaxCloseOption := 1
  61. SetTimer, WatchCursor, 100
  62.  
  63. Return ; End of auto-execute section.
  64.  
  65.  
  66. ; ------------------------------------------------------------------------
  67. ; Subroutines ------------------------------------------------------------
  68. ; ------------------------------------------------------------------------
  69.  
  70. Cleanup:
  71. {
  72.     If ( MinMaxCloseOption = 1 ) ; Restore titlebar buttons on close.
  73.     {
  74.         WinGet, s, List
  75.         Loop, % s
  76.         {
  77.             s := s%A_Index%
  78.             WinSet, Style, +0x80000, % "ahk_id " . s ; Restore min/max/close buttons.
  79.         }
  80.     }
  81.     ExitApp
  82. }
  83.  
  84.  
  85. WatchCursor:
  86. {
  87.     MouseGetPos, , yPos, CurrID,
  88.     If ( yPos >= -36 and yPos < 86 )
  89.  
  90.     {
  91.         WinSet, Style, +0x80000, % "ahk_id " . CurrID ; Restore min/max/close buttons.
  92.         SendMessage, 0x80, 0, hIcon, , % "ahk_id " . CurrID ; Blank out titlebar and taskbar icons.
  93.         WinSet, Style, +0xC00000, % "ahk_id " . CurrID ; titlebar
  94.         WinSet, Style, +0x40000, % "ahk_id " . CurrID ; borders
  95.     }
  96.     Else
  97.     {
  98.         WinSet, Style, -0x80000, % "ahk_id " . PrevID ; Get rid of min/max/close buttons.
  99.         WinSet, Style, -0x80000, % "ahk_id " . CurrID ; Get rid of min/max/close buttons.
  100.         SendMessage, 0x80, 0, hIcon, , % "ahk_id " . CurrID ; Blank out titlebar and taskbar icons.
  101.         WinSet, Style, -0xC00000, % "ahk_id " . PrevID ; titlebar
  102.         WinSet, Style, -0xC00000, % "ahk_id " . CurrID ; titlebar
  103.         WinSet, Style, -0x40000, % "ahk_id " . PrevID ; borders
  104.         WinSet, Style, -0x40000, % "ahk_id " . CurrID ; borders
  105.     }
  106. }
  107.  
  108.  
  109. ; ------------------------------------------------------------------------
  110. ; Functions --------------------------------------------------------------
  111. ; ------------------------------------------------------------------------
  112.  
  113. ; Shell hook to blank out windows that are subsequently created.
  114. ShellMessage( wParam, lParam )
  115. {
  116.     Global hIcon, MinMaxCloseOption, PrevID
  117.     If wParam in 1,6,32772
  118.     {
  119.         SendMessage, 0x80, 0, hIcon, , % "ahk_id " . lParam ; Blank out titlebar and taskbar icons.
  120.         If ( MinMaxCloseOption = 1 )
  121.         {
  122.             WinSet, Style, -0x80000, % "ahk_id " . lParam ; Get rid of min/max/close buttons.
  123.         }
  124.     }
  125.     PrevID := lParam
  126. }
« Last Edit: September 30, 2009, 02:16 PM by tmpusr »