Boss Key to Windows' Taskbar.

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Partogi
New Cone
New Cone
Posts: 5
Joined: 24 Oct 2013 19:23

Boss Key to Windows' Taskbar.

Postby Partogi » 24 Oct 2013 19:26

How to make Boss Key to minimize VLC to taskbar rather than system tray?

Thanks in advance.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Boss Key to Windows' Taskbar.

Postby Jean-Baptiste Kempf » 05 Nov 2013 21:31

You cannot.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

JSLover
Cone that earned his stripes
Cone that earned his stripes
Posts: 116
Joined: 20 Mar 2012 00:08
VLC version: 2.1.5
Operating System: Win7
Location: r.secsrv.net/youtube.lua

Re: Boss Key to Windows's Taskbar.

Postby JSLover » 06 Nov 2013 07:19

You cannot.
...well, no, in VLC, maybe you cannot...but with AutoHotkey, you can...

To get this behavior, unset the Boss Key from VLC's Prefs (perhaps not really necessary, but no need to have VLC hooking the key too).

Now, lets assume your Boss Key was F9 (if not, tell me what you want & I'll post another script {or you can look up the syntax})...
  • Code: Select all

    SetTitleMatchMode, 2 F9::WinMinimize, VLC media player
...that's it! 2 lines of code!...to do something that "You cannot." in VLC.

You need to download & install AutoHotkey, then copy/paste that script above, into a file (use Notepad2), call it anything, but for example call it VLC-Hotkeys.ahk or VLC-Boss-Key.ahk...you do need the .ahk on the end (make sure it don't end up as .ahk.txt).

After you save it, you need to run it, if you're using Notepad2, you can press Ctrl+L, to "Launch" it. Otherwise, simply browse to where you saved it & double-click on it. Now, once it's running, there will be a new systray icon (but otherwise it will appear as if nothing happened when you double clicked on it/ran the script), press F9 & VLC should minimize! You will wanna put that script in the Startup folder, so you don't have to remember to re-run it every time you restart your computer.
"why the f*** do i need a google+ account to comment on a video?" — jawed (2013) (about YouTube's new requirement of Google+)

youtube.lua — Play YouTube videos in VLC!
Updated: Thu, Jan 15, 2015 --- 1/15/15, 7:19:19pm EST

forum.videolan.org/viewtopic.php?f=29&t=111977&p=379147#p379147
Sigh, the above can't be a link: "You cannot use certain BBCodes: [url]."...so, I can't even link back to a post on this forum?
How about this: can long-term/trusted users be allowed links in sigs?

Partogi
New Cone
New Cone
Posts: 5
Joined: 24 Oct 2013 19:23

Re: Boss Key to Windows' Taskbar.

Postby Partogi » 30 Nov 2013 18:10

Nice, thank you.

I changed "F9" with "," but how do I make it to also pause the VLC? It's also better for this hotkey to start every time I execute VLC and only applied when VLC window is active because I can't type "," whenever this hotkey is active (had to suspend the script).

JSLover
Cone that earned his stripes
Cone that earned his stripes
Posts: 116
Joined: 20 Mar 2012 00:08
VLC version: 2.1.5
Operating System: Win7
Location: r.secsrv.net/youtube.lua

Re: Boss Key to Windows' Taskbar.

Postby JSLover » 01 Dec 2013 04:19

...but how do I make it to also pause the VLC?
...that's easy (well, sorta), but wasn't part of the original request...before you just said "minimize VLC".
It's also better for this hotkey to start every time I execute VLC...
...this part is a little hard. I do know of a way to do it (maybe a couple ways), but it's a little overkill for this. It's easier to manually run the Hotkey script whenever you need it, or set it to start with Windows & leave it running.
...and only applied when VLC window is active...
...this part's easy & I even thought about writing it that way, but I thought since it was a "Boss Key" you wouldn't wanna push it & have it "not work" cuz VLC wasn't active. If VLC being active is an OK requirement, that's fine & easy to code.

New code...
  • Code: Select all

    #SingleInstance force SetTitleMatchMode, 2 #IfWinActive VLC media player F9:: Send, {Space} WinMinimize return #IfWinActive
...for consistency in my posts, I left the Hotkey on F9, but of course you can change it to comma again.

Also, lemme explain the code a little (or a lot!), when you press the Hotkey, it sends a Space bar press to the active window (which is VLC, due to the Hotkey only triggering when VLC's active). In VLC, pressing Space will Play/Pause, so essentially, it "Pauses" VLC (but if VLC is not playing it will start playing). Unfortunately, last I tried to look, VLC doesn't seem to have any WinAPI SendMessage/PostMessage API/interface...yes, it does have libVLC & http & telnet (& every OTHER type of interface), but I can't find a simple "windows message" to send to VLC for Pause (or anything else), like VLC_PAUSE or something...if I could, I'd replace the Send with a SendMessage & send a Pause-only message to VLC.

However, you can overcome this: set a "Pause-only" Hotkey in VLC's prefs, then change the script to send that key instead of Space. For example, if you set your Pause-only Hotkey to period (.), then you'd change the code to "Send, ." instead of "Send, {Space}". But, if you only ever use the Boss Key with VLC playing & active, you won't have a problem, since in that case, Space will always Pause.

I may have over-explained that, but I just wanted you to be aware that if VLC is active & not playing, pressing the Boss Key would start playing (due to the nature of pressing Space) & then minimize VLC. I know that's undesirable behavior, but I can't detect VLC's playing/stopped state (except perhaps the presence/absence of a song title in the titlebar?), nor can I send a "Pause-only" command (cuz I can't find a "message" for it), without you making a pref change.
"why the f*** do i need a google+ account to comment on a video?" — jawed (2013) (about YouTube's new requirement of Google+)

youtube.lua — Play YouTube videos in VLC!
Updated: Thu, Jan 15, 2015 --- 1/15/15, 7:19:19pm EST

forum.videolan.org/viewtopic.php?f=29&t=111977&p=379147#p379147
Sigh, the above can't be a link: "You cannot use certain BBCodes: [url]."...so, I can't even link back to a post on this forum?
How about this: can long-term/trusted users be allowed links in sigs?

Partogi
New Cone
New Cone
Posts: 5
Joined: 24 Oct 2013 19:23

Re: Boss Key to Windows' Taskbar.

Postby Partogi » 01 Dec 2013 12:57

Hey, thanks.

This is my code:

Code: Select all

#SingleInstance force SetTitleMatchMode, 2 #IfWinActive VLC media player ,:: Send, {,} WinMinimize return #IfWinActive
Now it will minimize VLC and won't start playing the video if VLC is paused.

One more thing though. I want this AHK to automatically start when I execute VLC and will automatically closed when I close VLC. Sorry for becoming too greedy. :D

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: Boss Key to Windows' Taskbar.

Postby mederi » 01 Dec 2013 15:59

I haven't tried AutoHotkey yet. It can compile .ahk script into a single .exe file, can't it? https://forum.videolan.org/viewtopic.ph ... 39#p391639


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 3 guests