Hide Taskbar + Start Netflix + Always on top

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
homezonebenny
Posts: 20
Joined: 23 Apr 2016, 08:36

Hide Taskbar + Start Netflix + Always on top

17 Jan 2017, 21:24

Hi,
at the moment I use this script:

Code: Select all

#o::
Winset, Alwaysontop, , A
return
To make a windows "always on top".
I like to use my Windows Taskbar. I always have it visible.
But when I want to play a game in Fullscreen (Windowed) mode + watch netflix (in a small window, down left corner) I make the Taskbar fade out.
I right click the Taskbar -> Settings: "Automatically Fade Out" (don't know the option name in english, but something like that).

When the Taskbar is fade out, I start Netflix (Windows 10 app).
Then I press WindowsKey + O (on top). And Netflix is always on top, above my game.

This is a pretty "long" step.
So I was wondering if there is a possibility to change that via a single button script.

1. Step:
Enable the "automatically hide Taskbar" Windows 10 setting.

2. Step:
Open Netflix Windows 10 App

3. Step:
Use the Alwaysontop script

It's important that it is exactly that order. Because I positioned the Netflix App exactly on bottom left side of the monitor.
When I start Netflix App before I fade out the Taskbar, the App is above the Taskbar.
And after I faded it out, I have to re-position the Netflix Window :-\
But maybe there's a script too, to position it exactly down left side. Somthing like:
Bottom: 0
Left: 0
or something like that. Because the Netflix Windows 10 App have a small border around the player, I position it -1 left, and -1 bottom.
So I only see the top / right border by a bit.
I totally try to not start Netflix before I faded out my Taskbar.

After I closed the Netflix App, I enable my Windows Taskbar again (always visible).
Maybe I can make the script like:
Windows Key N = Fade out Windows Taskbar, Open Netflix, position it bottom: -1, left: -1 and make it always on top.
When I press: Windows Key N again, it detects that Netflix App is already open, and it close the App, and enable the Windows Taskbar again.

I'm not that deep into AutoHotkey yet. But maybe anybody is and can make a script like that, but only if that don't take to much time for sure.
I'll look at the script and learn from it :)
If it would take a lot of work / time, just gimme some good documentations to functions or something, which could help me write that script.


Thanks for reading, was a long text :)
enter8
Posts: 102
Joined: 05 May 2016, 16:48

Re: Hide Taskbar + Start Netflix + Always on top

17 Jan 2017, 22:56

homezonebenny wrote: 1. Step:
Enable the "automatically hide Taskbar" Windows 10 setting.
While there are third party apps for adding hotkey support to the taskbar, if I were doing it, I'd use the registry.

https://www.tenforums.com/tutorials/238 ... -10-a.html

I'm more comfortable working with .reg files, but this could also probably fit the bill:

https://autohotkey.com/docs/commands/RegWrite.htm

CAUTION: If you don't know what you're doing, you can really mess up your computer with the registry.

That's how I'd do it.
ManualColdLock
Posts: 175
Joined: 15 Dec 2016, 04:27

Re: Hide Taskbar + Start Netflix + Always on top

18 Jan 2017, 00:21

Try tackling this in steps.

#1 Fade out Windows Taskbar
Try using Mouseclick and sleep
https://autohotkey.com/docs/commands/MouseClick.htm
you can have AHK click on the taskbar settings for you
just use sleep in between the clicks sleep,100 is probably good


#2 open netflix
Run Command

#3 move netflix
winwait till netflix exists
winmove to position and size it
https://autohotkey.com/docs/commands/WinMove.htm

#4 always on top
Win activate and then winset
homezonebenny
Posts: 20
Joined: 23 Apr 2016, 08:36

Re: Hide Taskbar + Start Netflix + Always on top

19 Jan 2017, 17:54

@enter8:
Registry would mean, it's permanent. That's not what I'm searching for.
And registry means that I would need to restart, that it's activated?! O.o

@ManualColdLock:
Ok I'll have a look into that.
Even when the Mouseclick thing seems a bit strange.
Let's find out if there is a Windows Hotkey to control the taskbar fade out thing, because IF there is one AHK could just press it for me though.
I did a quick search, seems only working with a 3rd part tool, which I want try to avoid.
qwerty12
Posts: 468
Joined: 04 Mar 2016, 04:33
Contact:

Re: Hide Taskbar + Start Netflix + Always on top

