From about two months I’m a happy owner of Asus G73SW. In this model with four media keys, which in fact are keyboard shortcuts, you can control multimedia apps. However, with standard software shipped with notebook you are able to control just two of them: Roxio Cineplayer and Windows Media Player. Unfortunately, there’s no support for other multimedia applications. As I don’t use none of these I wanted to make multimedia keys work with foobar2000. In effect I’ve developed a small application, which allows you control foobar with Asus multimedia keyboard shortcuts. I’ve tested it only with Asus G73SW, ATKHotkey 1.0.58.5 and foobar2000 1.1.5. On my machine it works just fine, and I think there’s a chance to make it work with other Asus notebook models (feel free to add a comment if this solution worked for you).
Download link: [ATKMediaInterceptor]
Source: [ATKMediaInterceptor source]
To make it work (or better say, to try make it work) perform following steps:
1. Download application from the first link given above.
2. Open task manager, find process named DMedia.exe and terminate it.
3. Unpack zip file, and copy files to ATK Media installation folder. For example, on my machine it’s C:\Program Files (x86)\ASUS\ATK Package\ATK Media
. You have to copy both files there and overwrite existing executable named DMedia.exe
. Better solution is to change old executable name (to DMedia.exe.old
for example) and keep it in case you will want back to it someday.
4. Now you just need to restart your machine.
If everything went as should, from now you should be able to control foobar with your media shortcuts:
Fn + Down arrow – Play/Pause
Fn + Up arrow – Stop
Fn + Left arrow – Previous track
Fn + Right arrow – Next track
Each of them also launch player if it wasn’t started yet.
Configuration file icpt.conf
keeps two configuration options. First is window class name used by WinAPI FindWindow
function to find foobar2000 window, second is path to application that will be executed in case the player window wasn’t found.
Hey, tried this on my Asus X5QSF (same as N5SF) and this is exactly the solution I was looking for! Works like a charm :D
Thanks for the great work, I’ll recommend it to others!
I’m glad I could help :)
Cheers!
what win api code should i put inside if i want play pause next and previous controls to be global, like in winamp, aimp, media player and all that? :P
or just AIMP for begining
In the current version there’s no way to make it work globally. But if you want to control any other media app (e.g. AIMP) you need to replace the window_class option in the conf file. You can get the window class name using an appropriate tool – I can recommend Window Detective.
How about using SendInput function from Winuser.h?
Would do it myself, but I don’t have much experience with Windows API (especially as low level for me as in C ;) ).
Information about SendInput found here: http://stackoverflow.com/questions/2969115/how-to-simulate-multimedia-key-press-in-c.
@SHA da Vinci: Thanks for the hint. Yes, in some cases SednInput would be better (if not only) choice, but it’s a bit more complicated. I don’t see a reason for using this in such a simple app, but I’m not a WinAPI ninja though :)
Hey, got it working for Winamp as well! Very nice, thanks again for the instructions :D
Found with Window Detective what the windowclass should be, now works great!
For others who want to let it work with WInamp, this is what my icpt.conf looks like now:
window_class=BaseWindow_RootWnd
application_path=C:\Program Files (x86)\Winamp\winamp.exe
Hey, that’s cool! Thanks for the feedback :)
It’s great, thanks! Works flawlessly on my K52J.
Thanks you so much, works like a charm on my K53E!
By the way – what IDE/compiler do you use?
Already tried good ol’ Dev-C++ but when including winuser.h (necessary for sendinput function) header it doesn’t work (compiler finds some errors in winuser header – if it’s possible). Would porting this code to VS C++ project be hard?
I use both – cl from Visual Studio and gcc. The linked app was compiled with gcc 4.5.2 (so the only dll dependency is msvcrt.dll). The code is pretty ugly, but no changes are required to compile this in VS, just checked :) Although you may need to change some project options.
I did what Rene asked to. But the hotkeys only called up Winamp and not do anything
Hi I solved the problem. You have to enable everything in Winamp’s global hotkeys.
Works for me also! N53SN Thanks Dude!
Thanks so much, working like a charm!
That’s how it works with MusicBee: window_class=WindowsForms10.Window.8.app.0.378734a
application_path=C:\Program Files (x86)\MusicBee\MusicBee.exe
Finally Fn keys work properly. Thanks, dude, great work!
Nice! works great with my Asus G50VT-X1 and Winamp, thank you so much! and thanks to René for the information about the modification.
Works for Spotify too! (Replace USERNAME with your Windows-username)
window_class=SpotifyMainWindow
application_path=C:\Users\USERNAME\AppData\Roaming\Spotify\spotify.exe
Great, thanks! Got it to work with Spotify
Sadly, but haven’t worked for me. Now It’s only opens foobar. Doesn’t play/pause, stop or anything.
Is there any chance you will fix that?
I run ASUS ROG G53SX-IX154V and foobar 1.1.11.
1) run Spy++ (can be found in Internet)
2) get Foobar window class id (in my case: {97E27FAA-C0B3-4b8e-A693-ED7881E99FC1} )
3) put Id in icpt.conf (next to DMedia.exe above) and save.
For those, who have problems with controlling foobar. If you have done all above and foobar2000 doesn`t obey you, do next:
1) run Spy++ (can be found in Internet)
2) get Foobar window class id (in my case: {97E27FAA-C0B3-4b8e-A693-ED7881E99FC1} )
3) put Id in icpt.conf (next to DMedia.exe above) and save.
Now foobar will abey you :)
god bless you!!!
it works!!!
thanks, it works with my Asus K53SJ
Thanks!!!! Works in Asus N61JV-X2 with Footbar2000!!!!!!!!!!!
Hi, for me it works with foobar but i have a little problem : the others hotkey like light/ desactivate keyboard etc… don’t work. How to proceed? thanks
It works great with the ASUS G75VW-RS72 and foobar2000 v1.1.14a! All I had to do was get the new class ID using UISpy, which you can download here:
http://andrewtokeley.net/archive/2009/09/15/uispy-ndash-download-it-here.aspx
I managed to make Winamp works by editing the „icpt.conf” file with this content:
window_class=Winamp v1.x
application_path=C:\Program Files (x86)\Winamp\winamp.exe
This worked great for me on my N55SL. However, since I didn’t need the ability to start a program (Win + 4, Win +5 for the pinned MPC-HC and foobar2000 shortcuts work fine) and I’d rather that the media keys work for all programs, I butchered your wonderful program: https://gist.github.com/4105624
I compiled using MinGW: gcc -mwindows -Wall -march=native -O2 -s ATKMediaInterceptor.c -o DMedia.exe
Thank you!
Seems like I wasn’t the first :)
https://bitbucket.org/3mpty/atkmediainterceptor/src
had to tweak the windowclass, but it works perfectly! :)
thanks!
Used this 6 months ago on my Asus N55SL;
came here to say THANKS!
Thank you! You really saved my day here >.>
I still have one problem though, the FN key is still (unknown) when I set the shortcuts, and any command I use with just do Pause/Play.
And also whenever I use the command the foobar window pops up, is there a way for me to manage it in the background? (very useful when running games).
I hope this tread is still active! D:
Nevermind the second question, I realized I just had to remove the icpt.conf file. ^^;
My brother recommended I might like this blog.
He was entirely right. This post actually made my day.
You cann’t imagine simply how much time I had spent for this information! Thanks!
Thank you so much! It works with AIMP too:
window_class=TApplication
application_path=C:\Program Files (x86)\AIMP3\AIMP3.exe
I wanted to did the same (with AIMP) but I can’t save the config file because Notepad is saying it might be open in an other program. The problem is I can’t find which one. Did you experience the same issue ?
Thank youvery much, worked on my ux52vs. Exactly what I was looking for!
To use with vlc:
window_class=QWidget
application_path=C:\Program Files (x86)\VideoLAN\VLC\vlc.exe
Actually this doesnt work very well, as there are several „qWidget” classes. Is there anyway this can work with .exe file name or the window title?
its works pretty good with Media Player Classic Home cinema
here what you need to write for use MPC
window_class=MediaPlayerClassicW
application_path=C:\Program Files (x86)\K-Lite Codec Pack\Media Player Classic\mpc-hc.exe
but I have one problem when I switch the DMedia in the rar at the original I cannot use the shortcut for the Calculator (Fn+ enter (in the numpad)), it open the MPC
any help?
thanks and sorry for my english :(
I found a workaround. First of all I found out with the Task Manager that when pressing Fn + Enter it executed „SimAppExec.exe” instead of the Calculator. I found this file in the path „C:\Program Files (x86)\ASUS\ATK Package\ATK Hotkey”, so I deleted it and searched through the Windows folder for „calc.exe” and found the two necessary files to run the Calculator („calc.exe” and „calc.exe.mui”, there are many pairs, just choose one). Then I copied „calc.exe” into the „ATK Hotkey” folder and renamed it into „SimAppExec.exe”, and the same with „calc.exe.mui” into „SimAppExec.exe.mui”, and finally I moved the latter into a new folder called „es-ES” (which depends on the language of your system, hint: when searching for „calc.exe” you have to look the name of the folder that contains „calc.exe.mui”).
worked with asus n56vz and foobar 1.2.8! thanks a lot :D
Still Working ! , Asus A43SV with Windows 8.1 , ATK from Windows 7 64 Bit ,
Work with Zune (Not Xbox Music)
window_class=UIX Render Window
application_path=C:\Program Files\Zune\Zune.exe
You are so awesome! I do not suppose I’ve read
through a single thing like this before. So good to find someone with some genuine thoughts on this subject.
Seriously.. thank you for starting this up. This site is
one thing that’s needed on the web, someone with a bit of originality!
hi, zaak, why my hotkeys only called up Winamp and not do anything
is that any other configuration?
hi, zaak, why my hotkeys only called up Winamp and not do anything
is that any other configuration?
on itunes? any one?
Doesnt work with Asus K95VM, but disabled the annoying opening of Windows Media Center with it.
I found out how to see MusicBee window_class. By using Autohotkey Window Spy:
ahk_class is the window_class.
PS: Your file is offline
Link seems to be dead. Can you reupload the file? :)
Done :)
Cheers
There is no „DMedia.exe” file in zip folder. Should i rename „ATKMedia.exe” to DMedia.exe after copying files to ATK Media installation folder?
Great information. Lucky me I ran across your site by accident (stumbleupon).
I have saved it for later!
Doesn’t work on Asus N56VV. Changed window class id and still, your program acts like it isn’t running at all (but it is) and keys still work only with WMP just as before (even without running original DMedia.exe). I am on Windows 8.1. I’ll gladly send more info you want to.
I made it work with version from here http://3mptylab.blogspot.it/2012/09/how-to-make-asus-notebooks-media-keys.html
It’s edited version of that what is here. Doesn’t launch foobar when pressing play, but it’s minor problem.
Thx for your great work.
If this totally doesn’t work for somebody there is also program called MediaKeys, which allows you to define new keyboard shortcuts for media controls, but you can’t use Fn+key. Alt+arrow works pretty well there.
I got this site from mmy pal who tokd me about this web site and at tthe moment this time I
am visiting this website and reading very informative posts here.
Thank you very very much. Works on Windows 8.1 asus g46vw.
p.s. Doesn’t work with visual studio 2013 on full screen (((
Hello! I’ve tried your program but it did not work for me (Win 8.1 x64). I’ve tried make it work with MusicBee and Foobar, changed for each of them class (obtained with the help of winlister and corrected path to executable file of player. I just don’t know what am I doing wrong?
Can you please provide me aome advice?
Attractive component to content. I just stumbled upon your
weblog and in accession capital to claim that I acquire actually
enjoyed account your weblog posts. Anyway I’ll be subscribing to your augment and even I fulfillment you access persistently rapidly.
Hey Zaak! Same problem here in 2016. Could you please reupload the file? Thanks in advance!
Hey Tere! Thanks for pointing out that the link is down. I’ve reuploaded the file. Really courious if it still works, let me know! :)
Hey there, Zaak! Thanks for reuploading! :) But shame that I can’t make it work with MusicBee :( I used Window Detective as you suggested and tried changing the .conf file, which now looks like this:
window_class=WindowsForms10.Window.8.app.0.141b42a
application_path=C:\Program Files (x86)\MusicBee\MusicBee.exe
Still not working. Maybe there’s something wrong with the window class name? Any advice? I just want to get my play/pause key working with MusicBee (the rest of the media shortcuts surprisingly work fine) and stop Fn+down arrow from popping up the Windows Media Player installation window, which I also find quite weird, since WMP is already installed and working properly.
Thanks in advance! ;)
Thank you very much! Great work!
Although your likelihood of earning online keno truly boost using the amount of cards you’ve, there.
For some reason this isn’t work for me
ASUS N56V, Windows 10, ATKHotkey 1.0.0061, foobar2000 1.5.1
I modified it and got it working again.
Here is my version for anyone interested:
github.com/Lindsay-Needs-Sleep/ATKMediaInterceptor
Thank you for sharing this!!