An script that autohide the taskbar (win7) when you're in a program like (potplayer)?
An script that autohide the taskbar (win7) when you're in a program like (potplayer)?
I need an script that autohide the taskbar (win7) when you're in a program like (potplayer), but disable auto-hiding when you're not using potplayer.
Re: An script that autohide the taskbar (win7) when you're in a program like (potplayer)?
Try this:
I hope that helps.
Code: Select all
WinHide, ahk_class Shell_TrayWnd
; do stuff
MsgBox
WinShow, ahk_class Shell_TrayWnd
Re: An script that autohide the taskbar (win7) when you're in a program like (potplayer)?
In Win7 I need to hide the button too, check exact classNN with winspy.
Re: An script that autohide the taskbar (win7) when you're in a program like (potplayer)?
Btw, too auto hide you can have a timer that has an ifwinactive, if you don't want to use a hotkey.
Re: An script that autohide the taskbar (win7) when you're in a program like (potplayer)?
And how to do it in one file?
Code: Select all
If Unhide the taskbar <- ???
WinHide, ahk_class Shell_TrayWnd
Else
WinShow, ahk_class Shell_TrayWnd
Re: An script that autohide the taskbar (win7) when you're in a program like (potplayer)?
Can this be done with Else?
Re: An script that autohide the taskbar (win7) when you're in a program like (potplayer)?
This will hide the taskbar within a second after a program of your choise is activated.
Code: Select all
timeBetweenChecks:=1000 ; Check every 1000 ms.
hideWhenThisProgramIsActive:="notepad++.exe" ; Change to your program.
SetTimer,autoHide,%timeBetweenChecks%
OnExit, showWhenExitApp
Esc::ExitApp ; Escape exit program at any time, and unhides the tray window.
autoHide:
IfWinActive ahk_exe %hideWhenThisProgramIsActive%
WinHide, ahk_class Shell_TrayWnd
else
WinShow, ahk_class Shell_TrayWnd
return
showWhenExitApp:
WinShow, ahk_class Shell_TrayWnd
ExitApp
return
Re: An script that autohide the taskbar (win7) when you're in a program like (potplayer)?
This saves resources:
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.
#SingleInstance, Force
SetBatchLines, -1
CoordMode, ToolTip, Screen
DetectHiddenWindows, on
DetectHiddenText, on
wParam := lParam := tPar := fPar := ""
Gui +LastFound
DllCall("RegisterShellHookWindow", UInt, WinExist())
OnMessage(DllCall("RegisterWindowMessage", Str, "SHELLHOOK"), "OnShellMessage")
OnShellMessage(wParam, lParam, tPar, fPar) {
if wParam||lParam||tPar||fPar {
sleep, 100
IfWinActive, ahk_class Notepad ; =======----------> change WinTitel or class to suits you
WinHide, ahk_class Shell_TrayWnd
else
WinShow, ahk_class Shell_TrayWnd
}
wParam := lParam := tPar := fPar := ""
}
Re: An script that autohide the taskbar (win7) when you're in a program like (potplayer)?
Nice! I'm gonna save that for future use. (Just needs WinShow on exit.)rommmcek wrote:This saves resources:
Re: An script that autohide the taskbar (win7) when you're in a program like (potplayer)?
Both work, but which is better?
A new problem.
I exchanged it:
WinHide, ahk_class Shell_TrayWnd
on:
run "D: \ _ PROGRAMS \ Hide Folders \ (off) .exe"
and include:
WinShow, ahk_class Shell_TrayWnd
on:
run "D: \ _ PROGRAMS \ Hide Folders \ (on) .exe", ahk_class
Now the cursor is blinking at 1 second and shows that it is busy.
One could do something about it?
A new problem.
I exchanged it:
WinHide, ahk_class Shell_TrayWnd
on:
run "D: \ _ PROGRAMS \ Hide Folders \ (off) .exe"
and include:
WinShow, ahk_class Shell_TrayWnd
on:
run "D: \ _ PROGRAMS \ Hide Folders \ (on) .exe", ahk_class
Now the cursor is blinking at 1 second and shows that it is busy.
One could do something about it?
Code: Select all
timeBetweenChecks:=1000
ProgramActive:="AkelPad.exe"
SetTimer,auto,%timeBetweenChecks%
OnExit, hide(on)
Esc::ExitApp
auto:
IfWinActive ahk_exe %ProgramActive%
; WinHide, ahk_class Shell_TrayWnd
run, "D:\_PROGRAMS\Hide Folders\(off).exe"
else
; WinShow, ahk_class Shell_TrayWnd
run, "D:\_PROGRAMS\Hide Folders\(on).exe"
return
hide(on):
{
; WinShow, ahk_class Shell_TrayWnd
run, "D:\_PROGRAMY\Hide Folders\(on).exe", ahk_class
ExitApp
}
return