19 Jan 2017, 22:27

I don't have a Netflix account, so I have no idea if the title changes when signed in. You'll also need to fix the WinMove coordinates.

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#n::
{
	ToggleAutoHideTaskBar()
	if (!(nfhWnd := WinExist("Netflix ahk_class ApplicationFrameWindow"))) {
		RunWait netflix://,, UseErrorLevel
		if (!ErrorLevel) { ; 0 means success
			WinWait Netflix ahk_class ApplicationFrameWindow,, 3
			if (!ErrorLevel) {
				Winset, Alwaysontop, , A
				WinMove, -4, 185
			}
		}
	} else {
		WinClose ahk_id %nfhWnd%
	}
}

ToggleAutoHideTaskBar()
{
   ;TurtleOfDoom: http://www.autohotkey.com/board/topic/25932-trying-to-toggle-autohide-taskbar-with-keystroke-in-vista/?p=327990
   static ABDsize := A_PtrSize == 8 ? 48 : 36
   VarSetCapacity( APPBARDATA, ABDsize)
   NumPut(ABDsize, APPBARDATA, 0, "UInt")
   bits := DllCall("Shell32.dll\SHAppBarMessage"
             ,"UInt", 4
             ,"Ptr", &APPBARDATA )
  NumPut( (bits ^ 0x1), APPBARDATA, ABDsize - A_PtrSize, "UInt" )
  DllCall("Shell32.dll\SHAppBarMessage"
             ,"UInt", 0xA
             ,"Ptr", &APPBARDATA )
}
homezonebenny
Posts: 20
Joined: 23 Apr 2016, 08:36

Re: Hide Taskbar + Start Netflix + Always on top

21 Jan 2017, 20:38

@qwerty12:
Thanks a lot!
Got it to work this way:

Code: Select all

#n::
{
  ToggleAutoHideTaskBar()
  if (!(nfhWnd := WinExist("Netflix ahk_class ApplicationFrameWindow"))) {
    RunWait netflix://,, UseErrorLevel
    if (!ErrorLevel) { ; 0 means success
      WinWait Netflix ahk_class ApplicationFrameWindow,, 3
      if (!ErrorLevel) {
        Winset, Alwaysontop, , A
        WinMove, -8, 705
      }
    }
  } else {
    WinClose ahk_id %nfhWnd%
  }
}

ToggleAutoHideTaskBar()
{
  ;TurtleOfDoom: http://www.autohotkey.com/board/topic/25932-trying-to-toggle-autohide-taskbar-with-keystroke-in-vista/?p=327990
  static ABDsize := A_PtrSize == 8 ? 48 : 36
  VarSetCapacity(APPBARDATA, ABDsize)
  NumPut(ABDsize, APPBARDATA, 0, "UInt")
  bits := DllCall("Shell32.dll\SHAppBarMessage"
    ,"UInt", 4
    ,"Ptr", &APPBARDATA)
  NumPut((bits ^ 0x1), APPBARDATA, ABDsize - A_PtrSize, "UInt")
  DllCall("Shell32.dll\SHAppBarMessage"
    ,"UInt", 0xA
    ,"Ptr", &APPBARDATA)
}
The screen size of the Netflix Window is:
611x376
So with:
WinMove, -8, 705
I get it perfectly down left side (in the corner where the windows logo is).

But now I have a short question:
- Isn't there a better way to position the window?!

I used photoshop to count the pixel rows, to get the Netflix Window perfectly down left side.
Something like:
WinMove, left:0, bottom:0
would be great. Like you know it from CSS (Cascading Style Sheet).

Because with the actual "WinMove, -8, 705" the Window Size needs to be the same, all the time.
IF the Window size is changed, and just by 1px, it will not be positioned well.

I tried:

Code: Select all

WinMove, -8, 705, 611, 376
But since I added the window size, it's not working anymore.
It always position the Netflix Window above the taskbar (even when the Taskbar is hidden, Netflix is on the position like the Taskbar would still be visible).
Even when I use it like:

Code: Select all

WinMove, -8, 1000, 611, 376
Value: 1000 it's not changing anything. It's still on the position right above the hidden taskbar.
Without the Window size, it's working. Perfectly left:-1, bottom:-1 position.
-1 because the Netflix Window border is 1px.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Chunjee, Google [Bot], Kintaro-OEx, Rohwedder and 182 guests