BlackScreen does not hide/cover taskbar

Ask gaming related questions (AHK v1.1 and older)
rhazor
Posts: 5
Joined: 26 Feb 2018, 05:40

BlackScreen does not hide/cover taskbar

Post by rhazor » 16 Aug 2022, 11:11

I use a simple script to hide desktop when launching windowed games (like old ones with lower resolution) and I prefer black background

Code: Select all

; black background
F11::
Gui, Color, 000000
Gui, -Caption +ToolWindow
Gui, Show, W%A_ScreenWidth% H%A_ScreenHeight%, BlackScreen
Return
It covers the desktop in black, but not the taskbar. Any ideas?

Also on a side, any ideas how to cover all screen AND run below/under active window game screen, because I have to Alt+Tab each time after I press F11?

Cheers

rhazor
Posts: 5
Joined: 26 Feb 2018, 05:40

Re: BlackScreen does not hide/cover taskbar

Post by rhazor » 16 Aug 2022, 12:23

This shows/hides taskbar on toggle

Code: Select all

F12::
if WinExist("ahk_class Shell_TrayWnd") 
	{
	WinHide, ahk_class Shell_TrayWnd
	WinHide, ahk_class Shell_SecondaryTrayWnd
	}
Else
	{
	WinShow, ahk_class Shell_TrayWnd
	WinShow, ahk_class Shell_SecondaryTrayWnd
	}
Return
Now to figure out how to merge both these scripts into one button and make them both work on toggle.

rhazor
Posts: 5
Joined: 26 Feb 2018, 05:40

Re: BlackScreen does not hide/cover taskbar

Post by rhazor » 16 Aug 2022, 12:38

Actually it hides all the taskbars on all monitors/screens. Would be nice if it hid only the active one, the one that has the game window on.

Rohwedder
Posts: 7655
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: BlackScreen does not hide/cover taskbar

Post by Rohwedder » 18 Aug 2022, 09:33

Hallo,
try:

Code: Select all

F11:: ; black_background on main monitor on/off
IF black_background := !black_background
{
	Gui, New, -Caption +ToolWindow -DPIScale +LastFound +HwndBlack
	Gui, Color, 000000
	Gui, Show, X0 Y0 W%A_ScreenWidth% H%A_ScreenHeight% NoActivate
	WinSet, Bottom
	WinHide, ahk_class Shell_TrayWnd
}
Else
{
	Gui %Black%:Destroy
	WinShow, ahk_class Shell_TrayWnd
}
Return

rhazor
Posts: 5
Joined: 26 Feb 2018, 05:40

Re: BlackScreen does not hide/cover taskbar

Post by rhazor » 24 Aug 2022, 14:35

That works, thanks.

Post Reply

Return to “Gaming Help (v1)”